src/share/classes/sun/java2d/opengl/OGLRenderQueue.java

Print this page




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.java2d.opengl;
  27 
  28 import sun.misc.ThreadGroupUtils;
  29 import sun.java2d.pipe.RenderBuffer;
  30 import sun.java2d.pipe.RenderQueue;
  31 import static sun.java2d.pipe.BufferedOpCodes.*;
  32 import java.security.AccessController;
  33 import java.security.PrivilegedAction;
  34 
  35 /**
  36  * OGL-specific implementation of RenderQueue.  This class provides a
  37  * single (daemon) thread that is responsible for periodically flushing
  38  * the queue, thus ensuring that only one thread communicates with the native
  39  * OpenGL libraries for the entire process.
  40  */
  41 public class OGLRenderQueue extends RenderQueue {
  42 
  43     private static OGLRenderQueue theInstance;
  44     private final QueueFlusher flusher;
  45 
  46     private OGLRenderQueue() {
  47         /*
  48          * The thread must be a member of a thread group




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.java2d.opengl;
  27 
  28 import sun.awt.util.ThreadGroupUtils;
  29 import sun.java2d.pipe.RenderBuffer;
  30 import sun.java2d.pipe.RenderQueue;
  31 import static sun.java2d.pipe.BufferedOpCodes.*;
  32 import java.security.AccessController;
  33 import java.security.PrivilegedAction;
  34 
  35 /**
  36  * OGL-specific implementation of RenderQueue.  This class provides a
  37  * single (daemon) thread that is responsible for periodically flushing
  38  * the queue, thus ensuring that only one thread communicates with the native
  39  * OpenGL libraries for the entire process.
  40  */
  41 public class OGLRenderQueue extends RenderQueue {
  42 
  43     private static OGLRenderQueue theInstance;
  44     private final QueueFlusher flusher;
  45 
  46     private OGLRenderQueue() {
  47         /*
  48          * The thread must be a member of a thread group