sun.java2d.opengl.WGLGraphicsConfig Java Examples

The following examples show how to use sun.java2d.opengl.WGLGraphicsConfig. 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: WindowsSurfaceManagerFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #2
Source File: Win32GraphicsDevice.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #3
Source File: WindowsSurfaceManagerFactory.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #4
Source File: WindowsSurfaceManagerFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #5
Source File: Win32GraphicsDevice.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #6
Source File: WindowsSurfaceManagerFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #7
Source File: Win32GraphicsDevice.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #8
Source File: Win32GraphicsDevice.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #9
Source File: WindowsSurfaceManagerFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #10
Source File: Win32GraphicsDevice.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #11
Source File: WindowsSurfaceManagerFactory.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #12
Source File: WindowsSurfaceManagerFactory.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #13
Source File: Win32GraphicsDevice.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #14
Source File: WindowsSurfaceManagerFactory.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #15
Source File: Win32GraphicsDevice.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #16
Source File: WindowsSurfaceManagerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #17
Source File: Win32GraphicsDevice.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #18
Source File: Win32GraphicsDevice.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #19
Source File: WindowsSurfaceManagerFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #20
Source File: Win32GraphicsDevice.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #21
Source File: WindowsSurfaceManagerFactory.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #22
Source File: WindowsSurfaceManagerFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #23
Source File: Win32GraphicsDevice.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #24
Source File: WindowsSurfaceManagerFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of a VolatileSurfaceManager given any
 * arbitrary SunVolatileImage.  An optional context Object can be supplied
 * as a way for the caller to pass pipeline-specific context data to
 * the VolatileSurfaceManager (such as a backbuffer handle, for example).
 *
 * For Windows platforms, this method returns a Windows-specific
 * VolatileSurfaceManager.
 */
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
                                                    Object context)
{
    GraphicsConfiguration gc = vImg.getGraphicsConfig();
    if (gc instanceof D3DGraphicsConfig) {
        return new D3DVolatileSurfaceManager(vImg, context);
    } else if (gc instanceof WGLGraphicsConfig) {
        return new WGLVolatileSurfaceManager(vImg, context);
    } else {
        return new BufImgVolatileSurfaceManager(vImg, context);
    }
}
 
Example #25
Source File: Win32GraphicsDevice.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #26
Source File: Win32GraphicsDevice.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default graphics configuration
 * associated with this graphics device.
 */
public GraphicsConfiguration getDefaultConfiguration() {
    if (defaultConfig == null) {
        // first try to create a WGLGraphicsConfig if OGL is enabled
        // REMIND: the WGL code does not yet work properly in multimon
        // situations, so we will fallback on GDI if we are not on the
        // default device...
        if (WindowsFlags.isOGLEnabled() && isDefaultDevice()) {
            int defPixID = WGLGraphicsConfig.getDefaultPixFmt(screen);
            defaultConfig = WGLGraphicsConfig.getConfig(this, defPixID);
            if (WindowsFlags.isOGLVerbose()) {
                if (defaultConfig != null) {
                    System.out.print("OpenGL pipeline enabled");
                } else {
                    System.out.print("Could not enable OpenGL pipeline");
                }
                System.out.println(" for default config on screen " +
                                   screen);
            }
        }

        // Fix for 4669614.  Most apps are not concerned with PixelFormats,
        // yet we ALWAYS used them for determining ColorModels and such.
        // By passing in 0 as the PixelFormatID here, we signal that
        // PixelFormats should not be used, thus avoid loading the opengl
        // library.  Apps concerned with PixelFormats can still use
        // GraphicsConfiguration.getConfigurations().
        // Note that calling native pixel format functions tends to cause
        // problems between those functions (which are OpenGL-related)
        // and our use of DirectX.  For example, some Matrox boards will
        // crash or hang calling these functions when any app is running
        // in DirectX fullscreen mode.  So avoiding these calls unless
        // absolutely necessary is preferable.
        if (defaultConfig == null) {
            defaultConfig = Win32GraphicsConfig.getConfig(this, 0);
        }
    }
    return defaultConfig;
}
 
Example #27
Source File: WindowsFlags.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void initJavaFlags() {
    java.security.AccessController.doPrivileged(
        new java.security.PrivilegedAction()
    {
        public Object run() {
            magPresent = getBooleanProp(
                "javax.accessibility.screen_magnifier_present", false);
            boolean ddEnabled =
                !getBooleanProp("sun.java2d.noddraw", magPresent);
            boolean ddOffscreenEnabled =
                getBooleanProp("sun.java2d.ddoffscreen", ddEnabled);
            d3dEnabled = getBooleanProp("sun.java2d.d3d",
                ddEnabled && ddOffscreenEnabled);
            d3dOnScreenEnabled =
                getBooleanProp("sun.java2d.d3d.onscreen", d3dEnabled);
            oglEnabled = getBooleanProp("sun.java2d.opengl", false);
            if (oglEnabled) {
                oglVerbose = isBooleanPropTrueVerbose("sun.java2d.opengl");
                if (WGLGraphicsConfig.isWGLAvailable()) {
                    d3dEnabled = false;
                } else {
                    if (oglVerbose) {
                        System.out.println(
                            "Could not enable OpenGL pipeline " +
                            "(WGL not available)");
                    }
                    oglEnabled = false;
                }
            }
            gdiBlitEnabled = getBooleanProp("sun.java2d.gdiBlit", true);
            d3dSet = getPropertySet("sun.java2d.d3d");
            if (d3dSet) {
                d3dVerbose = isBooleanPropTrueVerbose("sun.java2d.d3d");
            }
            offscreenSharingEnabled =
                getBooleanProp("sun.java2d.offscreenSharing", false);
            accelReset = getBooleanProp("sun.java2d.accelReset", false);
            checkRegistry =
                getBooleanProp("sun.java2d.checkRegistry", false);
            disableRegistry =
                getBooleanProp("sun.java2d.disableRegistry", false);
            javaVersion = System.getProperty("java.version");
            if (javaVersion == null) {
                // Cannot be true, nonetheless...
                javaVersion = "default";
            } else {
                int dashIndex = javaVersion.indexOf('-');
                if (dashIndex >= 0) {
                    // an interim release; use only the part preceding the -
                    javaVersion = javaVersion.substring(0, dashIndex);
                }
            }
            String dpiOverride = System.getProperty("sun.java2d.dpiaware");
            if (dpiOverride != null) {
                setHighDPIAware = dpiOverride.equalsIgnoreCase("true");
            } else {
                String sunLauncherProperty =
                    System.getProperty("sun.java.launcher", "unknown");
                setHighDPIAware =
                    sunLauncherProperty.equalsIgnoreCase("SUN_STANDARD");
            }
            /*
            // Output info based on some non-default flags:
            if (offscreenSharingEnabled) {
                System.out.println(
                    "Warning: offscreenSharing has been enabled. " +
                    "The use of this capability will change in future " +
                    "releases and applications that depend on it " +
                    "may not work correctly");
            }
            */
            return null;
        }
    });
    /*
    System.out.println("WindowsFlags (Java):");
    System.out.println("  ddEnabled: " + ddEnabled + "\n" +
                       "  ddOffscreenEnabled: " + ddOffscreenEnabled + "\n" +
                       "  ddVramForced: " + ddVramForced + "\n" +
                       "  ddLockEnabled: " + ddLockEnabled + "\n" +
                       "  ddLockSet: " + ddLockSet + "\n" +
                       "  ddBlitEnabled: " + ddBlitEnabled + "\n" +
                       "  ddScaleEnabled: " + ddScaleEnabled + "\n" +
                       "  d3dEnabled: " + d3dEnabled + "\n" +
                       "  d3dSet: " + d3dSet + "\n" +
                       "  oglEnabled: " + oglEnabled + "\n" +
                       "  oglVerbose: " + oglVerbose + "\n" +
                       "  gdiBlitEnabled: " + gdiBlitEnabled + "\n" +
                       "  translAccelEnabled: " + translAccelEnabled + "\n" +
                       "  offscreenSharingEnabled: " + offscreenSharingEnabled + "\n" +
                       "  accelReset: " + accelReset + "\n" +
                       "  checkRegistry: " + checkRegistry + "\n" +
                       "  disableRegistry: " + disableRegistry + "\n" +
                       "  d3dTexBPP: " + d3dTexBpp);
    */
}
 
Example #28
Source File: WindowsFlags.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void initJavaFlags() {
    java.security.AccessController.doPrivileged(
        new java.security.PrivilegedAction()
    {
        public Object run() {
            magPresent = getBooleanProp(
                "javax.accessibility.screen_magnifier_present", false);
            boolean ddEnabled =
                !getBooleanProp("sun.java2d.noddraw", magPresent);
            boolean ddOffscreenEnabled =
                getBooleanProp("sun.java2d.ddoffscreen", ddEnabled);
            d3dEnabled = getBooleanProp("sun.java2d.d3d",
                ddEnabled && ddOffscreenEnabled);
            d3dOnScreenEnabled =
                getBooleanProp("sun.java2d.d3d.onscreen", d3dEnabled);
            oglEnabled = getBooleanProp("sun.java2d.opengl", false);
            if (oglEnabled) {
                oglVerbose = isBooleanPropTrueVerbose("sun.java2d.opengl");
                if (WGLGraphicsConfig.isWGLAvailable()) {
                    d3dEnabled = false;
                } else {
                    if (oglVerbose) {
                        System.out.println(
                            "Could not enable OpenGL pipeline " +
                            "(WGL not available)");
                    }
                    oglEnabled = false;
                }
            }
            gdiBlitEnabled = getBooleanProp("sun.java2d.gdiBlit", true);
            d3dSet = getPropertySet("sun.java2d.d3d");
            if (d3dSet) {
                d3dVerbose = isBooleanPropTrueVerbose("sun.java2d.d3d");
            }
            offscreenSharingEnabled =
                getBooleanProp("sun.java2d.offscreenSharing", false);
            accelReset = getBooleanProp("sun.java2d.accelReset", false);
            checkRegistry =
                getBooleanProp("sun.java2d.checkRegistry", false);
            disableRegistry =
                getBooleanProp("sun.java2d.disableRegistry", false);
            javaVersion = System.getProperty("java.version");
            if (javaVersion == null) {
                // Cannot be true, nonetheless...
                javaVersion = "default";
            } else {
                int dashIndex = javaVersion.indexOf('-');
                if (dashIndex >= 0) {
                    // an interim release; use only the part preceding the -
                    javaVersion = javaVersion.substring(0, dashIndex);
                }
            }
            String dpiOverride = System.getProperty("sun.java2d.dpiaware");
            if (dpiOverride != null) {
                setHighDPIAware = dpiOverride.equalsIgnoreCase("true");
            } else {
                String sunLauncherProperty =
                    System.getProperty("sun.java.launcher", "unknown");
                setHighDPIAware =
                    sunLauncherProperty.equalsIgnoreCase("SUN_STANDARD");
            }
            /*
            // Output info based on some non-default flags:
            if (offscreenSharingEnabled) {
                System.out.println(
                    "Warning: offscreenSharing has been enabled. " +
                    "The use of this capability will change in future " +
                    "releases and applications that depend on it " +
                    "may not work correctly");
            }
            */
            return null;
        }
    });
    /*
    System.out.println("WindowsFlags (Java):");
    System.out.println("  ddEnabled: " + ddEnabled + "\n" +
                       "  ddOffscreenEnabled: " + ddOffscreenEnabled + "\n" +
                       "  ddVramForced: " + ddVramForced + "\n" +
                       "  ddLockEnabled: " + ddLockEnabled + "\n" +
                       "  ddLockSet: " + ddLockSet + "\n" +
                       "  ddBlitEnabled: " + ddBlitEnabled + "\n" +
                       "  ddScaleEnabled: " + ddScaleEnabled + "\n" +
                       "  d3dEnabled: " + d3dEnabled + "\n" +
                       "  d3dSet: " + d3dSet + "\n" +
                       "  oglEnabled: " + oglEnabled + "\n" +
                       "  oglVerbose: " + oglVerbose + "\n" +
                       "  gdiBlitEnabled: " + gdiBlitEnabled + "\n" +
                       "  translAccelEnabled: " + translAccelEnabled + "\n" +
                       "  offscreenSharingEnabled: " + offscreenSharingEnabled + "\n" +
                       "  accelReset: " + accelReset + "\n" +
                       "  checkRegistry: " + checkRegistry + "\n" +
                       "  disableRegistry: " + disableRegistry + "\n" +
                       "  d3dTexBPP: " + d3dTexBpp);
    */
}
 
Example #29
Source File: WindowsFlags.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void initJavaFlags() {
    java.security.AccessController.doPrivileged(
        new java.security.PrivilegedAction()
    {
        public Object run() {
            magPresent = getBooleanProp(
                "javax.accessibility.screen_magnifier_present", false);
            boolean ddEnabled =
                !getBooleanProp("sun.java2d.noddraw", magPresent);
            boolean ddOffscreenEnabled =
                getBooleanProp("sun.java2d.ddoffscreen", ddEnabled);
            d3dEnabled = getBooleanProp("sun.java2d.d3d",
                ddEnabled && ddOffscreenEnabled);
            d3dOnScreenEnabled =
                getBooleanProp("sun.java2d.d3d.onscreen", d3dEnabled);
            oglEnabled = getBooleanProp("sun.java2d.opengl", false);
            if (oglEnabled) {
                oglVerbose = isBooleanPropTrueVerbose("sun.java2d.opengl");
                if (WGLGraphicsConfig.isWGLAvailable()) {
                    d3dEnabled = false;
                } else {
                    if (oglVerbose) {
                        System.out.println(
                            "Could not enable OpenGL pipeline " +
                            "(WGL not available)");
                    }
                    oglEnabled = false;
                }
            }
            gdiBlitEnabled = getBooleanProp("sun.java2d.gdiBlit", true);
            d3dSet = getPropertySet("sun.java2d.d3d");
            if (d3dSet) {
                d3dVerbose = isBooleanPropTrueVerbose("sun.java2d.d3d");
            }
            offscreenSharingEnabled =
                getBooleanProp("sun.java2d.offscreenSharing", false);
            accelReset = getBooleanProp("sun.java2d.accelReset", false);
            checkRegistry =
                getBooleanProp("sun.java2d.checkRegistry", false);
            disableRegistry =
                getBooleanProp("sun.java2d.disableRegistry", false);
            javaVersion = System.getProperty("java.version");
            if (javaVersion == null) {
                // Cannot be true, nonetheless...
                javaVersion = "default";
            } else {
                int dashIndex = javaVersion.indexOf('-');
                if (dashIndex >= 0) {
                    // an interim release; use only the part preceding the -
                    javaVersion = javaVersion.substring(0, dashIndex);
                }
            }
            String dpiOverride = System.getProperty("sun.java2d.dpiaware", "true");
            if (dpiOverride != null) {
                setHighDPIAware = dpiOverride.equalsIgnoreCase("true");
            } else {
                String sunLauncherProperty =
                    System.getProperty("sun.java.launcher", "unknown");
                setHighDPIAware =
                    sunLauncherProperty.equalsIgnoreCase("SUN_STANDARD");
            }
            /*
            // Output info based on some non-default flags:
            if (offscreenSharingEnabled) {
                System.out.println(
                    "Warning: offscreenSharing has been enabled. " +
                    "The use of this capability will change in future " +
                    "releases and applications that depend on it " +
                    "may not work correctly");
            }
            */
            return null;
        }
    });
    /*
    System.out.println("WindowsFlags (Java):");
    System.out.println("  ddEnabled: " + ddEnabled + "\n" +
                       "  ddOffscreenEnabled: " + ddOffscreenEnabled + "\n" +
                       "  ddVramForced: " + ddVramForced + "\n" +
                       "  ddLockEnabled: " + ddLockEnabled + "\n" +
                       "  ddLockSet: " + ddLockSet + "\n" +
                       "  ddBlitEnabled: " + ddBlitEnabled + "\n" +
                       "  ddScaleEnabled: " + ddScaleEnabled + "\n" +
                       "  d3dEnabled: " + d3dEnabled + "\n" +
                       "  d3dSet: " + d3dSet + "\n" +
                       "  oglEnabled: " + oglEnabled + "\n" +
                       "  oglVerbose: " + oglVerbose + "\n" +
                       "  gdiBlitEnabled: " + gdiBlitEnabled + "\n" +
                       "  translAccelEnabled: " + translAccelEnabled + "\n" +
                       "  offscreenSharingEnabled: " + offscreenSharingEnabled + "\n" +
                       "  accelReset: " + accelReset + "\n" +
                       "  checkRegistry: " + checkRegistry + "\n" +
                       "  disableRegistry: " + disableRegistry + "\n" +
                       "  d3dTexBPP: " + d3dTexBpp);
    */
}
 
Example #30
Source File: WindowsFlags.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void initJavaFlags() {
    java.security.AccessController.doPrivileged(
        new java.security.PrivilegedAction()
    {
        public Object run() {
            magPresent = getBooleanProp(
                "javax.accessibility.screen_magnifier_present", false);
            boolean ddEnabled =
                !getBooleanProp("sun.java2d.noddraw", magPresent);
            boolean ddOffscreenEnabled =
                getBooleanProp("sun.java2d.ddoffscreen", ddEnabled);
            d3dEnabled = getBooleanProp("sun.java2d.d3d",
                ddEnabled && ddOffscreenEnabled);
            d3dOnScreenEnabled =
                getBooleanProp("sun.java2d.d3d.onscreen", d3dEnabled);
            oglEnabled = getBooleanProp("sun.java2d.opengl", false);
            if (oglEnabled) {
                oglVerbose = isBooleanPropTrueVerbose("sun.java2d.opengl");
                if (WGLGraphicsConfig.isWGLAvailable()) {
                    d3dEnabled = false;
                } else {
                    if (oglVerbose) {
                        System.out.println(
                            "Could not enable OpenGL pipeline " +
                            "(WGL not available)");
                    }
                    oglEnabled = false;
                }
            }
            gdiBlitEnabled = getBooleanProp("sun.java2d.gdiBlit", true);
            d3dSet = getPropertySet("sun.java2d.d3d");
            if (d3dSet) {
                d3dVerbose = isBooleanPropTrueVerbose("sun.java2d.d3d");
            }
            offscreenSharingEnabled =
                getBooleanProp("sun.java2d.offscreenSharing", false);
            accelReset = getBooleanProp("sun.java2d.accelReset", false);
            checkRegistry =
                getBooleanProp("sun.java2d.checkRegistry", false);
            disableRegistry =
                getBooleanProp("sun.java2d.disableRegistry", false);
            javaVersion = System.getProperty("java.version");
            if (javaVersion == null) {
                // Cannot be true, nonetheless...
                javaVersion = "default";
            } else {
                int dashIndex = javaVersion.indexOf('-');
                if (dashIndex >= 0) {
                    // an interim release; use only the part preceding the -
                    javaVersion = javaVersion.substring(0, dashIndex);
                }
            }
            String dpiOverride = System.getProperty("sun.java2d.dpiaware");
            if (dpiOverride != null) {
                setHighDPIAware = dpiOverride.equalsIgnoreCase("true");
            } else {
                String sunLauncherProperty =
                    System.getProperty("sun.java.launcher", "unknown");
                setHighDPIAware =
                    sunLauncherProperty.equalsIgnoreCase("SUN_STANDARD");
            }
            /*
            // Output info based on some non-default flags:
            if (offscreenSharingEnabled) {
                System.out.println(
                    "Warning: offscreenSharing has been enabled. " +
                    "The use of this capability will change in future " +
                    "releases and applications that depend on it " +
                    "may not work correctly");
            }
            */
            return null;
        }
    });
    /*
    System.out.println("WindowsFlags (Java):");
    System.out.println("  ddEnabled: " + ddEnabled + "\n" +
                       "  ddOffscreenEnabled: " + ddOffscreenEnabled + "\n" +
                       "  ddVramForced: " + ddVramForced + "\n" +
                       "  ddLockEnabled: " + ddLockEnabled + "\n" +
                       "  ddLockSet: " + ddLockSet + "\n" +
                       "  ddBlitEnabled: " + ddBlitEnabled + "\n" +
                       "  ddScaleEnabled: " + ddScaleEnabled + "\n" +
                       "  d3dEnabled: " + d3dEnabled + "\n" +
                       "  d3dSet: " + d3dSet + "\n" +
                       "  oglEnabled: " + oglEnabled + "\n" +
                       "  oglVerbose: " + oglVerbose + "\n" +
                       "  gdiBlitEnabled: " + gdiBlitEnabled + "\n" +
                       "  translAccelEnabled: " + translAccelEnabled + "\n" +
                       "  offscreenSharingEnabled: " + offscreenSharingEnabled + "\n" +
                       "  accelReset: " + accelReset + "\n" +
                       "  checkRegistry: " + checkRegistry + "\n" +
                       "  disableRegistry: " + disableRegistry + "\n" +
                       "  d3dTexBPP: " + d3dTexBpp);
    */
}