sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType Java Examples

The following examples show how to use sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType. 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: D3DSurfaceData.java    From jdk8u-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 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);
}
 
Example #2
Source File: D3DSurfaceData.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 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);
}
 
Example #3
Source File: D3DSurfaceData.java    From jdk8u-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 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);
}
 
Example #4
Source File: D3DSurfaceData.java    From jdk8u_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 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);
}
 
Example #5
Source File: D3DSurfaceData.java    From openjdk-8 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 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);
}
 
Example #6
Source File: D3DSurfaceData.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 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);
}
 
Example #7
Source File: D3DSurfaceData.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 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);
}
 
Example #8
Source File: D3DSurfaceData.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 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);
}
 
Example #9
Source File: D3DSurfaceData.java    From openjdk-jdk8u-backup 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 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);
}
 
Example #10
Source File: D3DSurfaceData.java    From jdk8u60 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 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);
}
 
Example #11
Source File: D3DSurfaceData.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 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);
}
 
Example #12
Source File: D3DSurfaceData.java    From TencentKona-8 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 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);
}
 
Example #13
Source File: D3DSurfaceData.java    From openjdk-jdk8u 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 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);
}
 
Example #14
Source File: D3DSurfaceData.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #15
Source File: D3DSurfaceData.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #16
Source File: D3DSurfaceData.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #17
Source File: D3DSurfaceData.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #18
Source File: D3DSurfaceData.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #19
Source File: D3DSurfaceData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #20
Source File: D3DSurfaceData.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #21
Source File: D3DSurfaceData.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #22
Source File: D3DSurfaceData.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #23
Source File: D3DSurfaceData.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #24
Source File: D3DSurfaceData.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.peer = peer;
    this.type = type;
    this.width = width;
    this.height = height;
    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), width, height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #25
Source File: D3DSurfaceData.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.scaleX = type == TEXTURE ? 1 : graphicsDevice.getDefaultScaleX();
    this.scaleY = type == TEXTURE ? 1 : graphicsDevice.getDefaultScaleY();
    this.peer = peer;
    this.type = type;

    if (scaleX == 1 && scaleY == 1) {
        this.width = width;
        this.height = height;
    } else if (peer instanceof WWindowPeer) {
        Dimension scaledSize = ((WWindowPeer) peer).getScaledWindowSize();
        this.width = scaledSize.width;
        this.height = scaledSize.height;
    } else {
        this.width = (int) Math.ceil(width * scaleX);
        this.height = (int) Math.ceil(height * scaleY);
    }

    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), this.width, this.height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}
 
Example #26
Source File: D3DSurfaceData.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected D3DSurfaceData(WComponentPeer peer, D3DGraphicsConfig gc,
                         int width, int height, Image image,
                         ColorModel cm, int numBackBuffers,
                         int swapEffect, VSyncType vSyncType,
                         int type)
{
    super(getCustomSurfaceType(type), cm);
    this.graphicsDevice = gc.getD3DDevice();
    this.scaleX = type == TEXTURE ? 1 : graphicsDevice.getDefaultScaleX();
    this.scaleY = type == TEXTURE ? 1 : graphicsDevice.getDefaultScaleY();
    this.peer = peer;
    this.type = type;

    if (scaleX == 1 && scaleY == 1) {
        this.width = width;
        this.height = height;
    } else if (peer instanceof WWindowPeer) {
        Dimension scaledSize = ((WWindowPeer) peer).getScaledWindowSize();
        this.width = scaledSize.width;
        this.height = scaledSize.height;
    } else {
        this.width = (int) Math.ceil(width * scaleX);
        this.height = (int) Math.ceil(height * scaleY);
    }

    this.offscreenImage = image;
    this.backBuffersNum = numBackBuffers;
    this.swapEffect = swapEffect;
    this.syncType = vSyncType;

    initOps(graphicsDevice.getScreen(), this.width, this.height);
    if (type == WINDOW) {
        // we put the surface into the "lost"
        // state; it will be restored by the D3DScreenUpdateManager
        // prior to rendering to it for the first time. This is done
        // so that vram is not wasted for surfaces never rendered to
        setSurfaceLost(true);
    } else {
        initSurface();
    }
    setBlitProxyKey(gc.getProxyKey());
}