Search in sources :

Example 6 with CompositeType

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

Example 7 with CompositeType

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

Example 8 with CompositeType

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

Example 9 with CompositeType

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

Aggregations

CompositeType (sun.java2d.loops.CompositeType)9 SurfaceType (sun.java2d.loops.SurfaceType)3 AlphaComposite (java.awt.AlphaComposite)2 GradientPaint (java.awt.GradientPaint)2 LinearGradientPaint (java.awt.LinearGradientPaint)2 Paint (java.awt.Paint)2 RadialGradientPaint (java.awt.RadialGradientPaint)2 TexturePaint (java.awt.TexturePaint)2 Blit (sun.java2d.loops.Blit)2 ScaledBlit (sun.java2d.loops.ScaledBlit)2 XORComposite (sun.java2d.loops.XORComposite)2 Region (sun.java2d.pipe.Region)2 Composite (java.awt.Composite)1 PaintContext (java.awt.PaintContext)1 BufferedImage (java.awt.image.BufferedImage)1 ColorModel (java.awt.image.ColorModel)1 Raster (java.awt.image.Raster)1 WritableRaster (java.awt.image.WritableRaster)1 WeakReference (java.lang.ref.WeakReference)1 BufImgSurfaceData (sun.awt.image.BufImgSurfaceData)1