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


Java SunVolatileImage类代码示例

本文整理汇总了Java中sun.awt.image.SunVolatileImage的典型用法代码示例。如果您正苦于以下问题:Java SunVolatileImage类的具体用法?Java SunVolatileImage怎么用?Java SunVolatileImage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CGLVolatileSurfaceManager

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public CGLVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
    super(vImg, context);

    /*
     * We will attempt to accelerate this image only under the
     * following conditions:
     *   - the image is opaque OR
     *   - the image is translucent AND
     *       - the GraphicsConfig supports the FBO extension OR
     *       - the GraphicsConfig has a stored alpha channel
     */
    int transparency = vImg.getTransparency();
    CGLGraphicsConfig gc = (CGLGraphicsConfig)vImg.getGraphicsConfig();
    accelerationEnabled =
        (transparency == Transparency.OPAQUE) ||
        ((transparency == Transparency.TRANSLUCENT) &&
         (gc.isCapPresent(CAPS_EXT_FBOBJECT) ||
          gc.isCapPresent(CAPS_STORED_ALPHA)));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:CGLVolatileSurfaceManager.java

示例2: D3DVolatileSurfaceManager

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public D3DVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
    super(vImg, context);

    /*
     * We will attempt to accelerate this image only under the
     * following conditions:
     *   - the image is opaque OR
     *   - the image is translucent AND
     *       - the GraphicsConfig supports the FBO extension OR
     *       - the GraphicsConfig has a stored alpha channel
     */
    int transparency = vImg.getTransparency();
    D3DGraphicsDevice gd = (D3DGraphicsDevice)
        vImg.getGraphicsConfig().getDevice();
    accelerationEnabled =
        (transparency == Transparency.OPAQUE) ||
        (transparency == Transparency.TRANSLUCENT &&
         (gd.isCapPresent(CAPS_RT_PLAIN_ALPHA) ||
          gd.isCapPresent(CAPS_RT_TEXTURE_ALPHA)));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:D3DVolatileSurfaceManager.java

示例3: WGLVolatileSurfaceManager

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public WGLVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
    super(vImg, context);

    /*
     * We will attempt to accelerate this image only under the
     * following conditions:
     *   - the image is opaque OR
     *   - the image is translucent AND
     *       - the GraphicsConfig supports the FBO extension OR
     *       - the GraphicsConfig has a stored alpha channel
     */
    int transparency = vImg.getTransparency();
    WGLGraphicsConfig gc = (WGLGraphicsConfig)vImg.getGraphicsConfig();
    accelerationEnabled =
        (transparency == Transparency.OPAQUE) ||
        ((transparency == Transparency.TRANSLUCENT) &&
         (gc.isCapPresent(CAPS_EXT_FBOBJECT) ||
          gc.isCapPresent(CAPS_STORED_ALPHA)));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:WGLVolatileSurfaceManager.java

示例4: GLXVolatileSurfaceManager

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public GLXVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
    super(vImg, context);

    /*
     * We will attempt to accelerate this image only under the
     * following conditions:
     *   - the image is opaque OR
     *   - the image is translucent AND
     *       - the GraphicsConfig supports the FBO extension OR
     *       - the GraphicsConfig has a stored alpha channel
     */
    int transparency = vImg.getTransparency();
    GLXGraphicsConfig gc = (GLXGraphicsConfig)vImg.getGraphicsConfig();
    accelerationEnabled =
        (transparency == Transparency.OPAQUE) ||
        ((transparency == Transparency.TRANSLUCENT) &&
         (gc.isCapPresent(CAPS_EXT_FBOBJECT) ||
          gc.isCapPresent(CAPS_STORED_ALPHA)));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:GLXVolatileSurfaceManager.java

示例5: X11VolatileSurfaceManager

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
public X11VolatileSurfaceManager(SunVolatileImage vImg, Object context) {
    super(vImg, context);

    // We only accelerated opaque vImages currently
    accelerationEnabled = X11SurfaceData.isAccelerationEnabled() &&
        (vImg.getTransparency() == Transparency.OPAQUE);

    if ((context != null) && !accelerationEnabled) {
        // if we're wrapping a backbuffer drawable, we must ensure that
        // the accelerated surface is initialized up front, regardless
        // of whether acceleration is enabled. But we need to set
        // the  accelerationEnabled field to true to reflect that this
        // SM is actually accelerated.
        accelerationEnabled = true;
        sdAccel = initAcceleratedSurface();
        sdCurrent = sdAccel;

        if (sdBackup != null) {
            // release the system memory backup surface, as we won't be
            // needing it in this case
            sdBackup = null;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:X11VolatileSurfaceManager.java

示例6: createCompatibleVolatileImage

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 */
@Override
public VolatileImage
    createCompatibleVolatileImage(int width, int height,
                                  int transparency, int type)
{
    if ((type != FBOBJECT && type != TEXTURE)
            || transparency == Transparency.BITMASK
            || type == FBOBJECT && !isCapPresent(CAPS_EXT_FBOBJECT)) {
        return null;
    }
    SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height,
                                                      transparency, type);
    Surface sd = vi.getDestSurface();
    if (!(sd instanceof AccelSurface) ||
        ((AccelSurface)sd).getType() != type)
    {
        vi.flush();
        vi = null;
    }

    return vi;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:GLXGraphicsConfig.java

示例7: createCompatibleVolatileImage

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
@Override
public VolatileImage createCompatibleVolatileImage(int width, int height,
                                                   int transparency,
                                                   int type) {
    if ((type != FBOBJECT && type != TEXTURE)
            || transparency == Transparency.BITMASK
            || type == FBOBJECT && !isCapPresent(CAPS_EXT_FBOBJECT)) {
        return null;
    }
    SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height,
                                                      transparency, type);
    Surface sd = vi.getDestSurface();
    if (!(sd instanceof AccelSurface) ||
        ((AccelSurface)sd).getType() != type)
    {
        vi.flush();
        vi = null;
    }

    return vi;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:CGLGraphicsConfig.java

示例8: showFrame

import sun.awt.image.SunVolatileImage; //导入依赖的package包/类
/**
 * Shows a frame, then refs its back buffer.
 */
static void showFrame(CountDownLatch latch) {
    JFrame frame = new JFrame("frame") {
        @Override
        public VolatileImage createVolatileImage(int w, int h) {
            // Back the frame buffer by BufferedImage so that it's allocated in RAM
            VolatileImage img = new SunVolatileImage(BI_GC, w, h, Transparency.TRANSLUCENT, new ImageCapabilities(false));
            STRONG_MAP.put(img, null);

            EventQueue.invokeLater(() -> {
                dispose(); // release the frame buffer
                latch.countDown();
            });
            return img;
        }
    };
    frame.setSize(500, 500);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:23,代码来源:SunDisplayChangerLeakTest.java


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