sun.awt.Win32GraphicsDevice Java Examples

The following examples show how to use sun.awt.Win32GraphicsDevice. 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: WGLGraphicsConfig.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #2
Source File: GDIWindowSurfaceData.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #3
Source File: WGLGraphicsConfig.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #4
Source File: WGLGraphicsConfig.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #5
Source File: GDIWindowSurfaceData.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #6
Source File: WGLGraphicsConfig.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #7
Source File: WGLGraphicsConfig.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #8
Source File: GDIWindowSurfaceData.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #9
Source File: WGLGraphicsConfig.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #10
Source File: WGLGraphicsConfig.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #11
Source File: GDIWindowSurfaceData.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #12
Source File: WGLGraphicsConfig.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #13
Source File: WGLGraphicsConfig.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #14
Source File: GDIWindowSurfaceData.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);
    Win32GraphicsDevice gd = graphicsConfig.getDevice();
    scaleX = gd.getDefaultScaleX();
    scaleY = gd.getDefaultScaleY();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #15
Source File: WGLGraphicsConfig.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #16
Source File: WGLGraphicsConfig.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #17
Source File: WGLSurfaceData.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected WGLSurfaceData(WComponentPeer peer, WGLGraphicsConfig gc,
                         ColorModel cm, int type)
{
    super(gc, cm, type);
    this.peer = peer;
    this.graphicsConfig = gc;
    Win32GraphicsDevice device = gc.getDevice();
    this.scaleX = type == TEXTURE ? 1 : device.getDefaultScaleX();
    this.scaleY = type == TEXTURE ? 1 : device.getDefaultScaleY();

    long pConfigInfo = gc.getNativeConfigInfo();
    long hwnd = peer != null ? peer.getHWnd() : 0L;

    initOps(gc, pConfigInfo, peer, hwnd);
}
 
Example #18
Source File: GDIWindowSurfaceData.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #19
Source File: WGLGraphicsConfig.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #20
Source File: WGLGraphicsConfig.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #21
Source File: GDIWindowSurfaceData.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #22
Source File: WGLGraphicsConfig.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #23
Source File: WGLGraphicsConfig.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #24
Source File: GDIWindowSurfaceData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #25
Source File: WGLGraphicsConfig.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #26
Source File: WGLGraphicsConfig.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #27
Source File: WGLGraphicsConfig.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static WGLGraphicsConfig getConfig(Win32GraphicsDevice device,
                                          int pixfmt)
{
    if (!wglAvailable) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getWGLConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        WGLGetConfigInfo action =
            new WGLGetConfigInfo(device.getScreen(), pixfmt);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new WGLGraphicsConfig(device, pixfmt, cfginfo, caps);
}
 
Example #28
Source File: WGLGraphicsConfig.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}
 
Example #29
Source File: GDIWindowSurfaceData.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
    super(sType, peer.getDeviceColorModel());
    ColorModel cm = peer.getDeviceColorModel();
    this.peer = peer;
    int rMask = 0, gMask = 0, bMask = 0;
    int depth;
    switch (cm.getPixelSize()) {
    case 32:
    case 24:
        if (cm instanceof DirectColorModel) {
            depth = 32;
        } else {
            depth = 24;
        }
        break;
    default:
        depth = cm.getPixelSize();
    }
    if (cm instanceof DirectColorModel) {
        DirectColorModel dcm = (DirectColorModel)cm;
        rMask = dcm.getRedMask();
        gMask = dcm.getGreenMask();
        bMask = dcm.getBlueMask();
    }
    this.graphicsConfig =
        (Win32GraphicsConfig) peer.getGraphicsConfiguration();
    this.solidloops = graphicsConfig.getSolidLoops(sType);

    Win32GraphicsDevice gd =
        (Win32GraphicsDevice)graphicsConfig.getDevice();
    initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
    setBlitProxyKey(graphicsConfig.getProxyKey());
}
 
Example #30
Source File: WGLGraphicsConfig.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
                            long configInfo, ContextCapabilities oglCaps)
{
    super(device, visualnum);
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // WGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new WGLGCDisposerRecord(pConfigInfo,
                                               device.getScreen()));
}