474 * @return true if there is any chance that an XCopyArea from the 475 * given source coordinates could produce any X11 476 * Exposure events. 477 */ 478 public abstract boolean canSourceSendExposures(int x, int y, int w, int h); 479 480 public boolean copyArea(SunGraphics2D sg2d, 481 int x, int y, int w, int h, int dx, int dy) 482 { 483 if (x11pipe == null) { 484 if (!isDrawableValid()) { 485 return true; 486 } 487 makePipes(); 488 } 489 CompositeType comptype = sg2d.imageComp; 490 if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE && 491 (CompositeType.SrcOverNoEa.equals(comptype) || 492 CompositeType.SrcNoEa.equals(comptype))) 493 { 494 x += sg2d.transX; 495 y += sg2d.transY; 496 SunToolkit.awtLock(); 497 try { 498 boolean needExposures = canSourceSendExposures(x, y, w, h); 499 long xgc = getBlitGC(sg2d.getCompClip(), needExposures); 500 x11pipe.devCopyArea(getNativeOps(), xgc, 501 x, y, 502 x + dx, y + dy, 503 w, h); 504 } finally { 505 SunToolkit.awtUnlock(); 506 } 507 return true; 508 } 509 return false; 510 } 511 512 public static SurfaceType getSurfaceType(X11GraphicsConfig gc, 513 int transparency) 514 { 515 return getSurfaceType(gc, transparency, false); | 474 * @return true if there is any chance that an XCopyArea from the 475 * given source coordinates could produce any X11 476 * Exposure events. 477 */ 478 public abstract boolean canSourceSendExposures(int x, int y, int w, int h); 479 480 public boolean copyArea(SunGraphics2D sg2d, 481 int x, int y, int w, int h, int dx, int dy) 482 { 483 if (x11pipe == null) { 484 if (!isDrawableValid()) { 485 return true; 486 } 487 makePipes(); 488 } 489 CompositeType comptype = sg2d.imageComp; 490 if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE && 491 (CompositeType.SrcOverNoEa.equals(comptype) || 492 CompositeType.SrcNoEa.equals(comptype))) 493 { 494 SunToolkit.awtLock(); 495 try { 496 boolean needExposures = canSourceSendExposures(x, y, w, h); 497 long xgc = getBlitGC(sg2d.getCompClip(), needExposures); 498 x11pipe.devCopyArea(getNativeOps(), xgc, 499 x, y, 500 x + dx, y + dy, 501 w, h); 502 } finally { 503 SunToolkit.awtUnlock(); 504 } 505 return true; 506 } 507 return false; 508 } 509 510 public static SurfaceType getSurfaceType(X11GraphicsConfig gc, 511 int transparency) 512 { 513 return getSurfaceType(gc, transparency, false); |