本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例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);
}