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


Java Blit.locate方法代码示例

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


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

示例1: 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

示例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.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

示例3: doCopyArea

import sun.java2d.loops.Blit; //导入方法依赖的package包/类
private void doCopyArea(int x, int y, int w, int h, int dx, int dy) {
    if (w <= 0 || h <= 0) {
        return;
    }
    SurfaceData theData = surfaceData;
    if (theData.copyArea(this, x, y, w, h, dx, dy)) {
        return;
    }
    if (transformState > TRANSFORM_TRANSLATESCALE) {
        throw new InternalError("transformed copyArea not implemented yet");
    }
    // REMIND: This method does not deal with missing data from the
    // source object (i.e. it does not send exposure events...)

    Region clip = getCompClip();

    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;
        }
        lastCAblit = Blit.locate(dsttype, comptype, dsttype);
        lastCAcomp = comp;
    }

    double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
    transform.transform(coords, 0, coords, 0, 3);

    x = (int)Math.ceil(coords[0] - 0.5);
    y = (int)Math.ceil(coords[1] - 0.5);
    w = ((int)Math.ceil(coords[2] - 0.5)) - x;
    h = ((int)Math.ceil(coords[3] - 0.5)) - y;
    dx = ((int)Math.ceil(coords[4] - 0.5)) - x;
    dy = ((int)Math.ceil(coords[5] - 0.5)) - y;

    // In case of negative scale transform, reflect the rect coords.
    if (w < 0) {
        w *= -1;
        x -= w;
    }
    if (h < 0) {
        h *= -1;
        y -= h;
    }

    Blit ob = lastCAblit;
    if (dy == 0 && dx > 0 && dx < w) {
        while (w > 0) {
            int partW = Math.min(w, dx);
            w -= partW;
            int sx = x + w;
            ob.Blit(theData, theData, comp, clip,
                    sx, y, sx+dx, y+dy, partW, h);
        }
        return;
    }
    if (dy > 0 && dy < h && dx > -w && dx < w) {
        while (h > 0) {
            int partH = Math.min(h, dy);
            h -= partH;
            int sy = y + h;
            ob.Blit(theData, theData, comp, clip,
                    x, sy, x+dx, sy+dy, w, partH);
        }
        return;
    }
    ob.Blit(theData, theData, comp, clip, x, y, x+dx, y+dy, w, h);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:73,代码来源:SunGraphics2D.java

示例4: doCopyArea

import sun.java2d.loops.Blit; //导入方法依赖的package包/类
private void doCopyArea(int x, int y, int w, int h, int dx, int dy) {
    if (w <= 0 || h <= 0) {
        return;
    }

    if (transformState == SunGraphics2D.TRANSFORM_ISIDENT) {
        // do nothing
    } else if (transformState <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += transX;
        y += transY;
    } else if (transformState == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
        // In case of negative scale transform, reflect the rect coords.
        if (w < 0) {
            w = -w;
            x -= w;
        }
        if (h < 0) {
            h = -h;
            y -= h;
        }
    } else {
        throw new InternalError("transformed copyArea not implemented yet");
    }

    SurfaceData theData = surfaceData;
    if (theData.copyArea(this, x, y, w, h, dx, dy)) {
        return;
    }

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

    Region clip = getCompClip();

    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;
        }
        lastCAblit = Blit.locate(dsttype, comptype, dsttype);
        lastCAcomp = comp;
    }

    Blit ob = lastCAblit;
    if (dy == 0 && dx > 0 && dx < w) {
        while (w > 0) {
            int partW = Math.min(w, dx);
            w -= partW;
            int sx = x + w;
            ob.Blit(theData, theData, comp, clip,
                    sx, y, sx+dx, y+dy, partW, h);
        }
        return;
    }
    if (dy > 0 && dy < h && dx > -w && dx < w) {
        while (h > 0) {
            int partH = Math.min(h, dy);
            h -= partH;
            int sy = y + h;
            ob.Blit(theData, theData, comp, clip,
                    x, sy, x+dx, sy+dy, w, partH);
        }
        return;
    }
        ob.Blit(theData, theData, comp, clip, x, y, x+dx, y+dy, w, h);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:79,代码来源:SunGraphics2D.java


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