类java.awt.BufferCapabilities.FlipContents源码实例Demo

下面列出了怎么用java.awt.BufferCapabilities.FlipContents的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: D3DSurfaceData.java
/**
 * 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);
}
 
源代码2 项目: dragonwell8_jdk   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
源代码3 项目: openjdk-8   文件: GLXGraphicsConfig.java
/**
 * 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,
                             int numBuffers, 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;
}
 
源代码4 项目: TencentKona-8   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码5 项目: jdk8u-dev-jdk   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码6 项目: jdk8u60   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码7 项目: jdk8u60   文件: D3DSurfaceData.java
/**
 * 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);
}
 
源代码8 项目: jdk8u60   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
源代码9 项目: jdk8u60   文件: GLXGraphicsConfig.java
/**
 * 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,
                             int numBuffers, 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;
}
 
源代码10 项目: openjdk-jdk8u   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码11 项目: jdk8u-jdk   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码12 项目: jdk8u-jdk   文件: GLXGraphicsConfig.java
/**
 * 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,
                             int numBuffers, 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;
}
 
源代码13 项目: openjdk-8   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
源代码14 项目: openjdk-jdk8u-backup   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码15 项目: jdk8u-jdk   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
源代码16 项目: openjdk-jdk8u-backup   文件: D3DSurfaceData.java
/**
 * 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);
}
 
源代码17 项目: openjdk-jdk8u-backup   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
源代码18 项目: openjdk-8-source   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
源代码19 项目: openjdk-jdk9   文件: D3DSurfaceData.java
/**
 * 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);
}
 
源代码20 项目: hottub   文件: GLXGraphicsConfig.java
/**
 * 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,
                             int numBuffers, 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;
}
 
源代码21 项目: jdk8u-jdk   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码22 项目: jdk8u_jdk   文件: GLXGraphicsConfig.java
/**
 * 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,
                             int numBuffers, 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;
}
 
源代码23 项目: openjdk-8-source   文件: D3DGraphicsConfig.java
/**
 * 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");
    }
}
 
源代码24 项目: jdk8u-jdk   文件: GLXGraphicsConfig.java
/**
 * 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,
                             int numBuffers, 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;
}
 
源代码25 项目: openjdk-8-source   文件: D3DSurfaceData.java
/**
 * 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);
}
 
源代码26 项目: jdk8u_jdk   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
源代码27 项目: hottub   文件: D3DSurfaceData.java
/**
 * 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);
}
 
源代码28 项目: hottub   文件: WGLGraphicsConfig.java
/**
 * 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) {
        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");
    }
}
 
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码30 项目: dragonwell8_jdk   文件: X11GraphicsConfig.java
/**
 * Maps the given FlipContents constant to the associated XDBE swap
 * action constant.
 */
private static int getSwapAction(
    BufferCapabilities.FlipContents flipAction) {
    if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) {
        return 0x01;
    } else if (flipAction == BufferCapabilities.FlipContents.PRIOR) {
        return 0x02;
    } else if (flipAction == BufferCapabilities.FlipContents.COPIED) {
        return 0x03;
    } else {
        return 0x00; // UNDEFINED
    }
}
 
 类所在包
 同包方法