• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AccelSurface类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createCompatibleVolatileImage

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的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


示例2: createCompatibleVolatileImage

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的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


示例3: setSurfaces

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
private void setSurfaces(AccelSurface srcData,
                         AccelSurface dstData)
{
    // assert rq.lock.isHeldByCurrentThread();
    rq.ensureCapacityAndAlignment(20, 4);
    buf.putInt(SET_SURFACES);
    buf.putLong(srcData.getNativeOps());
    buf.putLong(dstData.getNativeOps());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:BufferedContext.java


示例4: createCompatibleVolatileImage

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
@Override
public VolatileImage createCompatibleVolatileImage(int width, int height,
                                                   int transparency,
                                                   int type) {
    if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED ||
        transparency == Transparency.BITMASK)
    {
        return null;
    }

    if (type == FBOBJECT) {
        if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
            return null;
        }
    } else if (type == PBUFFER) {
        boolean isOpaque = transparency == Transparency.OPAQUE;
        if (!isOpaque && !isCapPresent(CAPS_STORED_ALPHA)) {
            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:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:CGLGraphicsConfig.java


示例5: createCompatibleVolatileImage

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 */
@Override
public VolatileImage
    createCompatibleVolatileImage(int width, int height,
                                  int transparency, int type)
{
    if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED ||
        transparency == Transparency.BITMASK)
    {
        return null;
    }
    boolean isOpaque = transparency == Transparency.OPAQUE;
    if (type == RT_TEXTURE) {
        int cap = isOpaque ? CAPS_RT_TEXTURE_OPAQUE : CAPS_RT_TEXTURE_ALPHA;
        if (!device.isCapPresent(cap)) {
            return null;
        }
    } else if (type == RT_PLAIN) {
        if (!isOpaque && !device.isCapPresent(CAPS_RT_PLAIN_ALPHA)) {
            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:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:D3DGraphicsConfig.java


示例6: createCompatibleVolatileImage

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 */
@Override
public VolatileImage
    createCompatibleVolatileImage(int width, int height,
                                  int transparency, int type)
{
    if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED ||
        transparency == Transparency.BITMASK)
    {
        return null;
    }

    if (type == FBOBJECT) {
        if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
            return null;
        }
    } else if (type == PBUFFER) {
        boolean isOpaque = transparency == Transparency.OPAQUE;
        if (!isOpaque && !isCapPresent(CAPS_STORED_ALPHA)) {
            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:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:WGLGraphicsConfig.java


示例7: update

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:TranslucentWindowPainter.java


示例8: testInvalidType

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
private static void testInvalidType(AccelSurface surface, int type) {
    long ret = surface.getNativeResource(type);
    System.out.printf("  getNativeResource(%d)=0x%x\n", type, ret);
    if (ret != 0l) {
        System.err.printf(
                "FAILED: surface.getNativeResource(%d) returned" +
                " 0x%s. It should have have returned 0L\n",
                type, ret);
        failed = true;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:RSLAPITest.java


示例9: printSurface

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
private static void printSurface(Surface s) {
    if (s instanceof AccelSurface) {
        final AccelSurface surface = (AccelSurface) s;
        System.out.println(" Accel Surface: ");
        System.out.println("  type=" + surface.getType());
        System.out.println("  bounds=" + surface.getBounds());
        System.out.println("  nativeBounds=" + surface.getNativeBounds());
        System.out.println("  isSurfaceLost=" + surface.isSurfaceLost());
        System.out.println("  isValid=" + surface.isValid());
        RenderQueue rq = surface.getContext().getRenderQueue();
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    System.out.printf("  getNativeResource(TEXTURE)=0x%x\n",
                        surface.getNativeResource(TEXTURE));
                    System.out.printf("  getNativeResource(RT_TEXTURE)=0x%x\n",
                        surface.getNativeResource(RT_TEXTURE));
                    System.out.printf("  getNativeResource(RT_PLAIN)=0x%x\n",
                        surface.getNativeResource(RT_PLAIN));
                    System.out.printf(
                        "  getNativeResource(FLIP_BACKBUFFER)=0x%x\n",
                        surface.getNativeResource(FLIP_BACKBUFFER));

                    testD3DDeviceResourceField(surface);

                    testInvalidType(surface, -1);
                    testInvalidType(surface, -150);
                    testInvalidType(surface, 300);
                    testInvalidType(surface, Integer.MAX_VALUE);
                    testInvalidType(surface, Integer.MIN_VALUE);
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        System.out.println("null accelerated surface");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:41,代码来源:RSLAPITest.java


示例10: testGC

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
private static void testGC(GraphicsConfiguration gc) {
    if (!(gc instanceof AccelGraphicsConfig)) {
        System.out.println("Test passed: no hw accelerated configs found.");
        return;
    }
    System.out.println("AccelGraphicsConfig exists, testing.");
    AccelGraphicsConfig agc = (AccelGraphicsConfig) gc;
    printAGC(agc);

    testContext(agc);

    VolatileImage vi = gc.createCompatibleVolatileImage(10, 10);
    vi.validate(gc);
    if (vi instanceof DestSurfaceProvider) {
        System.out.println("Passed: VI is DestSurfaceProvider");
        Surface s = ((DestSurfaceProvider) vi).getDestSurface();
        if (s instanceof AccelSurface) {
            System.out.println("Passed: Obtained Accel Surface");
            printSurface((AccelSurface) s);
        }
        Graphics g = vi.getGraphics();
        if (g instanceof DestSurfaceProvider) {
            System.out.println("Passed: VI graphics is " +
                               "DestSurfaceProvider");
            printSurface(((DestSurfaceProvider) g).getDestSurface());
        }
    } else {
        System.out.println("VI is not DestSurfaceProvider");
    }
    testVICreation(agc, CAPS_RT_TEXTURE_ALPHA, TRANSLUCENT, RT_TEXTURE);
    testVICreation(agc, CAPS_RT_TEXTURE_OPAQUE, OPAQUE, RT_TEXTURE);
    testVICreation(agc, CAPS_RT_PLAIN_ALPHA, TRANSLUCENT, RT_PLAIN);
    testVICreation(agc, agc.getContextCapabilities().getCaps(), OPAQUE,
                   TEXTURE);
    testForNPEDuringCreation(agc);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:37,代码来源:RSLAPITest.java


示例11: update

import sun.java2d.pipe.hw.AccelSurface; //导入依赖的package包/类
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            final int w = as.getBounds().width;
            final int h = as.getBounds().height;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:TranslucentWindowPainter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java KTable类代码示例发布时间:2022-05-21
下一篇:
Java Option类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap