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

Print this page


   1 /*
   2  * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   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


 164 
 165     protected native boolean initTexture(long pData,
 166                                          boolean isOpaque, boolean texNonPow2,
 167                                          boolean texRect,
 168                                          int width, int height);
 169     protected native boolean initFBObject(long pData,
 170                                           boolean isOpaque, boolean texNonPow2,
 171                                           boolean texRect,
 172                                           int width, int height);
 173     protected native boolean initFlipBackbuffer(long pData);
 174     protected abstract boolean initPbuffer(long pData, long pConfigInfo,
 175                                            boolean isOpaque,
 176                                            int width, int height);
 177 
 178     private native int getTextureTarget(long pData);
 179     private native int getTextureID(long pData);
 180 
 181     static {
 182         if (!GraphicsEnvironment.isHeadless()) {
 183             // fbobject currently enabled by default; use "false" to disable
 184             String fbo = (String)java.security.AccessController.doPrivileged(
 185                 new sun.security.action.GetPropertyAction(
 186                     "sun.java2d.opengl.fbobject"));
 187             isFBObjectEnabled = !"false".equals(fbo);
 188 
 189             // lcdshader currently enabled by default; use "false" to disable
 190             String lcd = (String)java.security.AccessController.doPrivileged(
 191                 new sun.security.action.GetPropertyAction(
 192                     "sun.java2d.opengl.lcdshader"));
 193             isLCDShaderEnabled = !"false".equals(lcd);
 194 
 195             // biopshader currently enabled by default; use "false" to disable
 196             String biop = (String)java.security.AccessController.doPrivileged(
 197                 new sun.security.action.GetPropertyAction(
 198                     "sun.java2d.opengl.biopshader"));
 199             isBIOpShaderEnabled = !"false".equals(biop);
 200 
 201             // gradshader currently enabled by default; use "false" to disable
 202             String grad = (String)java.security.AccessController.doPrivileged(
 203                 new sun.security.action.GetPropertyAction(
 204                     "sun.java2d.opengl.gradshader"));
 205             isGradShaderEnabled = !"false".equals(grad);
 206 
 207             OGLRenderQueue rq = OGLRenderQueue.getInstance();
 208             oglImagePipe = new OGLDrawImage();
 209             oglTextPipe = new OGLTextRenderer(rq);
 210             oglRenderPipe = new OGLRenderer(rq);
 211             if (GraphicsPrimitive.tracingEnabled()) {
 212                 oglTextPipe = oglTextPipe.traceWrap();
 213                 //The wrapped oglRenderPipe will wrap the AA pipe as well...
 214                 //oglAAPgramPipe = oglRenderPipe.traceWrap();
 215             }
 216             oglAAPgramPipe = oglRenderPipe.getAAParallelogramPipe();
 217             oglTxRenderPipe =
 218                 new PixelToParallelogramConverter(oglRenderPipe,
 219                                                   oglRenderPipe,
 220                                                   1.0, 0.25, true);
 221 
 222             OGLBlitLoops.register();


   1 /*
   2  * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   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


 164 
 165     protected native boolean initTexture(long pData,
 166                                          boolean isOpaque, boolean texNonPow2,
 167                                          boolean texRect,
 168                                          int width, int height);
 169     protected native boolean initFBObject(long pData,
 170                                           boolean isOpaque, boolean texNonPow2,
 171                                           boolean texRect,
 172                                           int width, int height);
 173     protected native boolean initFlipBackbuffer(long pData);
 174     protected abstract boolean initPbuffer(long pData, long pConfigInfo,
 175                                            boolean isOpaque,
 176                                            int width, int height);
 177 
 178     private native int getTextureTarget(long pData);
 179     private native int getTextureID(long pData);
 180 
 181     static {
 182         if (!GraphicsEnvironment.isHeadless()) {
 183             // fbobject currently enabled by default; use "false" to disable
 184             String fbo = java.security.AccessController.doPrivileged(
 185                 new sun.security.action.GetPropertyAction(
 186                     "sun.java2d.opengl.fbobject"));
 187             isFBObjectEnabled = !"false".equals(fbo);
 188 
 189             // lcdshader currently enabled by default; use "false" to disable
 190             String lcd = java.security.AccessController.doPrivileged(
 191                 new sun.security.action.GetPropertyAction(
 192                     "sun.java2d.opengl.lcdshader"));
 193             isLCDShaderEnabled = !"false".equals(lcd);
 194 
 195             // biopshader currently enabled by default; use "false" to disable
 196             String biop = java.security.AccessController.doPrivileged(
 197                 new sun.security.action.GetPropertyAction(
 198                     "sun.java2d.opengl.biopshader"));
 199             isBIOpShaderEnabled = !"false".equals(biop);
 200 
 201             // gradshader currently enabled by default; use "false" to disable
 202             String grad = java.security.AccessController.doPrivileged(
 203                 new sun.security.action.GetPropertyAction(
 204                     "sun.java2d.opengl.gradshader"));
 205             isGradShaderEnabled = !"false".equals(grad);
 206 
 207             OGLRenderQueue rq = OGLRenderQueue.getInstance();
 208             oglImagePipe = new OGLDrawImage();
 209             oglTextPipe = new OGLTextRenderer(rq);
 210             oglRenderPipe = new OGLRenderer(rq);
 211             if (GraphicsPrimitive.tracingEnabled()) {
 212                 oglTextPipe = oglTextPipe.traceWrap();
 213                 //The wrapped oglRenderPipe will wrap the AA pipe as well...
 214                 //oglAAPgramPipe = oglRenderPipe.traceWrap();
 215             }
 216             oglAAPgramPipe = oglRenderPipe.getAAParallelogramPipe();
 217             oglTxRenderPipe =
 218                 new PixelToParallelogramConverter(oglRenderPipe,
 219                                                   oglRenderPipe,
 220                                                   1.0, 0.25, true);
 221 
 222             OGLBlitLoops.register();