< prev index next >

src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 23,52 **** * questions. */ package sun.java2d.opengl; import sun.java2d.pipe.BufferedContext; import sun.java2d.pipe.RenderBuffer; import sun.java2d.pipe.RenderQueue; import sun.java2d.pipe.hw.ContextCapabilities; - import static sun.java2d.pipe.BufferedOpCodes.*; - import static sun.java2d.pipe.hw.ContextCapabilities.*; ! import java.lang.annotation.Native; /** * Note that the RenderQueue lock must be acquired before calling any of * the methods in this class. */ ! public class OGLContext extends BufferedContext { ! private final OGLGraphicsConfig config; ! ! OGLContext(RenderQueue rq, OGLGraphicsConfig config) { super(rq); - this.config = config; } /** * Convenience method that delegates to setScratchSurface() below. */ --- 23,50 ---- * questions. */ package sun.java2d.opengl; + import java.lang.annotation.Native; + import sun.java2d.pipe.BufferedContext; import sun.java2d.pipe.RenderBuffer; import sun.java2d.pipe.RenderQueue; import sun.java2d.pipe.hw.ContextCapabilities; ! import static sun.java2d.pipe.BufferedOpCodes.INVALIDATE_CONTEXT; ! import static sun.java2d.pipe.BufferedOpCodes.SET_SCRATCH_SURFACE; /** * Note that the RenderQueue lock must be acquired before calling any of * the methods in this class. */ ! final class OGLContext extends BufferedContext { ! OGLContext(RenderQueue rq) { super(rq); } /** * Convenience method that delegates to setScratchSurface() below. */
*** 109,162 **** rq.ensureCapacity(4); rq.getBuffer().putInt(INVALIDATE_CONTEXT); rq.flushNow(); } - public RenderQueue getRenderQueue() { - return OGLRenderQueue.getInstance(); - } - /** * Returns a string representing adapter id (vendor, renderer, version). * Must be called on the rendering thread. * * @return an id string for the adapter */ static final native String getOGLIdString(); - @Override - public void saveState() { - // assert rq.lock.isHeldByCurrentThread(); - - // reset all attributes of this and current contexts - invalidateContext(); - invalidateCurrentContext(); - - setScratchSurface(config); - - // save the state on the native level - rq.ensureCapacity(4); - buf.putInt(SAVE_STATE); - rq.flushNow(); - } - - @Override - public void restoreState() { - // assert rq.lock.isHeldByCurrentThread(); - - // reset all attributes of this and current contexts - invalidateContext(); - invalidateCurrentContext(); - - setScratchSurface(config); - - // restore the state on the native level - rq.ensureCapacity(4); - buf.putInt(RESTORE_STATE); - rq.flushNow(); - } - static class OGLContextCaps extends ContextCapabilities { /** * Indicates the presence of the GL_EXT_framebuffer_object extension. * This cap will only be set if the fbobject system property has been * enabled and we are able to create an FBO with depth buffer. --- 107,124 ----
< prev index next >