use of sun.java2d.loops.CompositeType in project jdk8u_jdk by JetBrains.
the class SurfaceData method getMaskFill.
/**
* Returns a MaskFill object that can be used on this destination
* with the source (paint) and composite types determined by the given
* SunGraphics2D, or null if no such MaskFill object can be located.
* Subclasses can override this method if they wish to filter other
* attributes (such as the hardware capabilities of the destination
* surface) before returning a specific MaskFill object.
*/
protected MaskFill getMaskFill(SunGraphics2D sg2d) {
SurfaceType src = getPaintSurfaceType(sg2d);
CompositeType comp = getFillCompositeType(sg2d);
SurfaceType dst = getSurfaceType();
return MaskFill.getFromCache(src, comp, dst);
}
use of sun.java2d.loops.CompositeType in project jdk8u_jdk by JetBrains.
the class SurfaceData method getRenderLoops.
/**
* Return a RenderLoops object containing all of the basic
* GraphicsPrimitive objects for rendering to the destination
* surface with the current attributes of the given SunGraphics2D.
*/
public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
SurfaceType src = getPaintSurfaceType(sg2d);
CompositeType comp = getFillCompositeType(sg2d);
SurfaceType dst = sg2d.getSurfaceData().getSurfaceType();
Object o = loopcache.get(src, comp, dst);
if (o != null) {
return (RenderLoops) o;
}
RenderLoops loops = makeRenderLoops(src, comp, dst);
loopcache.put(src, comp, dst, loops);
return loops;
}
use of sun.java2d.loops.CompositeType in project jdk8u_jdk by JetBrains.
the class X11SurfaceData method copyArea.
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy) {
if (x11pipe == null) {
if (!isDrawableValid()) {
return true;
}
makePipes();
}
CompositeType comptype = sg2d.imageComp;
if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE && (CompositeType.SrcOverNoEa.equals(comptype) || CompositeType.SrcNoEa.equals(comptype))) {
x += sg2d.transX;
y += sg2d.transY;
SunToolkit.awtLock();
try {
boolean needExposures = canSourceSendExposures(x, y, w, h);
long xgc = getBlitGC(sg2d.getCompClip(), needExposures);
x11pipe.devCopyArea(getNativeOps(), xgc, x, y, x + dx, y + dy, w, h);
} finally {
SunToolkit.awtUnlock();
}
return true;
}
return false;
}
use of sun.java2d.loops.CompositeType in project jdk8u_jdk by JetBrains.
the class GDIWindowSurfaceData method copyArea.
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy) {
CompositeType comptype = sg2d.imageComp;
if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE && sg2d.clipState != sg2d.CLIP_SHAPE && (CompositeType.SrcOverNoEa.equals(comptype) || CompositeType.SrcNoEa.equals(comptype))) {
x += sg2d.transX;
y += sg2d.transY;
int dstx1 = x + dx;
int dsty1 = y + dy;
int dstx2 = dstx1 + w;
int dsty2 = dsty1 + h;
Region clip = sg2d.getCompClip();
if (dstx1 < clip.getLoX())
dstx1 = clip.getLoX();
if (dsty1 < clip.getLoY())
dsty1 = clip.getLoY();
if (dstx2 > clip.getHiX())
dstx2 = clip.getHiX();
if (dsty2 > clip.getHiY())
dsty2 = clip.getHiY();
if (dstx1 < dstx2 && dsty1 < dsty2) {
gdiPipe.devCopyArea(this, dstx1 - dx, dsty1 - dy, dx, dy, dstx2 - dstx1, dsty2 - dsty1);
}
return true;
}
return false;
}
Aggregations