sun.awt.X11ComponentPeer Java Examples

The following examples show how to use sun.awt.X11ComponentPeer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: X11GraphicsConfig.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #2
Source File: X11GraphicsConfig.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: GLXSurfaceData.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #4
Source File: GLXSurfaceData.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #5
Source File: X11GraphicsConfig.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #6
Source File: GLXSurfaceData.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #7
Source File: GLXGraphicsConfig.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #8
Source File: GLXGraphicsConfig.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #9
Source File: GLXSurfaceData.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #10
Source File: X11GraphicsConfig.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #11
Source File: GLXSurfaceData.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #12
Source File: X11GraphicsConfig.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #13
Source File: GLXSurfaceData.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public GLXOffScreenSurfaceData(X11ComponentPeer peer,
                               GLXGraphicsConfig gc,
                               int width, int height,
                               Image image, ColorModel cm,
                               int type)
{
    super(peer, gc, cm, type);

    this.width = width;
    this.height = height;
    offscreenImage = image;

    initSurface(width, height);
}
 
Example #14
Source File: X11SurfaceData.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected X11SurfaceData(X11ComponentPeer peer,
                         X11GraphicsConfig gc,
                         SurfaceType sType,
                         ColorModel cm) {
    super(sType, cm);
    this.peer = peer;
    this.graphicsConfig = gc;
    this.solidloops = graphicsConfig.getSolidLoops(sType);
    this.depth = cm.getPixelSize();
    initOps(peer, graphicsConfig, depth);
    if (isAccelerationEnabled()) {
        setBlitProxyKey(gc.getProxyKey());
    }
}
 
Example #15
Source File: GLXSurfaceData.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #16
Source File: X11SurfaceData.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected X11SurfaceData(X11ComponentPeer peer,
                         X11GraphicsConfig gc,
                         SurfaceType sType,
                         ColorModel cm) {
    super(sType, cm);
    this.peer = peer;
    this.graphicsConfig = gc;
    this.solidloops = graphicsConfig.getSolidLoops(sType);
    this.depth = cm.getPixelSize();
    initOps(peer, graphicsConfig, depth);
    if (isAccelerationEnabled()) {
        setBlitProxyKey(gc.getProxyKey());
    }
}
 
Example #17
Source File: X11GraphicsConfig.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Performs the native XDBE flip operation for the given target Component.
 */
public void flip(X11ComponentPeer peer,
                 Component target, VolatileImage xBackBuffer,
                 int x1, int y1, int x2, int y2,
                 BufferCapabilities.FlipContents flipAction)
{
    long window = peer.getContentWindow();
    int swapAction = getSwapAction(flipAction);
    swapBuffers(window, swapAction);
}
 
Example #18
Source File: GLXSurfaceData.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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();
    }
}
 
Example #19
Source File: GLXSurfaceData.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public GLXOffScreenSurfaceData(X11ComponentPeer peer,
                               GLXGraphicsConfig gc,
                               int width, int height,
                               Image image, ColorModel cm,
                               int type)
{
    super(peer, gc, cm, type);

    this.width = width;
    this.height = height;
    offscreenImage = image;

    initSurface(width, height);
}
 
Example #20
Source File: GLXSurfaceData.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
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();
    }
}
 
Example #21
Source File: GLXSurfaceData.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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();
    }
}
 
Example #22
Source File: GLXSurfaceData.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public GLXOffScreenSurfaceData(X11ComponentPeer peer,
                               GLXGraphicsConfig gc,
                               int width, int height,
                               Image image, ColorModel cm,
                               int type)
{
    super(peer, gc, cm, type);

    this.width = width;
    this.height = height;
    offscreenImage = image;

    initSurface(width, height);
}
 
Example #23
Source File: GLXSurfaceData.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public GLXOffScreenSurfaceData(X11ComponentPeer peer,
                               GLXGraphicsConfig gc,
                               int width, int height,
                               Image image, ColorModel cm,
                               int type)
{
    super(peer, gc, cm, type);

    this.width = width;
    this.height = height;
    offscreenImage = image;

    initSurface(width, height);
}
 
Example #24
Source File: GLXSurfaceData.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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();
    }
}
 
Example #25
Source File: GLXSurfaceData.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public GLXOffScreenSurfaceData(X11ComponentPeer peer,
                               GLXGraphicsConfig gc,
                               int width, int height,
                               Image image, ColorModel cm,
                               int type)
{
    super(peer, gc, cm, type);

    this.width = width;
    this.height = height;
    offscreenImage = image;

    initSurface(width, height);
}
 
Example #26
Source File: GLXSurfaceData.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected GLXSurfaceData(X11ComponentPeer peer, GLXGraphicsConfig gc,
                         ColorModel cm, int type)
{
    super(gc, cm, type);
    this.peer = peer;
    this.graphicsConfig = gc;
    initOps(peer, graphicsConfig.getAData());
}
 
Example #27
Source File: GLXSurfaceData.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #28
Source File: X11SurfaceData.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static X11GraphicsConfig getGC(X11ComponentPeer peer) {
    if (peer != null) {
        return (X11GraphicsConfig) peer.getGraphicsConfiguration();
    } else {
        GraphicsEnvironment env =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice gd = env.getDefaultScreenDevice();
        return (X11GraphicsConfig)gd.getDefaultConfiguration();
    }
}
 
Example #29
Source File: X11SurfaceData.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static X11GraphicsConfig getGC(X11ComponentPeer peer) {
    if (peer != null) {
        return (X11GraphicsConfig) peer.getGraphicsConfiguration();
    } else {
        GraphicsEnvironment env =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice gd = env.getDefaultScreenDevice();
        return (X11GraphicsConfig)gd.getDefaultConfiguration();
    }
}
 
Example #30
Source File: X11SurfaceData.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static X11GraphicsConfig getGC(X11ComponentPeer peer) {
    if (peer != null) {
        return (X11GraphicsConfig) peer.getGraphicsConfiguration();
    } else {
        GraphicsEnvironment env =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice gd = env.getDefaultScreenDevice();
        return (X11GraphicsConfig)gd.getDefaultConfiguration();
    }
}