Ejemplo n.º 1
0
 /**
  * Enqueues a BLIT operation with the given parameters. Note that the RenderQueue lock must be
  * held before calling this method.
  */
 private static void enqueueBlit(
     RenderQueue rq,
     SurfaceData src,
     SurfaceData dst,
     int packedParams,
     int sx1,
     int sy1,
     int sx2,
     int sy2,
     double dx1,
     double dy1,
     double dx2,
     double dy2) {
   // assert rq.lock.isHeldByCurrentThread();
   RenderBuffer buf = rq.getBuffer();
   rq.ensureCapacityAndAlignment(72, 24);
   buf.putInt(BLIT);
   buf.putInt(packedParams);
   buf.putInt(sx1).putInt(sy1);
   buf.putInt(sx2).putInt(sy2);
   buf.putDouble(dx1).putDouble(dy1);
   buf.putDouble(dx2).putDouble(dy2);
   buf.putLong(src.getNativeOps());
   buf.putLong(dst.getNativeOps());
 }
Ejemplo n.º 2
0
  public void Blit(
      SurfaceData src,
      SurfaceData dst,
      Composite comp,
      Region clip,
      int sx,
      int sy,
      int dx,
      int dy,
      int w,
      int h) {
    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
      // make sure the RenderQueue keeps a hard reference to the
      // destination (sysmem) SurfaceData to prevent it from being
      // disposed while the operation is processed on the QFT
      rq.addReference(dst);

      RenderBuffer buf = rq.getBuffer();
      D3DContext.setScratchSurface(((D3DSurfaceData) src).getContext());

      rq.ensureCapacityAndAlignment(48, 32);
      buf.putInt(SURFACE_TO_SW_BLIT);
      buf.putInt(sx).putInt(sy);
      buf.putInt(dx).putInt(dy);
      buf.putInt(w).putInt(h);
      buf.putInt(typeval);
      buf.putLong(src.getNativeOps());
      buf.putLong(dst.getNativeOps());

      // always flush immediately
      rq.flushNow();
    } finally {
      rq.unlock();
    }
  }