Java 类sun.awt.X11ComponentPeer 实例源码

项目:OpenJSharp    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:OpenJSharp    文件: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;
}
项目:OpenJSharp    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:jdk8u-jdk    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目: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;
}
项目:jdk8u-jdk    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:openjdk-jdk10    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:openjdk-jdk10    文件: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;
}
项目:openjdk9    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:openjdk9    文件: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;
}
项目:jdk8u_jdk    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目: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;
}
项目:jdk8u_jdk    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:lookaside_java-1.8.0-openjdk    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件: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;
}
项目:lookaside_java-1.8.0-openjdk    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:infobip-open-jdk-8    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:infobip-open-jdk-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;
}
项目:infobip-open-jdk-8    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:jdk8u-dev-jdk    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:jdk8u-dev-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;
}
项目:jdk8u-dev-jdk    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:jdk7-jdk    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:jdk7-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;
}
项目:jdk7-jdk    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:openjdk-source-code-learn    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:openjdk-source-code-learn    文件: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;
}
项目:openjdk-source-code-learn    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:OLD-OpenJDK8    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:OLD-OpenJDK8    文件: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;
}
项目:OLD-OpenJDK8    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:openjdk-jdk7u-jdk    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:openjdk-jdk7u-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;
}
项目:openjdk-jdk7u-jdk    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:openjdk-icedtea7    文件:GLXSurfaceData.java   
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
                                                 Image image,
                                                 int type)
{
    GLXGraphicsConfig gc = getGC(peer);
    Rectangle r = peer.getBounds();
    if (type == FLIP_BACKBUFFER) {
        return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
                                           image, peer.getColorModel(),
                                           FLIP_BACKBUFFER);
    } else {
        return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
                                                image, peer.getColorModel(),
                                                type);
    }
}
项目:openjdk-icedtea7    文件: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;
}
项目:openjdk-icedtea7    文件:X11GraphicsConfig.java   
/**
 * Attempts to create an XDBE-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
 * handle to the native backbuffer is returned.
 */
public long createBackBuffer(X11ComponentPeer peer,
                             int numBuffers, 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);
}
项目:OpenJSharp    文件:GLXSurfaceData.java   
protected GLXSurfaceData(X11ComponentPeer peer, GLXGraphicsConfig gc,
                         ColorModel cm, int type)
{
    super(gc, cm, type);
    this.peer = peer;
    this.graphicsConfig = gc;
    initOps(peer, graphicsConfig.getAData());
}
项目:OpenJSharp    文件:GLXSurfaceData.java   
public static GLXGraphicsConfig getGC(X11ComponentPeer peer) {
    if (peer != null) {
        return (GLXGraphicsConfig)peer.getGraphicsConfiguration();
    } else {
        // REMIND: this should rarely (never?) happen, but what if
        //         default config is not GLX?
        GraphicsEnvironment env =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice gd = env.getDefaultScreenDevice();
        return (GLXGraphicsConfig)gd.getDefaultConfiguration();
    }
}
项目:OpenJSharp    文件:GLXSurfaceData.java   
public GLXVSyncOffScreenSurfaceData(X11ComponentPeer peer,
                                    GLXGraphicsConfig gc,
                                    int width, int height,
                                    Image image, ColorModel cm,
                                    int type)
{
    super(peer, gc, width, height, image, cm, type);
    flipSurface = GLXSurfaceData.createData(peer, image, FLIP_BACKBUFFER);
}