From 9c9577f2685053677b477365fb5ffa1cb2f53d03 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 7 Oct 2015 11:14:15 +0200
Subject: Bug 1189 - Add OpenGL ES 3.2 and new GL 4.5 Extensions support -
 Part3: GLEmitter: Don't RenameExtensionIntoCore for IgnoredExtensions

---
 .../com/jogamp/gluegen/opengl/GLConfiguration.java |  8 ++++
 .../com/jogamp/gluegen/opengl/GLEmitter.java       | 44 ++++++++++++----------
 2 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
index d6f72ee29..1c034ebfb 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
@@ -254,6 +254,14 @@ public class GLConfiguration extends ProcAddressConfiguration {
         super.logRenames();
     }
 
+    protected boolean isIgnoredExtension(final String extensionName) {
+        if( ignoredExtensions.contains(extensionName) ) {
+            return !forcedExtensions.contains(extensionName);
+        } else {
+            return false;
+        }
+    }
+
     protected boolean shouldIgnoreExtension(final AliasedSymbol symbol) {
         final Set<String> symExtensionNames;
         // collect current-name symbol extensions
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
index 8df4a9488..a68fc6b2a 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
@@ -112,31 +112,35 @@ public class GLEmitter extends ProcAddressEmitter {
         final Set<String> extensionSet = isSemHeader ? config.getExtensionsRenamedIntoCore() : glInfo.getExtensions();
 
         for (final String extension : extensionSet) {
-            LOG.log(INFO, "<RenameExtensionIntoCore: {0} BEGIN {1}", extension, headerType);
-            final Set<String> declarations = glInfo.getDeclarations(extension);
-            if (declarations != null) {
-                for (final Iterator<String> iterator = declarations.iterator(); iterator.hasNext();) {
-                    final String decl = iterator.next();
-                    final boolean isGLFunction = GLNameResolver.isGLFunction(decl);
-                    boolean isGLEnumeration = false;
-                    if (!isGLFunction) {
-                        isGLEnumeration = GLNameResolver.isGLEnumeration(decl);
-                    }
-                    if (isGLFunction || isGLEnumeration) {
-                        final String renamed = GLNameResolver.normalize(decl, isGLFunction);
-                        if (!renamed.equals(decl)) {
-                            if( isSemHeader ) {
-                                // Sem + Doc
-                                config.addJavaSymbolRename(decl, renamed);
-                            } else {
-                                // Doc only
-                                config.addJavaDocSymbolRename(decl, renamed);
+            if( isSemHeader && config.isIgnoredExtension(extension) ) {
+                LOG.log(INFO, "<RenameExtensionIntoCore: {0} IGNORED {1}>", extension, headerType);
+            } else {
+                LOG.log(INFO, "<RenameExtensionIntoCore: {0} BEGIN {1}", extension, headerType);
+                final Set<String> declarations = glInfo.getDeclarations(extension);
+                if (declarations != null) {
+                    for (final Iterator<String> iterator = declarations.iterator(); iterator.hasNext();) {
+                        final String decl = iterator.next();
+                        final boolean isGLFunction = GLNameResolver.isGLFunction(decl);
+                        boolean isGLEnumeration = false;
+                        if (!isGLFunction) {
+                            isGLEnumeration = GLNameResolver.isGLEnumeration(decl);
+                        }
+                        if (isGLFunction || isGLEnumeration) {
+                            final String renamed = GLNameResolver.normalize(decl, isGLFunction);
+                            if (!renamed.equals(decl)) {
+                                if( isSemHeader ) {
+                                    // Sem + Doc
+                                    config.addJavaSymbolRename(decl, renamed);
+                                } else {
+                                    // Doc only
+                                    config.addJavaDocSymbolRename(decl, renamed);
+                                }
                             }
                         }
                     }
                 }
+                LOG.log(INFO, "RenameExtensionIntoCore: {0} END>", extension, headerType);
             }
-            LOG.log(INFO, "RenameExtensionIntoCore: {0} END>", extension, headerType);
         }
     }
 
-- 
cgit v1.2.3