use of sun.java2d.pipe.hw.AccelSurface in project jdk8u_jdk by JetBrains.
the class CGLGraphicsConfig method createCompatibleVolatileImage.
@Override
public VolatileImage createCompatibleVolatileImage(int width, int height, int transparency, int type) {
if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED || transparency == Transparency.BITMASK) {
return null;
}
if (type == FBOBJECT) {
if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
return null;
}
} else if (type == PBUFFER) {
boolean isOpaque = transparency == Transparency.OPAQUE;
if (!isOpaque && !isCapPresent(CAPS_STORED_ALPHA)) {
return null;
}
}
SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height, transparency, type);
Surface sd = vi.getDestSurface();
if (!(sd instanceof AccelSurface) || ((AccelSurface) sd).getType() != type) {
vi.flush();
vi = null;
}
return vi;
}
use of sun.java2d.pipe.hw.AccelSurface in project jdk8u_jdk by JetBrains.
the class WGLGraphicsConfig method createCompatibleVolatileImage.
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
*/
@Override
public VolatileImage createCompatibleVolatileImage(int width, int height, int transparency, int type) {
if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED || transparency == Transparency.BITMASK) {
return null;
}
if (type == FBOBJECT) {
if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
return null;
}
} else if (type == PBUFFER) {
boolean isOpaque = transparency == Transparency.OPAQUE;
if (!isOpaque && !isCapPresent(CAPS_STORED_ALPHA)) {
return null;
}
}
SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height, transparency, type);
Surface sd = vi.getDestSurface();
if (!(sd instanceof AccelSurface) || ((AccelSurface) sd).getType() != type) {
vi.flush();
vi = null;
}
return vi;
}
use of sun.java2d.pipe.hw.AccelSurface in project jdk8u_jdk by JetBrains.
the class RSLAPITest method printSurface.
private static void printSurface(Surface s) {
if (s instanceof AccelSurface) {
final AccelSurface surface = (AccelSurface) s;
System.out.println(" Accel Surface: ");
System.out.println(" type=" + surface.getType());
System.out.println(" bounds=" + surface.getBounds());
System.out.println(" nativeBounds=" + surface.getNativeBounds());
System.out.println(" isSurfaceLost=" + surface.isSurfaceLost());
System.out.println(" isValid=" + surface.isValid());
RenderQueue rq = surface.getContext().getRenderQueue();
rq.lock();
try {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
System.out.printf(" getNativeResource(TEXTURE)=0x%x\n", surface.getNativeResource(TEXTURE));
System.out.printf(" getNativeResource(RT_TEXTURE)=0x%x\n", surface.getNativeResource(RT_TEXTURE));
System.out.printf(" getNativeResource(RT_PLAIN)=0x%x\n", surface.getNativeResource(RT_PLAIN));
System.out.printf(" getNativeResource(FLIP_BACKBUFFER)=0x%x\n", surface.getNativeResource(FLIP_BACKBUFFER));
testD3DDeviceResourceField(surface);
testInvalidType(surface, -1);
testInvalidType(surface, -150);
testInvalidType(surface, 300);
testInvalidType(surface, Integer.MAX_VALUE);
testInvalidType(surface, Integer.MIN_VALUE);
}
});
} finally {
rq.unlock();
}
} else {
System.out.println("null accelerated surface");
}
}
Aggregations