本文整理汇总了Java中sun.java2d.pipe.RenderQueue类的典型用法代码示例。如果您正苦于以下问题:Java RenderQueue类的具体用法?Java RenderQueue怎么用?Java RenderQueue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RenderQueue类属于sun.java2d.pipe包,在下文中一共展示了RenderQueue类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enqueueBlit
import sun.java2d.pipe.RenderQueue; //导入依赖的package包/类
/**
* Enqueues a BLIT operation with the given parameters. Note that the
* RenderQueue lock must be held before calling this method.
*/
private static void enqueueBlit(RenderQueue rq,
SurfaceData src, SurfaceData dst,
int packedParams,
int sx1, int sy1,
int sx2, int sy2,
double dx1, double dy1,
double dx2, double dy2)
{
// assert rq.lock.isHeldByCurrentThread();
RenderBuffer buf = rq.getBuffer();
rq.ensureCapacityAndAlignment(72, 24);
buf.putInt(BLIT);
buf.putInt(packedParams);
buf.putInt(sx1).putInt(sy1);
buf.putInt(sx2).putInt(sy2);
buf.putDouble(dx1).putDouble(dy1);
buf.putDouble(dx2).putDouble(dy2);
buf.putLong(src.getNativeOps());
buf.putLong(dst.getNativeOps());
}
示例2: testContext
import sun.java2d.pipe.RenderQueue; //导入依赖的package包/类
private static void testContext(final AccelGraphicsConfig agc) {
BufferedContext c = agc.getContext();
final AccelDeviceEventListener l = new AccelDeviceEventListener() {
public void onDeviceDispose() {
System.out.println("onDeviceDispose invoked");
agc.removeDeviceEventListener(this);
}
public void onDeviceReset() {
System.out.println("onDeviceReset invoked");
}
};
agc.addDeviceEventListener(l);
RenderQueue rq = c.getRenderQueue();
rq.lock();
try {
c.saveState();
rq.flushNow();
c.restoreState();
rq.flushNow();
System.out.println("Passed: Save/Restore");
} finally {
rq.unlock();
}
}
示例3: update
import sun.java2d.pipe.RenderQueue; //导入依赖的package包/类
@Override
protected boolean update(Image bb) {
if (bb instanceof DestSurfaceProvider) {
Surface s = ((DestSurfaceProvider)bb).getDestSurface();
if (s instanceof AccelSurface) {
final int w = bb.getWidth(null);
final int h = bb.getHeight(null);
final boolean arr[] = { false };
final AccelSurface as = (AccelSurface)s;
RenderQueue rq = as.getContext().getRenderQueue();
rq.lock();
try {
BufferedContext.validateContext(as);
rq.flushAndInvokeNow(new Runnable() {
@Override
public void run() {
long psdops = as.getNativeOps();
arr[0] = updateWindowAccel(psdops, w, h);
}
});
} catch (InvalidPipeException e) {
// ignore, false will be returned
} finally {
rq.unlock();
}
return arr[0];
}
}
return super.update(bb);
}