@Override
public void assertOperationSupported(final int numBuffers,final BufferCapabilities caps)
throws AWTException {
// Assume this method is never called with numBuffers != 2,as 0 is
// unsupported,and 1 corresponds to a SingleBufferStrategy which
// doesn't depend on the peer. Screen is considered as a separate
// "buffer".
if (numBuffers != 2) {
throw new AWTException("Only double buffering is supported");
}
final BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
@Override
public void flip(final LWComponentPeer<?,?> peer,final Image backBuffer,final int x1,final int y1,final int x2,final int y2,final BufferCapabilities.FlipContents flipAction) {
final Graphics g = peer.getGraphics();
try {
g.drawImage(backBuffer,x1,y1,x2,y2,null);
} finally {
g.dispose();
}
if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) {
final Graphics2D bg = (Graphics2D) backBuffer.getGraphics();
try {
bg.setBackground(peer.getBackground());
bg.clearRect(0,backBuffer.getWidth(null),backBuffer.getHeight(null));
} finally {
bg.dispose();
}
}
}
/**
* Checks that the requested configuration is natively supported; if not,* an AWTException is thrown.
*/
@Override
public void assertOperationSupported(Component target,int numBuffers,BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 2 || numBuffers > 4) {
throw new AWTException("Only 2-4 buffers supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.copIED &&
numBuffers != 2)
{
throw new AWTException("FlipContents.copIED is only" +
"supported for 2 buffers");
}
}
/**
* Creates a SurfaceData object representing the back buffer of a
* double-buffered on-screen Window.
*/
public static D3DSurfaceData createData(WComponentPeer peer,Image image) {
D3DGraphicsConfig gc = getGC(peer);
if (gc == null || !peer.isAccelCapable()) {
return null;
}
BufferCapabilities caps = peer.getBackBufferCaps();
VSyncType vSyncType = VSYNC_DEFAULT;
if (caps instanceof ExtendedBufferCapabilities) {
vSyncType = ((ExtendedBufferCapabilities)caps).getVSync();
}
Rectangle r = peer.getBounds();
BufferCapabilities.FlipContents flip = caps.getFlipContents();
int swapEffect;
if (flip == FlipContents.copIED) {
swapEffect = SWAP_copY;
} else if (flip == FlipContents.PRIOR) {
swapEffect = SWAP_FLIP;
} else { // flip == FlipContents.UNDEFINED || .BACKGROUND
swapEffect = SWAP_disCARD;
}
return new D3DSurfaceData(peer,gc,r.width,r.height,image,peer.getColorModel(),peer.getBackBuffersNum(),swapEffect,vSyncType,FLIP_BACKBUFFER);
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
/**
* Attempts to create a GLX-based backbuffer for the given peer. If
* the requested configuration is not natively supported,an AWTException
* is thrown. Otherwise,if the backbuffer creation is successful,a
* value of 1 is returned.
*/
@Override
public long createBackBuffer(X11ComponentPeer peer,BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
// non-zero return value means backbuffer creation was successful
// (checked in X11ComponentPeer.flip(),etc.)
return 1;
}
/**
* Attempts to create an XDBE-based backbuffer for the given peer. If
* the requested configuration is not natively supported,a
* handle to the native backbuffer is returned.
*/
public long createBackBuffer(X11ComponentPeer peer,BufferCapabilities caps)
throws AWTException
{
if (!X11GraphicsDevice.isDBESupported()) {
throw new AWTException("Page flipping is not supported");
}
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
long window = peer.getContentwindow();
int swapAction = getSwapAction(caps.getFlipContents());
return createBackBuffer(window,swapAction);
}
@Override
public void assertOperationSupported(final int numBuffers,and 1 corresponds to a SingleBufferStrategy which
// doesn't depend on the peer. Screen is considered as a separate
// "buffer".
if (numBuffers != 2) {
throw new AWTException("Only double buffering is supported");
}
final BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
@Override
public void flip(final LWComponentPeer<?,backBuffer.getHeight(null));
} finally {
bg.dispose();
}
}
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 2 || numBuffers > 4) {
throw new AWTException("Only 2-4 buffers supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.copIED &&
numBuffers != 2)
{
throw new AWTException("FlipContents.copIED is only" +
"supported for 2 buffers");
}
}
项目:jdk8u-jdk
文件:D3DSurfaceData.java
/**
* Creates a SurfaceData object representing the back buffer of a
* double-buffered on-screen Window.
*/
public static D3DSurfaceData createData(WComponentPeer peer,FLIP_BACKBUFFER);
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
/**
* Attempts to create a GLX-based backbuffer for the given peer. If
* the requested configuration is not natively supported,etc.)
return 1;
}
/**
* Attempts to create an XDBE-based backbuffer for the given peer. If
* the requested configuration is not natively supported,swapAction);
}
/**
* Attempts to create a GLX-based backbuffer for the given peer. If
* the requested configuration is not natively supported,etc.)
return 1;
}
/**
* Attempts to create an XDBE-based backbuffer for the given peer. If
* the requested configuration is not natively supported,swapAction);
}
@Override
public void assertOperationSupported(final int numBuffers,and 1 corresponds to a SingleBufferStrategy which
// doesn't depend on the peer. Screen is considered as a separate
// "buffer".
if (numBuffers != 2) {
throw new AWTException("Only double buffering is supported");
}
final BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
@Override
public void flip(final LWComponentPeer<?,backBuffer.getHeight(null));
} finally {
bg.dispose();
}
}
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 2 || numBuffers > 4) {
throw new AWTException("Only 2-4 buffers supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.copIED &&
numBuffers != 2)
{
throw new AWTException("FlipContents.copIED is only" +
"supported for 2 buffers");
}
}
项目:openjdk-jdk10
文件:D3DSurfaceData.java
/**
* Creates a SurfaceData object representing the back buffer of a
* double-buffered on-screen Window.
*/
public static D3DSurfaceData createData(WComponentPeer peer,FLIP_BACKBUFFER);
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
/**
* Attempts to create a GLX-based backbuffer for the given peer. If
* the requested configuration is not natively supported,etc.)
return 1;
}
/**
* Attempts to create an XDBE-based backbuffer for the given peer. If
* the requested configuration is not natively supported,swapAction);
}
@Override
public void assertOperationSupported(final int numBuffers,and 1 corresponds to a SingleBufferStrategy which
// doesn't depend on the peer. Screen is considered as a separate
// "buffer".
if (numBuffers != 2) {
throw new AWTException("Only double buffering is supported");
}
final BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
@Override
public void flip(final LWComponentPeer<?,backBuffer.getHeight(null));
} finally {
bg.dispose();
}
}
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 2 || numBuffers > 4) {
throw new AWTException("Only 2-4 buffers supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.copIED &&
numBuffers != 2)
{
throw new AWTException("FlipContents.copIED is only" +
"supported for 2 buffers");
}
}
项目:openjdk9
文件:D3DSurfaceData.java
/**
* Creates a SurfaceData object representing the back buffer of a
* double-buffered on-screen Window.
*/
public static D3DSurfaceData createData(WComponentPeer peer,FLIP_BACKBUFFER);
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
@Override
public void assertOperationSupported(final int numBuffers,and 1 corresponds to a SingleBufferStrategy which
// doesn't depend on the peer. Screen is considered as a separate
// "buffer".
if (numBuffers != 2) {
throw new AWTException("Only double buffering is supported");
}
final BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
项目:javify
文件:GtkComponentPeer.java
public void flip (BufferCapabilities.FlipContents contents)
{
getGraphics().drawImage(backBuffer,awtComponent.getWidth(),awtComponent.getHeight(),null);
// create new back buffer and clear it to the background color.
if (contents == BufferCapabilities.FlipContents.BACKGROUND)
{
backBuffer = createVolatileImage(awtComponent.getWidth(),awtComponent.getHeight());
backBuffer.getGraphics().clearRect(0,awtComponent.getHeight());
}
// FIXME: support BufferCapabilities.FlipContents.PRIOR
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 2 || numBuffers > 4) {
throw new AWTException("Only 2-4 buffers supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.copIED &&
numBuffers != 2)
{
throw new AWTException("FlipContents.copIED is only" +
"supported for 2 buffers");
}
}
项目:jdk8u_jdk
文件:D3DSurfaceData.java
/**
* Creates a SurfaceData object representing the back buffer of a
* double-buffered on-screen Window.
*/
public static D3DSurfaceData createData(WComponentPeer peer,FLIP_BACKBUFFER);
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
/**
* Attempts to create a GLX-based backbuffer for the given peer. If
* the requested configuration is not natively supported,etc.)
return 1;
}
/**
* Attempts to create an XDBE-based backbuffer for the given peer. If
* the requested configuration is not natively supported,swapAction);
}
@Override
public void assertOperationSupported(final int numBuffers,and 1 corresponds to a SingleBufferStrategy which
// doesn't depend on the peer. Screen is considered as a separate
// "buffer".
if (numBuffers != 2) {
throw new AWTException("Only double buffering is supported");
}
final BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
@Override
public void flip(final LWComponentPeer<?,backBuffer.getHeight(null));
} finally {
bg.dispose();
}
}
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 2 || numBuffers > 4) {
throw new AWTException("Only 2-4 buffers supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.copIED &&
numBuffers != 2)
{
throw new AWTException("FlipContents.copIED is only" +
"supported for 2 buffers");
}
}
项目:lookaside_java-1.8.0-openjdk
文件:D3DSurfaceData.java
/**
* Creates a SurfaceData object representing the back buffer of a
* double-buffered on-screen Window.
*/
public static D3DSurfaceData createData(WComponentPeer peer,FLIP_BACKBUFFER);
}
/**
* Checks that the requested configuration is natively supported; if not,BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。