本文整理汇总了Java中sun.awt.image.SunVolatileImage类的典型用法代码示例。如果您正苦于以下问题:Java SunVolatileImage类的具体用法?Java SunVolatileImage怎么用?Java SunVolatileImage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SunVolatileImage类属于sun.awt.image包,在下文中一共展示了SunVolatileImage类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CGLVolatileSurfaceManager
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public CGLVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
super(vImg, context);
/*
* We will attempt to accelerate this image only under the
* following conditions:
* - the image is opaque OR
* - the image is translucent AND
* - the GraphicsConfig supports the FBO extension OR
* - the GraphicsConfig has a stored alpha channel
*/
int transparency = vImg.getTransparency();
CGLGraphicsConfig gc = (CGLGraphicsConfig)vImg.getGraphicsConfig();
accelerationEnabled =
(transparency == Transparency.OPAQUE) ||
((transparency == Transparency.TRANSLUCENT) &&
(gc.isCapPresent(CAPS_EXT_FBOBJECT) ||
gc.isCapPresent(CAPS_STORED_ALPHA)));
}
示例2: D3DVolatileSurfaceManager
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public D3DVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
super(vImg, context);
/*
* We will attempt to accelerate this image only under the
* following conditions:
* - the image is opaque OR
* - the image is translucent AND
* - the GraphicsConfig supports the FBO extension OR
* - the GraphicsConfig has a stored alpha channel
*/
int transparency = vImg.getTransparency();
D3DGraphicsDevice gd = (D3DGraphicsDevice)
vImg.getGraphicsConfig().getDevice();
accelerationEnabled =
(transparency == Transparency.OPAQUE) ||
(transparency == Transparency.TRANSLUCENT &&
(gd.isCapPresent(CAPS_RT_PLAIN_ALPHA) ||
gd.isCapPresent(CAPS_RT_TEXTURE_ALPHA)));
}
示例3: WGLVolatileSurfaceManager
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public WGLVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
super(vImg, context);
/*
* We will attempt to accelerate this image only under the
* following conditions:
* - the image is opaque OR
* - the image is translucent AND
* - the GraphicsConfig supports the FBO extension OR
* - the GraphicsConfig has a stored alpha channel
*/
int transparency = vImg.getTransparency();
WGLGraphicsConfig gc = (WGLGraphicsConfig)vImg.getGraphicsConfig();
accelerationEnabled =
(transparency == Transparency.OPAQUE) ||
((transparency == Transparency.TRANSLUCENT) &&
(gc.isCapPresent(CAPS_EXT_FBOBJECT) ||
gc.isCapPresent(CAPS_STORED_ALPHA)));
}
示例4: GLXVolatileSurfaceManager
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public GLXVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
super(vImg, context);
/*
* We will attempt to accelerate this image only under the
* following conditions:
* - the image is opaque OR
* - the image is translucent AND
* - the GraphicsConfig supports the FBO extension OR
* - the GraphicsConfig has a stored alpha channel
*/
int transparency = vImg.getTransparency();
GLXGraphicsConfig gc = (GLXGraphicsConfig)vImg.getGraphicsConfig();
accelerationEnabled =
(transparency == Transparency.OPAQUE) ||
((transparency == Transparency.TRANSLUCENT) &&
(gc.isCapPresent(CAPS_EXT_FBOBJECT) ||
gc.isCapPresent(CAPS_STORED_ALPHA)));
}
示例5: X11VolatileSurfaceManager
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public X11VolatileSurfaceManager(SunVolatileImage vImg, Object context) {
super(vImg, context);
// We only accelerated opaque vImages currently
accelerationEnabled = X11SurfaceData.isAccelerationEnabled() &&
(vImg.getTransparency() == Transparency.OPAQUE);
if ((context != null) && !accelerationEnabled) {
// if we're wrapping a backbuffer drawable, we must ensure that
// the accelerated surface is initialized up front, regardless
// of whether acceleration is enabled. But we need to set
// the accelerationEnabled field to true to reflect that this
// SM is actually accelerated.
accelerationEnabled = true;
sdAccel = initAcceleratedSurface();
sdCurrent = sdAccel;
if (sdBackup != null) {
// release the system memory backup surface, as we won't be
// needing it in this case
sdBackup = null;
}
}
}
示例6: createCompatibleVolatileImage
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
*/
@Override
public VolatileImage
createCompatibleVolatileImage(int width, int height,
int transparency, int type)
{
if ((type != FBOBJECT && type != TEXTURE)
|| transparency == Transparency.BITMASK
|| type == FBOBJECT && !isCapPresent(CAPS_EXT_FBOBJECT)) {
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;
}
示例7: createCompatibleVolatileImage
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
@Override
public VolatileImage createCompatibleVolatileImage(int width, int height,
int transparency,
int type) {
if ((type != FBOBJECT && type != TEXTURE)
|| transparency == Transparency.BITMASK
|| type == FBOBJECT && !isCapPresent(CAPS_EXT_FBOBJECT)) {
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;
}
示例8: showFrame
import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
/**
* Shows a frame, then refs its back buffer.
*/
static void showFrame(CountDownLatch latch) {
JFrame frame = new JFrame("frame") {
@Override
public VolatileImage createVolatileImage(int w, int h) {
// Back the frame buffer by BufferedImage so that it's allocated in RAM
VolatileImage img = new SunVolatileImage(BI_GC, w, h, Transparency.TRANSLUCENT, new ImageCapabilities(false));
STRONG_MAP.put(img, null);
EventQueue.invokeLater(() -> {
dispose(); // release the frame buffer
latch.countDown();
});
return img;
}
};
frame.setSize(500, 500);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}