本文整理汇总了Java中sun.java2d.loops.MaskBlit类的典型用法代码示例。如果您正苦于以下问题:Java MaskBlit类的具体用法?Java MaskBlit怎么用?Java MaskBlit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MaskBlit类属于sun.java2d.loops包,在下文中一共展示了MaskBlit类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MaskBlit
import sun.java2d.loops.MaskBlit; //导入依赖的package包/类
@Override
public void MaskBlit(SurfaceData src, SurfaceData dst,
Composite comp, Region clip,
int srcx, int srcy,
int dstx, int dsty,
int width, int height,
byte[] mask, int maskoff, int maskscan)
{
if (width <= 0 || height <= 0) {
return;
}
if (mask == null) {
// no mask involved; delegate to regular blit loop
if (blitop == null) {
blitop = Blit.getFromCache(src.getSurfaceType(),
CompositeType.AnyAlpha,
this.getDestType());
}
blitop.Blit(src, dst,
comp, clip,
srcx, srcy, dstx, dsty,
width, height);
return;
}
AlphaComposite acomp = (AlphaComposite)comp;
if (acomp.getRule() != AlphaComposite.SRC_OVER) {
comp = AlphaComposite.SrcOver;
}
rq.lock();
try {
validateContext(dst, comp, clip);
RenderBuffer buf = rq.getBuffer();
int totalBytesRequired = 20 + (width * height * 4);
/*
* REMIND: we should fix this so that it works with tiles that
* are larger than the entire buffer, but the native
* OGL/D3DMaskBlit isn't even prepared for tiles larger
* than 32x32 pixels, so there's no urgency here...
*/
rq.ensureCapacity(totalBytesRequired);
// enqueue parameters and tile pixels
int newpos = enqueueTile(buf.getAddress(), buf.position(),
src, src.getNativeOps(), srcTypeVal,
mask, mask.length, maskoff, maskscan,
srcx, srcy, dstx, dsty,
width, height);
buf.position(newpos);
} finally {
rq.unlock();
}
}