当前位置: 首页>>代码示例>>Java>>正文


Java Blit类代码示例

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


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

示例1: Transform

import sun.java2d.loops.Blit; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:OGLBlitLoops.java

示例2: blitSurfaceData

import sun.java2d.loops.Blit; //导入依赖的package包/类
private void blitSurfaceData(final SurfaceData src, final SurfaceData dst) {
    //TODO blit. proof-of-concept
    if (src != dst && src != null && dst != null
        && !(dst instanceof NullSurfaceData)
        && !(src instanceof NullSurfaceData)
        && src.getSurfaceType().equals(dst.getSurfaceType())
        && src.getDefaultScale() == dst.getDefaultScale()) {
        final Rectangle size = src.getBounds();
        final Blit blit = Blit.locate(src.getSurfaceType(),
                                      CompositeType.Src,
                                      dst.getSurfaceType());
        if (blit != null) {
            blit.Blit(src, dst, AlphaComposite.Src, null, 0, 0, 0, 0,
                      size.width, size.height);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:LWWindowPeer.java

示例3: Transform

import sun.java2d.loops.Blit; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:D3DBlitLoops.java

示例4: Blit

import sun.java2d.loops.Blit; //导入依赖的package包/类
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy,
                 int dx, int dy,
                 int w, int h)
{
    SunToolkit.awtLock();
    try {
        X11SurfaceData x11sd = (X11SurfaceData)dst;
        // pass null clip region here since we clip manually in native code
        // also use false for needExposures since we clip to the pixmap
        long xgc = x11sd.getBlitGC(null, false);
        nativeBlit(src.getNativeOps(), dst.getNativeOps(), xgc, clip,
                   sx, sy, dx, dy, w, h);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:X11PMBlitLoops.java

示例5: blitSurfaceData

import sun.java2d.loops.Blit; //导入依赖的package包/类
private void blitSurfaceData(final SurfaceData src, final SurfaceData dst) {
    //TODO blit. proof-of-concept
    if (src != dst && src != null && dst != null
        && !(dst instanceof NullSurfaceData)
        && !(src instanceof NullSurfaceData)
        && src.getSurfaceType().equals(dst.getSurfaceType())
        && src.getDefaultScaleX() == dst.getDefaultScaleX()
        && src.getDefaultScaleY() == dst.getDefaultScaleY())
    {
        final Rectangle size = src.getBounds();
        final Blit blit = Blit.locate(src.getSurfaceType(),
                                      CompositeType.Src,
                                      dst.getSurfaceType());
        if (blit != null) {
            blit.Blit(src, dst, AlphaComposite.Src, null, 0, 0, 0, 0,
                      size.width, size.height);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:LWWindowPeer.java

示例6: updateSurfaceData

import sun.java2d.loops.Blit; //导入依赖的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

示例7: Blit

import sun.java2d.loops.Blit; //导入依赖的package包/类
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy, int w, int h)
{
    OGLBlitLoops.IsoBlit(src, dst,
                         null, null,
                         comp, clip, null,
                         AffineTransformOp.TYPE_NEAREST_NEIGHBOR,
                         sx, sy, sx+w, sy+h,
                         dx, dy, dx+w, dy+h,
                         false);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:OGLBlitLoops.java

示例8: complexClipBlit

import sun.java2d.loops.Blit; //导入依赖的package包/类
private synchronized void complexClipBlit(SurfaceData src, SurfaceData dst,
                                          Composite comp, Region clip,
                                          int sx, int sy, int dx, int dy,
                                          int w, int h) {
    SurfaceData cachedSrc = null;
    if (srcTmp != null) {
        // use cached intermediate surface, if available
        cachedSrc = srcTmp.get();
    }

    // We can convert argb_pre data from OpenGL surface in two places:
    // - During OpenGL surface -> SW blit
    // - During SW -> SW blit
    // The first one is faster when we use opaque OGL surface, because in
    // this case we simply skip conversion and use color components as is.
    // Because of this we align intermediate buffer type with type of
    // destination not source.
    final int type = typeval == OGLSurfaceData.PF_INT_ARGB_PRE ?
                     BufferedImage.TYPE_INT_ARGB_PRE :
                     BufferedImage.TYPE_INT_ARGB;

    src = convertFrom(this, src, sx, sy, w, h, cachedSrc, type);

    // copy intermediate SW to destination SW using complex clip
    final Blit performop = Blit.getFromCache(src.getSurfaceType(),
                                             CompositeType.SrcNoEa,
                                             dst.getSurfaceType());
    performop.Blit(src, dst, comp, clip, 0, 0, dx, dy, w, h);

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

示例9: Scale

import sun.java2d.loops.Blit; //导入依赖的package包/类
public void Scale(SurfaceData src, SurfaceData dst,
                  Composite comp, Region clip,
                  int sx1, int sy1,
                  int sx2, int sy2,
                  double dx1, double dy1,
                  double dx2, double dy2)
{
    OGLBlitLoops.Blit(src, dst,
                      comp, clip, null,
                      AffineTransformOp.TYPE_NEAREST_NEIGHBOR,
                      sx1, sy1, sx2, sy2,
                      dx1, dy1, dx2, dy2,
                      typeval, false);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:OGLBlitLoops.java

示例10: OGLGeneralBlit

import sun.java2d.loops.Blit; //导入依赖的package包/类
OGLGeneralBlit(SurfaceType dstType,
               CompositeType compType,
               Blit performop)
{
    super(SurfaceType.Any, compType, dstType);
    this.performop = performop;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:OGLBlitLoops.java

示例11: Blit

import sun.java2d.loops.Blit; //导入依赖的package包/类
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy, int w, int h)
{
    D3DBlitLoops.IsoBlit(src, dst,
                         null, null,
                         comp, clip, null,
                         AffineTransformOp.TYPE_NEAREST_NEIGHBOR,
                         sx, sy, sx+w, sy+h,
                         dx, dy, dx+w, dy+h,
                         false);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:D3DBlitLoops.java

示例12: Scale

import sun.java2d.loops.Blit; //导入依赖的package包/类
public void Scale(SurfaceData src, SurfaceData dst,
                  Composite comp, Region clip,
                  int sx1, int sy1,
                  int sx2, int sy2,
                  double dx1, double dy1,
                  double dx2, double dy2)
{
    D3DBlitLoops.Blit(src, dst,
                      comp, clip, null,
                      AffineTransformOp.TYPE_NEAREST_NEIGHBOR,
                      sx1, sy1, sx2, sy2,
                      dx1, dy1, dx2, dy2,
                      typeval, false);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:D3DBlitLoops.java


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