Java Code Examples for sun.awt.windows.WComponentPeer#isAccelCapable()
The following examples show how to use
sun.awt.windows.WComponentPeer#isAccelCapable() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: D3DSurfaceData.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * Creates a SurfaceData object representing the back buffer of a * double-buffered on-screen Window. */ public static D3DSurfaceData createData(WComponentPeer peer, Image image) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } BufferCapabilities caps = peer.getBackBufferCaps(); VSyncType vSyncType = VSYNC_DEFAULT; if (caps instanceof ExtendedBufferCapabilities) { vSyncType = ((ExtendedBufferCapabilities)caps).getVSync(); } Rectangle r = peer.getBounds(); BufferCapabilities.FlipContents flip = caps.getFlipContents(); int swapEffect; if (flip == FlipContents.COPIED) { swapEffect = SWAP_COPY; } else if (flip == FlipContents.PRIOR) { swapEffect = SWAP_FLIP; } else { // flip == FlipContents.UNDEFINED || .BACKGROUND swapEffect = SWAP_DISCARD; } return new D3DSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), peer.getBackBuffersNum(), swapEffect, vSyncType, FLIP_BACKBUFFER); }
Example 2
Source File: WGLSurfaceData.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * Creates a SurfaceData object representing the back buffer of a * double-buffered on-screen Window. */ public static WGLOffScreenSurfaceData createData(WComponentPeer peer, Image image, int type) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); Rectangle r = peer.getBounds(); if (type == FLIP_BACKBUFFER) { return new WGLOffScreenSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), type); } else { return new WGLVSyncOffScreenSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), type); } }
Example 3
Source File: D3DSurfaceData.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
/** * Creates a SurfaceData object representing the back buffer of a * double-buffered on-screen Window. */ public static D3DSurfaceData createData(WComponentPeer peer, Image image) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } BufferCapabilities caps = peer.getBackBufferCaps(); VSyncType vSyncType = VSYNC_DEFAULT; if (caps instanceof ExtendedBufferCapabilities) { vSyncType = ((ExtendedBufferCapabilities)caps).getVSync(); } Rectangle r = peer.getBounds(); BufferCapabilities.FlipContents flip = caps.getFlipContents(); int swapEffect; if (flip == FlipContents.COPIED) { swapEffect = SWAP_COPY; } else if (flip == FlipContents.PRIOR) { swapEffect = SWAP_FLIP; } else { // flip == FlipContents.UNDEFINED || .BACKGROUND swapEffect = SWAP_DISCARD; } return new D3DSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), peer.getBackBuffersNum(), swapEffect, vSyncType, FLIP_BACKBUFFER); }
Example 4
Source File: D3DSurfaceData.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * Creates a SurfaceData object representing the back buffer of a * double-buffered on-screen Window. */ public static D3DSurfaceData createData(WComponentPeer peer, Image image) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } BufferCapabilities caps = peer.getBackBufferCaps(); VSyncType vSyncType = VSYNC_DEFAULT; if (caps instanceof ExtendedBufferCapabilities) { vSyncType = ((ExtendedBufferCapabilities)caps).getVSync(); } Rectangle r = peer.getBounds(); BufferCapabilities.FlipContents flip = caps.getFlipContents(); int swapEffect; if (flip == FlipContents.COPIED) { swapEffect = SWAP_COPY; } else if (flip == FlipContents.PRIOR) { swapEffect = SWAP_FLIP; } else { // flip == FlipContents.UNDEFINED || .BACKGROUND swapEffect = SWAP_DISCARD; } return new D3DSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), peer.getBackBuffersNum(), swapEffect, vSyncType, FLIP_BACKBUFFER); }
Example 5
Source File: D3DSurfaceData.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Creates a SurfaceData object representing the back buffer of a * double-buffered on-screen Window. */ public static D3DSurfaceData createData(WComponentPeer peer, Image image) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } BufferCapabilities caps = peer.getBackBufferCaps(); VSyncType vSyncType = VSYNC_DEFAULT; if (caps instanceof ExtendedBufferCapabilities) { vSyncType = ((ExtendedBufferCapabilities)caps).getVSync(); } Rectangle r = peer.getBounds(); BufferCapabilities.FlipContents flip = caps.getFlipContents(); int swapEffect; if (flip == FlipContents.COPIED) { swapEffect = SWAP_COPY; } else if (flip == FlipContents.PRIOR) { swapEffect = SWAP_FLIP; } else { // flip == FlipContents.UNDEFINED || .BACKGROUND swapEffect = SWAP_DISCARD; } return new D3DSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), peer.getBackBuffersNum(), swapEffect, vSyncType, FLIP_BACKBUFFER); }
Example 6
Source File: WGLSurfaceData.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * Creates a SurfaceData object representing the back buffer of a * double-buffered on-screen Window. */ public static WGLOffScreenSurfaceData createData(WComponentPeer peer, Image image, int type) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); Rectangle r = peer.getBounds(); if (type == FLIP_BACKBUFFER) { return new WGLOffScreenSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), type); } else { return new WGLVSyncOffScreenSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), type); } }
Example 7
Source File: WGLSurfaceData.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * Creates a SurfaceData object representing the back buffer of a * double-buffered on-screen Window. */ public static WGLOffScreenSurfaceData createData(WComponentPeer peer, Image image, int type) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); Rectangle r = peer.getBounds(); if (type == FLIP_BACKBUFFER) { return new WGLOffScreenSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), type); } else { return new WGLVSyncOffScreenSurfaceData(peer, gc, r.width, r.height, image, peer.getColorModel(), type); } }
Example 8
Source File: WGLSurfaceData.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Creates a SurfaceData object representing the primary (front) buffer * of an on-screen Window. */ public static WGLWindowSurfaceData createData(WComponentPeer peer) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); return new WGLWindowSurfaceData(peer, gc); }
Example 9
Source File: WGLSurfaceData.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Creates a SurfaceData object representing the primary (front) buffer * of an on-screen Window. */ public static WGLWindowSurfaceData createData(WComponentPeer peer) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); return new WGLWindowSurfaceData(peer, gc); }
Example 10
Source File: WGLSurfaceData.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Creates a SurfaceData object representing the primary (front) buffer * of an on-screen Window. */ public static WGLWindowSurfaceData createData(WComponentPeer peer) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); return new WGLWindowSurfaceData(peer, gc); }
Example 11
Source File: D3DScreenUpdateManager.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Determines if we can use a d3d surface for onscreen rendering for this * peer. * We only create onscreen d3d surfaces if the following conditions are met: * - d3d is enabled on this device and onscreen emulation is enabled * - window is big enough to bother (either dimension > MIN_WIN_SIZE) * - this heavyweight doesn't have a BufferStrategy * - if we are in full-screen mode then it must be the peer of the * full-screen window (since there could be only one SwapChain in fs) * and it must not have any heavyweight children * (as Present() doesn't respect component clipping in fullscreen mode) * - it's one of the classes likely to have custom rendering worth * accelerating * * @returns true if we can use a d3d surface for this peer's onscreen * rendering */ public static boolean canUseD3DOnScreen(final WComponentPeer peer, final Win32GraphicsConfig gc, final int bbNum) { if (!(gc instanceof D3DGraphicsConfig)) { return false; } D3DGraphicsConfig d3dgc = (D3DGraphicsConfig)gc; D3DGraphicsDevice d3dgd = d3dgc.getD3DDevice(); String peerName = peer.getClass().getName(); Rectangle r = peer.getBounds(); Component target = (Component)peer.getTarget(); Window fsw = d3dgd.getFullScreenWindow(); return WindowsFlags.isD3DOnScreenEnabled() && d3dgd.isD3DEnabledOnDevice() && peer.isAccelCapable() && (r.width > MIN_WIN_SIZE || r.height > MIN_WIN_SIZE) && bbNum == 0 && (fsw == null || (fsw == target && !hasHWChildren(target))) && (peerName.equals("sun.awt.windows.WCanvasPeer") || peerName.equals("sun.awt.windows.WDialogPeer") || peerName.equals("sun.awt.windows.WPanelPeer") || peerName.equals("sun.awt.windows.WWindowPeer") || peerName.equals("sun.awt.windows.WFramePeer") || peerName.equals("sun.awt.windows.WEmbeddedFramePeer")); }
Example 12
Source File: WGLSurfaceData.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Creates a SurfaceData object representing the primary (front) buffer * of an on-screen Window. */ public static WGLWindowSurfaceData createData(WComponentPeer peer) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); return new WGLWindowSurfaceData(peer, gc); }
Example 13
Source File: D3DScreenUpdateManager.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Determines if we can use a d3d surface for onscreen rendering for this * peer. * We only create onscreen d3d surfaces if the following conditions are met: * - d3d is enabled on this device and onscreen emulation is enabled * - window is big enough to bother (either dimension > MIN_WIN_SIZE) * - this heavyweight doesn't have a BufferStrategy * - if we are in full-screen mode then it must be the peer of the * full-screen window (since there could be only one SwapChain in fs) * and it must not have any heavyweight children * (as Present() doesn't respect component clipping in fullscreen mode) * - it's one of the classes likely to have custom rendering worth * accelerating * * @returns true if we can use a d3d surface for this peer's onscreen * rendering */ public static boolean canUseD3DOnScreen(final WComponentPeer peer, final Win32GraphicsConfig gc, final int bbNum) { if (!(gc instanceof D3DGraphicsConfig)) { return false; } D3DGraphicsConfig d3dgc = (D3DGraphicsConfig)gc; D3DGraphicsDevice d3dgd = d3dgc.getD3DDevice(); String peerName = peer.getClass().getName(); Rectangle r = peer.getBounds(); Component target = (Component)peer.getTarget(); Window fsw = d3dgd.getFullScreenWindow(); return WindowsFlags.isD3DOnScreenEnabled() && d3dgd.isD3DEnabledOnDevice() && peer.isAccelCapable() && (r.width > MIN_WIN_SIZE || r.height > MIN_WIN_SIZE) && bbNum == 0 && (fsw == null || (fsw == target && !hasHWChildren(target))) && (peerName.equals("sun.awt.windows.WCanvasPeer") || peerName.equals("sun.awt.windows.WDialogPeer") || peerName.equals("sun.awt.windows.WPanelPeer") || peerName.equals("sun.awt.windows.WWindowPeer") || peerName.equals("sun.awt.windows.WFramePeer") || peerName.equals("sun.awt.windows.WEmbeddedFramePeer")); }
Example 14
Source File: WGLSurfaceData.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Creates a SurfaceData object representing the primary (front) buffer * of an on-screen Window. */ public static WGLWindowSurfaceData createData(WComponentPeer peer) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); return new WGLWindowSurfaceData(peer, gc); }
Example 15
Source File: WGLSurfaceData.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Creates a SurfaceData object representing the primary (front) buffer * of an on-screen Window. */ public static WGLWindowSurfaceData createData(WComponentPeer peer) { // the OGL pipeline can render directly to the screen and interfere // with layered windows, which is why we don't allow accelerated // surfaces in this case if (!peer.isAccelCapable() || !SunToolkit.isContainingTopLevelOpaque((Component)peer.getTarget())) { return null; } WGLGraphicsConfig gc = getGC(peer); return new WGLWindowSurfaceData(peer, gc); }
Example 16
Source File: D3DScreenUpdateManager.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Determines if we can use a d3d surface for onscreen rendering for this * peer. * We only create onscreen d3d surfaces if the following conditions are met: * - d3d is enabled on this device and onscreen emulation is enabled * - window is big enough to bother (either dimension > MIN_WIN_SIZE) * - this heavyweight doesn't have a BufferStrategy * - if we are in full-screen mode then it must be the peer of the * full-screen window (since there could be only one SwapChain in fs) * and it must not have any heavyweight children * (as Present() doesn't respect component clipping in fullscreen mode) * - it's one of the classes likely to have custom rendering worth * accelerating * * @returns true if we can use a d3d surface for this peer's onscreen * rendering */ public static boolean canUseD3DOnScreen(final WComponentPeer peer, final Win32GraphicsConfig gc, final int bbNum) { if (!(gc instanceof D3DGraphicsConfig)) { return false; } D3DGraphicsConfig d3dgc = (D3DGraphicsConfig)gc; D3DGraphicsDevice d3dgd = d3dgc.getD3DDevice(); String peerName = peer.getClass().getName(); Rectangle r = peer.getBounds(); Component target = (Component)peer.getTarget(); Window fsw = d3dgd.getFullScreenWindow(); return WindowsFlags.isD3DOnScreenEnabled() && d3dgd.isD3DEnabledOnDevice() && peer.isAccelCapable() && (r.width > MIN_WIN_SIZE || r.height > MIN_WIN_SIZE) && bbNum == 0 && (fsw == null || (fsw == target && !hasHWChildren(target))) && (peerName.equals("sun.awt.windows.WCanvasPeer") || peerName.equals("sun.awt.windows.WDialogPeer") || peerName.equals("sun.awt.windows.WPanelPeer") || peerName.equals("sun.awt.windows.WWindowPeer") || peerName.equals("sun.awt.windows.WFramePeer") || peerName.equals("sun.awt.windows.WEmbeddedFramePeer")); }
Example 17
Source File: D3DSurfaceData.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 3 votes |
/** * Returns a WINDOW type of surface - a * swap chain which serves as an on-screen surface, * handled by the D3DScreenUpdateManager. * * Note that the native surface is not initialized * when the surface is created to avoid using excessive * resources, and the surface is placed into the lost * state. It will be restored prior to any rendering * to it. * * @param peer peer for which the onscreen surface is to be created * @return a D3DWindowSurfaceData (flip chain) surface */ public static D3DSurfaceData createData(WComponentPeer peer) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } return new D3DWindowSurfaceData(peer, gc); }
Example 18
Source File: D3DSurfaceData.java From openjdk-8-source with GNU General Public License v2.0 | 3 votes |
/** * Returns a WINDOW type of surface - a * swap chain which serves as an on-screen surface, * handled by the D3DScreenUpdateManager. * * Note that the native surface is not initialized * when the surface is created to avoid using excessive * resources, and the surface is placed into the lost * state. It will be restored prior to any rendering * to it. * * @param peer peer for which the onscreen surface is to be created * @return a D3DWindowSurfaceData (flip chain) surface */ public static D3DSurfaceData createData(WComponentPeer peer) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } return new D3DWindowSurfaceData(peer, gc); }
Example 19
Source File: D3DSurfaceData.java From jdk8u60 with GNU General Public License v2.0 | 3 votes |
/** * Returns a WINDOW type of surface - a * swap chain which serves as an on-screen surface, * handled by the D3DScreenUpdateManager. * * Note that the native surface is not initialized * when the surface is created to avoid using excessive * resources, and the surface is placed into the lost * state. It will be restored prior to any rendering * to it. * * @param peer peer for which the onscreen surface is to be created * @return a D3DWindowSurfaceData (flip chain) surface */ public static D3DSurfaceData createData(WComponentPeer peer) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } return new D3DWindowSurfaceData(peer, gc); }
Example 20
Source File: D3DSurfaceData.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 3 votes |
/** * Returns a WINDOW type of surface - a * swap chain which serves as an on-screen surface, * handled by the D3DScreenUpdateManager. * * Note that the native surface is not initialized * when the surface is created to avoid using excessive * resources, and the surface is placed into the lost * state. It will be restored prior to any rendering * to it. * * @param peer peer for which the onscreen surface is to be created * @return a D3DWindowSurfaceData (flip chain) surface */ public static D3DSurfaceData createData(WComponentPeer peer) { D3DGraphicsConfig gc = getGC(peer); if (gc == null || !peer.isAccelCapable()) { return null; } return new D3DWindowSurfaceData(peer, gc); }