Search in sources :

Example 11 with SurfaceType

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;
}
Also used : RenderLoops(sun.java2d.loops.RenderLoops) SurfaceType(sun.java2d.loops.SurfaceType) CompositeType(sun.java2d.loops.CompositeType)

Example 12 with SurfaceType

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();
}
Also used : Blit(sun.java2d.loops.Blit) SurfaceType(sun.java2d.loops.SurfaceType)

Example 13 with SurfaceType

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);
}
Also used : TransformBlit(sun.java2d.loops.TransformBlit) SurfaceData(sun.java2d.SurfaceData) SurfaceType(sun.java2d.loops.SurfaceType)

Aggregations

SurfaceType (sun.java2d.loops.SurfaceType)13 SurfaceData (sun.java2d.SurfaceData)6 InvalidPipeException (sun.java2d.InvalidPipeException)3 Blit (sun.java2d.loops.Blit)3 CompositeType (sun.java2d.loops.CompositeType)3 ColorModel (java.awt.image.ColorModel)2 DirectColorModel (java.awt.image.DirectColorModel)2 IndexColorModel (java.awt.image.IndexColorModel)2 RenderLoops (sun.java2d.loops.RenderLoops)2 TransformBlit (sun.java2d.loops.TransformBlit)2 AlphaComposite (java.awt.AlphaComposite)1 Composite (java.awt.Composite)1 GradientPaint (java.awt.GradientPaint)1 LinearGradientPaint (java.awt.LinearGradientPaint)1 Paint (java.awt.Paint)1 RadialGradientPaint (java.awt.RadialGradientPaint)1 TexturePaint (java.awt.TexturePaint)1 AffineTransform (java.awt.geom.AffineTransform)1 NoninvertibleTransformException (java.awt.geom.NoninvertibleTransformException)1 BufferedImage (java.awt.image.BufferedImage)1