diff -r 7b3101216e61 -r 0aba35254e00 src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java --- a/src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java Thu Sep 12 22:20:35 2019 -0700 +++ b/src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java Fri Sep 13 17:35:12 2019 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,26 +25,24 @@ 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.*; -import static sun.java2d.pipe.hw.ContextCapabilities.*; -import java.lang.annotation.Native; +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. */ -public class OGLContext extends BufferedContext { - - private final OGLGraphicsConfig config; +final class OGLContext extends BufferedContext { - OGLContext(RenderQueue rq, OGLGraphicsConfig config) { + OGLContext(RenderQueue rq) { super(rq); - this.config = config; } /** @@ -111,10 +109,6 @@ rq.flushNow(); } - public RenderQueue getRenderQueue() { - return OGLRenderQueue.getInstance(); - } - /** * Returns a string representing adapter id (vendor, renderer, version). * Must be called on the rendering thread. @@ -123,38 +117,6 @@ */ 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.