use of sun.java2d.loops.SurfaceType 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.SurfaceType in project jdk8u_jdk by JetBrains.
the class SurfaceDataProxy method updateSurfaceData.
/**
* This is the default implementation for updating the cached
* SurfaceData from the source (primary) SurfaceData.
* A simple Blit is used to copy the pixels from the source to
* the destination SurfaceData.
* A subclass can override this implementation if a more complex
* operation is required to update its cached copies.
*/
public void updateSurfaceData(SurfaceData srcData, SurfaceData dstData, int w, int h) {
SurfaceType srcType = srcData.getSurfaceType();
SurfaceType dstType = dstData.getSurfaceType();
Blit blit = Blit.getFromCache(srcType, CompositeType.SrcNoEa, dstType);
blit.Blit(srcData, dstData, AlphaComposite.Src, null, 0, 0, 0, 0, w, h);
dstData.markDirty();
}
use of sun.java2d.loops.SurfaceType in project jdk8u_jdk by JetBrains.
the class D3DDrawImage method renderImageXform.
@Override
protected void renderImageXform(SunGraphics2D sg, Image img, AffineTransform tx, int interpType, int sx1, int sy1, int sx2, int sy2, Color bgColor) {
// - an appropriate TransformBlit primitive could not be found
if (interpType != AffineTransformOp.TYPE_BICUBIC) {
SurfaceData dstData = sg.surfaceData;
SurfaceData srcData = dstData.getSourceSurfaceData(img, sg.TRANSFORM_GENERIC, sg.imageComp, bgColor);
if (srcData != null && !isBgOperation(srcData, bgColor)) {
SurfaceType srcType = srcData.getSurfaceType();
SurfaceType dstType = dstData.getSurfaceType();
TransformBlit blit = TransformBlit.getFromCache(srcType, sg.imageComp, dstType);
if (blit != null) {
blit.Transform(srcData, dstData, sg.composite, sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2 - sx1, sy2 - sy1);
return;
}
}
}
super.renderImageXform(sg, img, tx, interpType, sx1, sy1, sx2, sy2, bgColor);
}
Aggregations