Examples of SurfaceType


Examples of sun.java2d.loops.SurfaceType

    public static SurfaceType getSurfaceType(X11GraphicsConfig gc,
                                             int transparency)
    {
        boolean transparent = (transparency == Transparency.BITMASK);
        SurfaceType sType;
        ColorModel cm = gc.getColorModel();
        switch (cm.getPixelSize()) {
        case 24:
            if (gc.getBitsPerPixel() == 24) {
                if (cm instanceof DirectColorModel) {
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

     */
    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,
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

     */
    public void updateSurfaceDataBg(SurfaceData srcData,
                                    SurfaceData dstData,
                                    int w, int h, Color bgColor)
    {
        SurfaceType srcType = srcData.getSurfaceType();
        SurfaceType dstType = dstData.getSurfaceType();
        BlitBg blitbg = BlitBg.getFromCache(srcType,
                                            CompositeType.SrcNoEa,
                                            dstType);
        blitbg.BlitBg(srcData, dstData,
                      AlphaComposite.Src, null, bgColor.getRGB(),
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

                                             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) {
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

    }

    public static Win32SurfaceData createData(WComponentPeer peer,
                                              int numBuffers)
    {
        SurfaceType sType = getSurfaceType(peer.getDeviceColorModel());
        return new Win32SurfaceData(peer, sType, numBuffers);
    }
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

        }
        return false;
    }

    protected static SurfaceType getSurfaceType(X11GraphicsConfig gc, boolean transparent) {
        SurfaceType sType;
        ColorModel cm = gc.getColorModel();
        switch (cm.getPixelSize()) {
        case 24:
            if (gc.getBitsPerPixel() == 24) {
                if (cm instanceof DirectColorModel) {
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

     * 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;
        switch (sg2d.paintState) {
        case SunGraphics2D.PAINT_SOLIDCOLOR:
            src = SurfaceType.OpaqueColor;
            break;
        case SunGraphics2D.PAINT_SINGLECOLOR:
            src = SurfaceType.AnyColor;
            break;
        default:
        case SunGraphics2D.PAINT_TILE:
            // REMIND: Distinguish Gradient and Texture fills...
            src = SurfaceType.AnyPaint;
            break;
        }
        CompositeType comp = sg2d.fillComp;
        SurfaceType dst = sg2d.getSurfaceData().getSurfaceType();

        Object o = loopcache.get(src, comp, dst);
        if (o != null) {
            return (RenderLoops) o;
        }
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

        case BufferedImage.TYPE_USHORT_555_RGB:
            sData = createDataSC(bufImg, SurfaceType.Ushort555Rgb, null);
            break;
        case BufferedImage.TYPE_BYTE_INDEXED:
            {
                SurfaceType sType;
                switch (cm.getTransparency()) {
                case OPAQUE:
                    if (isOpaqueGray((IndexColorModel)cm)) {
                        sType = SurfaceType.Index8Gray;
                    } else {
                        sType = SurfaceType.ByteIndexedOpaque;
                    }
                    break;
                case BITMASK:
                    sType = SurfaceType.ByteIndexedBm;
                    break;
                case TRANSLUCENT:
                    sType = SurfaceType.ByteIndexed;
                    break;
                default:
                    throw new InternalError("Unrecognized transparency");
                }
                sData = createDataBC(bufImg, sType, 0);
            }
            break;
        case BufferedImage.TYPE_BYTE_GRAY:
            sData = createDataBC(bufImg, SurfaceType.ByteGray, 0);
            break;
        case BufferedImage.TYPE_USHORT_GRAY:
            sData = createDataSC(bufImg, SurfaceType.UshortGray, null);
            break;
        case BufferedImage.TYPE_BYTE_BINARY:
            {
                SurfaceType sType;
                SampleModel sm = bufImg.getRaster().getSampleModel();
                switch (sm.getSampleSize(0)) {
                case 1:
                    sType = SurfaceType.ByteBinary1Bit;
                    break;
                case 2:
                    sType = SurfaceType.ByteBinary2Bit;
                    break;
                case 4:
                    sType = SurfaceType.ByteBinary4Bit;
                    break;
                default:
                    throw new InternalError("Unrecognized pixel size");
                }
                sData = createDataBP(bufImg, sType);
            }
            break;
        case BufferedImage.TYPE_CUSTOM:
        default:
            {
                Raster raster = bufImg.getRaster();
                int numBands = raster.getNumBands();
                if (raster instanceof IntegerComponentRaster &&
                    raster.getNumDataElements() == 1 &&
                    ((IntegerComponentRaster)raster).getPixelStride() == 1)
                {
                    SurfaceType sType = SurfaceType.AnyInt;
                    if (cm instanceof DirectColorModel) {
                        DirectColorModel dcm = (DirectColorModel) cm;
                        int aMask = dcm.getAlphaMask();
                        int rMask = dcm.getRedMask();
                        int gMask = dcm.getGreenMask();
                        int bMask = dcm.getBlueMask();
                        if (numBands == 3 &&
                            aMask == 0 &&
                            rMask == DCM_RGBX_RED_MASK &&
                            gMask == DCM_RGBX_GREEN_MASK &&
                            bMask == DCM_RGBX_BLUE_MASK)
                        {
                            sType = SurfaceType.IntRgbx;
                        } else if (numBands == 4 &&
                                   aMask == DCM_ARGBBM_ALPHA_MASK &&
                                   rMask == DCM_ARGBBM_RED_MASK &&
                                   gMask == DCM_ARGBBM_GREEN_MASK &&
                                   bMask == DCM_ARGBBM_BLUE_MASK)
                        {
                            sType = SurfaceType.IntArgbBm;
                        } else {
                            sType = SurfaceType.AnyDcm;
                        }
                    }
                    sData = createDataIC(bufImg, sType);
                    break;
                } else if (raster instanceof ShortComponentRaster &&
                           raster.getNumDataElements() == 1 &&
                           ((ShortComponentRaster)raster).getPixelStride() == 1)
                {
                    SurfaceType sType = SurfaceType.AnyShort;
                    IndexColorModel icm = null;
                    if (cm instanceof DirectColorModel) {
                        DirectColorModel dcm = (DirectColorModel) cm;
                        int aMask = dcm.getAlphaMask();
                        int rMask = dcm.getRedMask();
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

    private static final int CACHE_SIZE = 5;
    private static RenderLoops loopcache[] = new RenderLoops[CACHE_SIZE];
    private static SurfaceType typecache[] = new SurfaceType[CACHE_SIZE];
    public static synchronized RenderLoops getSolidLoops(SurfaceType type) {
        for (int i = CACHE_SIZE - 1; i >= 0; i--) {
            SurfaceType t = typecache[i];
            if (t == type) {
                return loopcache[i];
            } else if (t == null) {
                break;
            }
View Full Code Here

Examples of sun.java2d.loops.SurfaceType

        // REMIND: This method does not deal with missing data from the
        // source object (i.e. it does not send exposure events...)

        Composite comp = composite;
        if (lastCAcomp != comp) {
            SurfaceType dsttype = theData.getSurfaceType();
            CompositeType comptype = imageComp;
            if (CompositeType.SrcOverNoEa.equals(comptype) &&
                theData.getTransparency() == Transparency.OPAQUE)
            {
                comptype = CompositeType.SrcNoEa;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.