use of sun.awt.image.SunVolatileImage in project jdk8u_jdk by JetBrains.
the class CGLGraphicsConfig method createBackBuffer.
@Override
public Image createBackBuffer(final LWComponentPeer<?, ?> peer) {
final Rectangle r = peer.getBounds();
// It is possible for the component to have size 0x0, adjust it to
// be at least 1x1 to avoid IAE
final int w = Math.max(1, r.width);
final int h = Math.max(1, r.height);
final int transparency = peer.isTranslucent() ? Transparency.TRANSLUCENT : Transparency.OPAQUE;
return new SunVolatileImage(this, w, h, transparency, null);
}
use of sun.awt.image.SunVolatileImage in project jdk8u_jdk by JetBrains.
the class GLXGraphicsConfig 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.awt.image.SunVolatileImage in project jdk8u_jdk by JetBrains.
the class D3DGraphicsConfig 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;
}
boolean isOpaque = transparency == Transparency.OPAQUE;
if (type == RT_TEXTURE) {
int cap = isOpaque ? CAPS_RT_TEXTURE_OPAQUE : CAPS_RT_TEXTURE_ALPHA;
if (!device.isCapPresent(cap)) {
return null;
}
} else if (type == RT_PLAIN) {
if (!isOpaque && !device.isCapPresent(CAPS_RT_PLAIN_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.awt.image.SunVolatileImage in project jdk8u_jdk by JetBrains.
the class WGLGraphicsConfig method createBackBuffer.
/**
* Creates a WGL-based backbuffer for the given peer and returns the
* image wrapper.
*/
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
Component target = (Component) peer.getTarget();
// it is possible for the component to have size 0x0, adjust it to
// be at least 1x1 to avoid IAE
int w = Math.max(1, target.getWidth());
int h = Math.max(1, target.getHeight());
return new SunVolatileImage(target, w, h, Boolean.TRUE);
}
use of sun.awt.image.SunVolatileImage 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;
}
Aggregations