Search in sources :

Example 1 with VSyncType

use of sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType in project jdk8u_jdk by JetBrains.

the class D3DSurfaceData method createData.

/**
     * 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);
}
Also used : ExtendedBufferCapabilities(sun.java2d.pipe.hw.ExtendedBufferCapabilities) ExtendedBufferCapabilities(sun.java2d.pipe.hw.ExtendedBufferCapabilities) BufferCapabilities(java.awt.BufferCapabilities) Rectangle(java.awt.Rectangle) VSyncType(sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType) FlipContents(java.awt.BufferCapabilities.FlipContents)

Aggregations

BufferCapabilities (java.awt.BufferCapabilities)1 FlipContents (java.awt.BufferCapabilities.FlipContents)1 Rectangle (java.awt.Rectangle)1 ExtendedBufferCapabilities (sun.java2d.pipe.hw.ExtendedBufferCapabilities)1 VSyncType (sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType)1