• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SurfaceType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中sun.java2d.loops.SurfaceType的典型用法代码示例。如果您正苦于以下问题:Java SurfaceType类的具体用法?Java SurfaceType怎么用?Java SurfaceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SurfaceType类属于sun.java2d.loops包,在下文中一共展示了SurfaceType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: Transform

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
@Override
public synchronized void Transform(SurfaceData src, SurfaceData dst,
                                   Composite comp, Region clip,
                                   AffineTransform at, int hint, int srcx,
                                   int srcy, int dstx, int dsty, int width,
                                   int height){
    Blit convertsrc = Blit.getFromCache(src.getSurfaceType(),
                                        CompositeType.SrcNoEa,
                                        SurfaceType.IntArgbPre);
    // use cached intermediate surface, if available
    final SurfaceData cachedSrc = srcTmp != null ? srcTmp.get() : null;
    // convert source to IntArgbPre
    src = convertFrom(convertsrc, src, srcx, srcy, width, height, cachedSrc,
                      BufferedImage.TYPE_INT_ARGB_PRE);

    // transform IntArgbPre intermediate surface to D3D surface
    performop.Transform(src, dst, comp, clip, at, hint, 0, 0, dstx, dsty,
                        width, height);

    if (src != cachedSrc) {
        // cache the intermediate surface
        srcTmp = new WeakReference<>(src);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:D3DBlitLoops.java


示例2: getSolidLoops

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
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;
        }
    }
    RenderLoops l = makeRenderLoops(SurfaceType.OpaqueColor,
                                    CompositeType.SrcNoEa,
                                    type);
    System.arraycopy(loopcache, 1, loopcache, 0, CACHE_SIZE-1);
    System.arraycopy(typecache, 1, typecache, 0, CACHE_SIZE-1);
    loopcache[CACHE_SIZE - 1] = l;
    typecache[CACHE_SIZE - 1] = type;
    return l;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:BufImgSurfaceData.java


示例3: BufferedMaskBlit

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
protected BufferedMaskBlit(RenderQueue rq,
                           SurfaceType srcType,
                           CompositeType compType,
                           SurfaceType dstType)
{
    super(srcType, compType, dstType);
    this.rq = rq;
    if (srcType == SurfaceType.IntArgb) {
        this.srcTypeVal = ST_INT_ARGB;
    } else if (srcType == SurfaceType.IntArgbPre) {
        this.srcTypeVal = ST_INT_ARGB_PRE;
    } else if (srcType == SurfaceType.IntRgb) {
        this.srcTypeVal = ST_INT_RGB;
    } else if (srcType == SurfaceType.IntBgr) {
        this.srcTypeVal = ST_INT_BGR;
    } else {
        throw new InternalError("unrecognized source surface type");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:BufferedMaskBlit.java


示例4: scaleSurfaceData

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
protected boolean scaleSurfaceData(SunGraphics2D sg,
                                   Region clipRegion,
                                   SurfaceData srcData,
                                   SurfaceData dstData,
                                   SurfaceType srcType,
                                   SurfaceType dstType,
                                   int sx1, int sy1,
                                   int sx2, int sy2,
                                   double dx1, double dy1,
                                   double dx2, double dy2)
{
    CompositeType comp = sg.imageComp;
    if (CompositeType.SrcOverNoEa.equals(comp) &&
        (srcData.getTransparency() == Transparency.OPAQUE))
    {
        comp = CompositeType.SrcNoEa;
    }

    ScaledBlit blit = ScaledBlit.getFromCache(srcType, comp, dstType);
    if (blit != null) {
        blit.Scale(srcData, dstData, sg.composite, clipRegion,
                   sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2);
        return true;
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:DrawImage.java


示例5: register

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
 * Note that we do not register loops to 8-byte destinations.  This
 * is due to faster processing of dithering through our software
 * loops than through GDI StretchBlt processing.
 */
public static void register()
{
    GraphicsPrimitive[] primitives = {
        new GDIBlitLoops(SurfaceType.IntRgb,
                         GDIWindowSurfaceData.AnyGdi),
        new GDIBlitLoops(SurfaceType.Ushort555Rgb,
                         GDIWindowSurfaceData.AnyGdi,
                         0x7C00, 0x03E0, 0x001F),
        new GDIBlitLoops(SurfaceType.Ushort565Rgb,
                         GDIWindowSurfaceData.AnyGdi,
                         0xF800, 0x07E0, 0x001F),
        new GDIBlitLoops(SurfaceType.ThreeByteBgr,
                         GDIWindowSurfaceData.AnyGdi),
        new GDIBlitLoops(SurfaceType.ByteIndexedOpaque,
                         GDIWindowSurfaceData.AnyGdi,
                         true),
        new GDIBlitLoops(SurfaceType.Index8Gray,
                         GDIWindowSurfaceData.AnyGdi,
                         true),
        new GDIBlitLoops(SurfaceType.ByteGray,
                         GDIWindowSurfaceData.AnyGdi),
    };
    GraphicsPrimitiveMgr.register(primitives);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:GDIBlitLoops.java


示例6: Transform

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
@Override
public synchronized void Transform(SurfaceData src, SurfaceData dst,
                                   Composite comp, Region clip,
                                   AffineTransform at, int hint, int srcx,
                                   int srcy, int dstx, int dsty, int width,
                                   int height){
    Blit convertsrc = Blit.getFromCache(src.getSurfaceType(),
                                        CompositeType.SrcNoEa,
                                        SurfaceType.IntArgbPre);
    // use cached intermediate surface, if available
    final SurfaceData cachedSrc = srcTmp != null ? srcTmp.get() : null;
    // convert source to IntArgbPre
    src = convertFrom(convertsrc, src, srcx, srcy, width, height, cachedSrc,
                      BufferedImage.TYPE_INT_ARGB_PRE);

    // transform IntArgbPre intermediate surface to OpenGL surface
    performop.Transform(src, dst, comp, clip, at, hint, 0, 0, dstx, dsty,
                        width, height);

    if (src != cachedSrc) {
        // cache the intermediate surface
        srcTmp = new WeakReference<>(src);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:OGLBlitLoops.java


示例7: getSolidLoops

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
 * Return the RenderLoops this type of destination uses for
 * solid fills and strokes.
 */
public synchronized RenderLoops getSolidLoops(SurfaceType stype) {
    if (solidloops == null) {
        solidloops = SurfaceData.makeRenderLoops(SurfaceType.OpaqueColor,
                                                 CompositeType.SrcNoEa,
                                                 stype);
    }
    return solidloops;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:X11GraphicsConfig.java


示例8: X11WindowSurfaceData

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public X11WindowSurfaceData(X11ComponentPeer peer,
                            X11GraphicsConfig gc,
                            SurfaceType sType) {
    super(peer, gc, sType, peer.getColorModel());
    if (isDrawableValid()) {
        makePipes();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:X11SurfaceData.java


示例9: getPaintSurfaceType

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
private static SurfaceType getPaintSurfaceType(SunGraphics2D sg2d) {
    switch (sg2d.paintState) {
    case SunGraphics2D.PAINT_OPAQUECOLOR:
        return SurfaceType.OpaqueColor;
    case SunGraphics2D.PAINT_ALPHACOLOR:
        return SurfaceType.AnyColor;
    case SunGraphics2D.PAINT_GRADIENT:
        if (sg2d.paint.getTransparency() == OPAQUE) {
            return SurfaceType.OpaqueGradientPaint;
        } else {
            return SurfaceType.GradientPaint;
        }
    case SunGraphics2D.PAINT_LIN_GRADIENT:
        if (sg2d.paint.getTransparency() == OPAQUE) {
            return SurfaceType.OpaqueLinearGradientPaint;
        } else {
            return SurfaceType.LinearGradientPaint;
        }
    case SunGraphics2D.PAINT_RAD_GRADIENT:
        if (sg2d.paint.getTransparency() == OPAQUE) {
            return SurfaceType.OpaqueRadialGradientPaint;
        } else {
            return SurfaceType.RadialGradientPaint;
        }
    case SunGraphics2D.PAINT_TEXTURE:
        if (sg2d.paint.getTransparency() == OPAQUE) {
            return SurfaceType.OpaqueTexturePaint;
        } else {
            return SurfaceType.TexturePaint;
        }
    default:
    case SunGraphics2D.PAINT_CUSTOM:
        return SurfaceType.AnyPaint;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:SurfaceData.java


示例10: updateSurfaceData

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:SurfaceDataProxy.java


示例11: getSurfaceType

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public static SurfaceType getSurfaceType(ColorModel cm) {
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            if (((DirectColorModel)cm).getRedMask() == 0xff0000) {
                return IntRgbGdi;
            } else {
                return SurfaceType.IntRgbx;
            }
        } else {
            return ThreeByteBgrGdi;
        }
    case 15:
        return Ushort555RgbGdi;
    case 16:
        if ((cm instanceof DirectColorModel) &&
            (((DirectColorModel)cm).getBlueMask() == 0x3e))
        {
            return SurfaceType.Ushort555Rgbx;
        } else {
            return Ushort565RgbGdi;
        }
    case 8:
        if (cm.getColorSpace().getType() == ColorSpace.TYPE_GRAY &&
            cm instanceof ComponentColorModel) {
            return SurfaceType.ByteGray;
        } else if (cm instanceof IndexColorModel &&
                   isOpaqueGray((IndexColorModel)cm)) {
            return SurfaceType.Index8Gray;
        } else {
            return SurfaceType.ByteIndexedOpaque;
        }
    default:
        throw new sun.java2d.InvalidPipeException("Unsupported bit " +
                                                  "depth: " +
                                                  cm.getPixelSize());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:40,代码来源:GDIWindowSurfaceData.java


示例12: BufferedMaskFill

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
protected BufferedMaskFill(RenderQueue rq,
                           SurfaceType srcType,
                           CompositeType compType,
                           SurfaceType dstType)
{
    super(srcType, compType, dstType);
    this.rq = rq;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:BufferedMaskFill.java


示例13: getProxyKeyFor

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public Object getProxyKeyFor(SurfaceType st) {
    synchronized (x11ProxyKeyMap) {
        Object o = x11ProxyKeyMap.get(st);
        if (o == null) {
            o = new Object();
            x11ProxyKeyMap.put(st, o);
        }
        return o;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:X11GraphicsDevice.java


示例14: getSolidLoops

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public synchronized RenderLoops getSolidLoops(SurfaceType stype) {
    if (solidloops == null || sTypeOrig != stype) {
        solidloops = SurfaceData.makeRenderLoops(SurfaceType.OpaqueColor,
                                                 CompositeType.SrcNoEa,
                                                 stype);
        sTypeOrig = stype;
    }
    return solidloops;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:Win32GraphicsConfig.java


示例15: GDIWindowSurfaceData

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:34,代码来源:GDIWindowSurfaceData.java


示例16: createDataIC

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public static SurfaceData createDataIC(BufferedImage bImg,
                                       SurfaceType sType) {
    IntegerComponentRaster icRaster =
        (IntegerComponentRaster)bImg.getRaster();
    BufImgSurfaceData bisd =
        new BufImgSurfaceData(icRaster.getDataBuffer(), bImg, sType);
    bisd.initRaster(icRaster.getDataStorage(),
                    icRaster.getDataOffset(0) * 4, 0,
                    icRaster.getWidth(),
                    icRaster.getHeight(),
                    icRaster.getPixelStride() * 4,
                    icRaster.getScanlineStride() * 4,
                    null);
    return bisd;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:BufImgSurfaceData.java


示例17: getCustomSurfaceType

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
 * Returns the appropriate SurfaceType corresponding to the given D3D
 * surface type constant (e.g. TEXTURE -> D3DTexture).
 */
private static SurfaceType getCustomSurfaceType(int d3dType) {
    switch (d3dType) {
    case TEXTURE:
        return D3DTexture;
    case RT_TEXTURE:
        return D3DSurfaceRTT;
    default:
        return D3DSurface;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:D3DSurfaceData.java


示例18: BufImgSurfaceData

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public BufImgSurfaceData(DataBuffer db,
                         BufferedImage bufImg, SurfaceType sType)
{
    super(SunWritableRaster.stealTrackable(db),
          sType, bufImg.getColorModel());
    this.bufImg = bufImg;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:BufImgSurfaceData.java


示例19: getRenderLoops

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:SurfaceData.java


示例20: renderImageXform

import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
@Override
protected void renderImageXform(SunGraphics2D sg, Image img,
                                AffineTransform tx, int interpType,
                                int sx1, int sy1, int sx2, int sy2,
                                Color bgColor)
{
    // punt to the MediaLib-based transformImage() in the superclass if:
    //     - bicubic interpolation is specified
    //     - a background color is specified and will be used
    //     - an appropriate TransformBlit primitive could not be found
    if (interpType != AffineTransformOp.TYPE_BICUBIC) {
        SurfaceData dstData = sg.surfaceData;
        SurfaceData srcData =
            dstData.getSourceSurfaceData(img,
                                         SunGraphics2D.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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:D3DDrawImage.java



注:本文中的sun.java2d.loops.SurfaceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RequestHeaderAuthenticationFilter类代码示例发布时间:2022-05-21
下一篇:
Java ConstructorDoc类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap