当前位置: 首页>>代码示例>>Java>>正文


Java WComponentPeer.isAccelCapable方法代码示例

本文整理汇总了Java中sun.awt.windows.WComponentPeer.isAccelCapable方法的典型用法代码示例。如果您正苦于以下问题:Java WComponentPeer.isAccelCapable方法的具体用法?Java WComponentPeer.isAccelCapable怎么用?Java WComponentPeer.isAccelCapable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.awt.windows.WComponentPeer的用法示例。


在下文中一共展示了WComponentPeer.isAccelCapable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createData

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:D3DSurfaceData.java

示例2: createData

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:WGLSurfaceData.java

示例3: canUseD3DOnScreen

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * 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"));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:D3DScreenUpdateManager.java

示例4: canUseD3DOnScreen

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * 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
 *
 * @return 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"));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:46,代码来源:D3DScreenUpdateManager.java


注:本文中的sun.awt.windows.WComponentPeer.isAccelCapable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。