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


Java MaskFill类代码示例

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


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

示例1: getMaskFill

import sun.java2d.loops.MaskFill; //导入依赖的package包/类
@Override
protected MaskFill getMaskFill(SunGraphics2D sg2d) {
    if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) {
        /*
         * We can only accelerate non-Color MaskFill operations if
         * all of the following conditions hold true:
         *   - there is an implementation for the given paintState
         *   - the current Paint can be accelerated for this destination
         *   - multitexturing is available (since we need to modulate
         *     the alpha mask texture with the paint texture)
         *
         * In all other cases, we return null, in which case the
         * validation code will choose a more general software-based loop.
         */
        if (!OGLPaints.isValid(sg2d) ||
            !graphicsConfig.isCapPresent(CAPS_MULTITEXTURE))
        {
            return null;
        }
    }
    return super.getMaskFill(sg2d);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:OGLSurfaceData.java

示例2: getMaskFill

import sun.java2d.loops.MaskFill; //导入依赖的package包/类
@Override
protected MaskFill getMaskFill(SunGraphics2D sg2d) {
    if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR) {
        /*
         * We can only accelerate non-Color MaskFill operations if
         * all of the following conditions hold true:
         *   - there is an implementation for the given paintState
         *   - the current Paint can be accelerated for this destination
         *   - multitexturing is available (since we need to modulate
         *     the alpha mask texture with the paint texture)
         *
         * In all other cases, we return null, in which case the
         * validation code will choose a more general software-based loop.
         */
        if (!D3DPaints.isValid(sg2d) ||
            !graphicsDevice.isCapPresent(CAPS_MULTITEXTURE))
        {
            return null;
        }
    }
    return super.getMaskFill(sg2d);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:D3DSurfaceData.java

示例3: getMaskFill

import sun.java2d.loops.MaskFill; //导入依赖的package包/类
@Override
protected MaskFill getMaskFill(SunGraphics2D sg2d) {
    if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) {
        /*
         * We can only accelerate non-Color MaskFill operations if
         * all of the following conditions hold true:
         *   - there is an implementation for the given paintState
         *   - the current Paint can be accelerated for this destination
         *   - multitexturing is available (since we need to modulate
         *     the alpha mask texture with the paint texture)
         *
         * In all other cases, we return null, in which case the
         * validation code will choose a more general software-based loop.
         */
        if (!D3DPaints.isValid(sg2d) ||
            !graphicsDevice.isCapPresent(CAPS_MULTITEXTURE))
        {
            return null;
        }
    }
    return super.getMaskFill(sg2d);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:D3DSurfaceData.java

示例4: getMaskFill

import sun.java2d.loops.MaskFill; //导入依赖的package包/类
@Override
protected MaskFill getMaskFill(SunGraphics2D sg2d) {
    if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR) {
        /*
         * We can only accelerate non-Color MaskFill operations if
         * all of the following conditions hold true:
         *   - there is an implementation for the given paintState
         *   - the current Paint can be accelerated for this destination
         *   - multitexturing is available (since we need to modulate
         *     the alpha mask texture with the paint texture)
         *
         * In all other cases, we return null, in which case the
         * validation code will choose a more general software-based loop.
         */
        if (!OGLPaints.isValid(sg2d) ||
            !graphicsConfig.isCapPresent(CAPS_MULTITEXTURE))
        {
            return null;
        }
    }
    return super.getMaskFill(sg2d);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:23,代码来源:OGLSurfaceData.java

示例5: MaskFill

import sun.java2d.loops.MaskFill; //导入依赖的package包/类
@Override
public void MaskFill(SunGraphics2D sg2d, SurfaceData sData,
                     Composite comp,
                     final int x, final int y, final int w, final int h,
                     final byte[] mask,
                     final int maskoff, final int maskscan)
{
    AlphaComposite acomp = (AlphaComposite)comp;
    if (acomp.getRule() != AlphaComposite.SRC_OVER) {
        comp = AlphaComposite.SrcOver;
    }

    rq.lock();
    try {
        validateContext(sg2d, comp, BufferedContext.USE_MASK);

        // we adjust the mask length so that the mask ends on a
        // 4-byte boundary
        int maskBytesRequired;
        if (mask != null) {
            // we adjust the mask length so that the mask ends on a
            // 4-byte boundary
            maskBytesRequired = (mask.length + 3) & (~3);
        } else {
            // mask not needed
            maskBytesRequired = 0;
        }
        int totalBytesRequired = 32 + maskBytesRequired;

        RenderBuffer buf = rq.getBuffer();
        if (totalBytesRequired <= buf.capacity()) {
            if (totalBytesRequired > buf.remaining()) {
                // process the queue first and then enqueue the mask
                rq.flushNow();
            }

            buf.putInt(MASK_FILL);
            // enqueue parameters
            buf.putInt(x).putInt(y).putInt(w).putInt(h);
            buf.putInt(maskoff);
            buf.putInt(maskscan);
            buf.putInt(maskBytesRequired);
            if (mask != null) {
                // enqueue the mask
                int padding = maskBytesRequired - mask.length;
                buf.put(mask);
                if (padding != 0) {
                    buf.position(buf.position() + padding);
                }
            }
        } else {
            // queue is too small to accommodate entire mask; perform
            // the operation directly on the queue flushing thread
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    maskFill(x, y, w, h,
                             maskoff, maskscan, mask.length, mask);
                }
            });
        }
    } finally {
        rq.unlock();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:65,代码来源:BufferedMaskFill.java

示例6: MaskFill

import sun.java2d.loops.MaskFill; //导入依赖的package包/类
@Override
public void MaskFill(SunGraphics2D sg2d, SurfaceData sData,
                     Composite comp,
                     final int x, final int y, final int w, final int h,
                     final byte[] mask,
                     final int maskoff, final int maskscan)
{
    AlphaComposite acomp = (AlphaComposite)comp;
    if (acomp.getRule() != AlphaComposite.SRC_OVER) {
        comp = AlphaComposite.SrcOver;
    }

    rq.lock();
    try {
        validateContext(sg2d, comp, BufferedContext.USE_MASK);

        // we adjust the mask length so that the mask ends on a
        // 4-byte boundary
        int maskBytesRequired;
        if (mask != null) {
            // we adjust the mask length so that the mask ends on a
            // 4-byte boundary
            maskBytesRequired = (mask.length + 3) & (~3);
        } else {
            // mask not needed
            maskBytesRequired = 0;
        }
        int totalBytesRequired = 32 + maskBytesRequired;

        RenderBuffer buf = rq.getBuffer();
        if (totalBytesRequired <= buf.capacity()) {
            if (totalBytesRequired > buf.remaining()) {
                // process the queue first and then enqueue the mask
                rq.flushNow();
            }

            buf.putInt(MASK_FILL);
            // enqueue parameters
            buf.putInt(x).putInt(y).putInt(w).putInt(h);
            buf.putInt(maskoff);
            buf.putInt(maskscan);
            buf.putInt(maskBytesRequired);
            if (mask != null) {
                // enqueue the mask
                int padding = maskBytesRequired - mask.length;
                buf.put(mask);
                if (padding != 0) {
                    buf.position(buf.position() + padding);
                }
            }
        } else {
            // queue is too small to accomodate entire mask; perform
            // the operation directly on the queue flushing thread
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    maskFill(x, y, w, h,
                             maskoff, maskscan, mask.length, mask);
                }
            });
        }
    } finally {
        rq.unlock();
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:65,代码来源:BufferedMaskFill.java

示例7: getMaskFill

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


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