< prev index next >

src/java.desktop/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java

Print this page
rev 57800 : 8238075: [OGL] Delete unused properties
Reviewed-by: XXX

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2020, 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

@@ -62,27 +62,22 @@
 import static sun.java2d.opengl.OGLSurfaceData.TEXTURE;
 
 public final class CGLGraphicsConfig extends CGraphicsConfig
     implements OGLGraphicsConfig
 {
-    //private static final int kOpenGLSwapInterval =
-    // RuntimeOptions.getCurrentOptions().OpenGLSwapInterval;
-    private static final int kOpenGLSwapInterval = 0; // TODO
     private static boolean cglAvailable;
     private static ImageCapabilities imageCaps = new CGLImageCaps();
 
-    private int pixfmt;
     private BufferCapabilities bufferCaps;
     private long pConfigInfo;
     private ContextCapabilities oglCaps;
     private final OGLContext context;
     private final Object disposerReferent = new Object();
     private final int maxTextureSize;
 
     private static native boolean initCGL();
-    private static native long getCGLConfigInfo(int displayID, int visualnum,
-                                                int swapInterval);
+    private static native long getCGLConfigInfo();
     private static native int getOGLCapabilities(long configInfo);
 
     /**
      * Returns GL_MAX_TEXTURE_SIZE from the shared opengl context. Must be
      * called under OGLRQ lock, because this method change current context.

@@ -93,16 +88,13 @@
 
     static {
         cglAvailable = initCGL();
     }
 
-    private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
-                              long configInfo, int maxTextureSize,
-                              ContextCapabilities oglCaps) {
+    private CGLGraphicsConfig(CGraphicsDevice device, long configInfo,
+                              int maxTextureSize, ContextCapabilities oglCaps) {
         super(device);
-
-        this.pixfmt = pixfmt;
         this.pConfigInfo = configInfo;
         this.oglCaps = oglCaps;
         this.maxTextureSize = maxTextureSize;
         context = new OGLContext(OGLRenderQueue.getInstance());
 

@@ -123,12 +115,11 @@
                                          getColorModel(transparency),
                                          null,
                                          OGLSurfaceData.TEXTURE);
     }
 
-    public static CGLGraphicsConfig getConfig(CGraphicsDevice device,
-                                              int displayID, int pixfmt)
+    public static CGLGraphicsConfig getConfig(CGraphicsDevice device)
     {
         if (!cglAvailable) {
             return null;
         }
 

@@ -140,11 +131,11 @@
         try {
             // getCGLConfigInfo() creates and destroys temporary
             // surfaces/contexts, so we should first invalidate the current
             // Java-level context and flush the queue...
             OGLContext.invalidateCurrentContext();
-            cfginfo = getCGLConfigInfo(displayID, pixfmt, kOpenGLSwapInterval);
+            cfginfo = getCGLConfigInfo();
             if (cfginfo != 0L) {
                 textureSize = nativeGetMaxTextureSize();
                 // 7160609: GL still fails to create a square texture of this
                 // size. Half should be safe enough.
                 // Explicitly not support a texture more than 2^14, see 8010999.

@@ -161,11 +152,11 @@
             return null;
         }
 
         int oglCaps = getOGLCapabilities(cfginfo);
         ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);
-        return new CGLGraphicsConfig(device, pixfmt, cfginfo, textureSize, caps);
+        return new CGLGraphicsConfig(device, cfginfo, textureSize, caps);
     }
 
     public static boolean isCGLAvailable() {
         return cglAvailable;
     }

@@ -251,12 +242,11 @@
         }
     }
 
     @Override
     public String toString() {
-        String display = getDevice().getIDstring();
-        return ("CGLGraphicsConfig[" + display + ", pixfmt=" + pixfmt + "]");
+        return ("CGLGraphicsConfig[" + getDevice().getIDstring() + "]");
     }
 
     @Override
     public SurfaceData createSurfaceData(CGLLayer layer) {
         return CGLSurfaceData.createData(layer);
< prev index next >