类sun.awt.X11ComponentPeer源码实例Demo

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

源代码1 项目: openjdk-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);
}
 
源代码2 项目: dragonwell8_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);
    }
}
 
源代码3 项目: 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);
}
 
源代码4 项目: openjdk-8-source   文件: 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);
    }
}
 
源代码5 项目: openjdk-8-source   文件: 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);
}
 
源代码6 项目: 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);
    }
}
 
源代码7 项目: 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;
}
 
源代码8 项目: 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;
}
 
源代码9 项目: hottub   文件: 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);
    }
}
 
源代码10 项目: openjdk-jdk8u   文件: 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);
}
 
源代码11 项目: openjdk-jdk9   文件: 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);
    }
}
 
源代码12 项目: hottub   文件: 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);
}
 
源代码13 项目: dragonwell8_jdk   文件: 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();
    }
}
 
源代码14 项目: jdk8u-dev-jdk   文件: X11GraphicsConfig.java
/**
 * 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);
}
 
源代码15 项目: dragonwell8_jdk   文件: 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);
}
 
源代码16 项目: dragonwell8_jdk   文件: GLXSurfaceData.java
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);
}
 
源代码17 项目: dragonwell8_jdk   文件: X11SurfaceData.java
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());
    }
}
 
源代码18 项目: dragonwell8_jdk   文件: X11SurfaceData.java
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();
    }
}
 
源代码19 项目: openjdk-8-source   文件: 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();
    }
}
 
源代码20 项目: dragonwell8_jdk   文件: X11GraphicsConfig.java
/**
 * 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);
}
 
源代码21 项目: hottub   文件: X11SurfaceData.java
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());
    }
}
 
源代码22 项目: openjdk-jdk9   文件: GLXSurfaceData.java
public GLXOffScreenSurfaceData(X11ComponentPeer peer,
                               GLXGraphicsConfig gc,
                               int width, int height,
                               Image image, ColorModel cm,
                               int type)
{
    super(peer, gc, cm, type);

    scale = gc.getDevice().getScaleFactor();
    this.width = width * scale;
    this.height = height * scale;
    offscreenImage = image;

    initSurface(this.width, this.height);
}
 
源代码23 项目: jdk8u-dev-jdk   文件: X11SurfaceData.java
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());
    }
}
 
源代码24 项目: jdk8u-dev-jdk   文件: X11SurfaceData.java
public X11WindowSurfaceData(X11ComponentPeer peer,
                            X11GraphicsConfig gc,
                            SurfaceType sType) {
    super(peer, gc, sType, peer.getColorModel());
    if (isDrawableValid()) {
        makePipes();
    }
}
 
源代码25 项目: jdk8u_jdk   文件: 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);
}
 
源代码26 项目: openjdk-8   文件: GLXSurfaceData.java
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);
}
 
源代码27 项目: jdk8u_jdk   文件: GLXSurfaceData.java
protected GLXSurfaceData(X11ComponentPeer peer, GLXGraphicsConfig gc,
                         ColorModel cm, int type)
{
    super(gc, cm, type);
    this.peer = peer;
    this.graphicsConfig = gc;
    initOps(gc, peer, graphicsConfig.getAData());
}
 
源代码28 项目: TencentKona-8   文件: X11SurfaceData.java
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();
    }
}
 
源代码29 项目: jdk8u60   文件: 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());
}
 
源代码30 项目: jdk8u60   文件: 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();
    }
}
 
 类所在包
 类方法
 同包方法