aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-01-23 00:53:47 +0100
committerSven Gothel <[email protected]>2015-01-23 00:53:47 +0100
commitdb775658a7f5d6614ae716b7492af8210f5e5f18 (patch)
tree15f9131f2b8ccb8ba97932c6bdcb61e333dc0c97 /make/config/jogl/gl-impl-CustomJavaCode-gles3.java
parentd0676451343e826e49d9c5732320f080d4c11c8d (diff)
Bug 1119 - GL* Efficiency: Keep ProcAddressTable instance within GL* instances
Diffstat (limited to 'make/config/jogl/gl-impl-CustomJavaCode-gles3.java')
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gles3.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
index 42adca4b1..a0e3c6570 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
@@ -1,15 +1,11 @@
+private final GLES3ProcAddressTable _pat;
public GLES3Impl(GLProfile glp, GLContextImpl context) {
this._context = context;
- if(null != context) {
- this.bufferObjectTracker = context.getBufferObjectTracker();
- this.bufferStateTracker = context.getBufferStateTracker();
- this.glStateTracker = context.getGLStateTracker();
- } else {
- this.bufferObjectTracker = null;
- this.bufferStateTracker = null;
- this.glStateTracker = null;
- }
+ this._pat = (GLES3ProcAddressTable)_context.getGLProcAddressTable();
+ this.bufferObjectTracker = context.getBufferObjectTracker();
+ this.bufferStateTracker = context.getBufferStateTracker();
+ this.glStateTracker = context.getGLStateTracker();
this.glProfile = glp;
this._isES3 = glp.getImplName() == GLProfile.GLES3;
}
@@ -354,7 +350,7 @@ public final void glDepthRange(double zNear, double zFar) {
@Override
public final void glBufferData(int target, long size, Buffer data, int usage) {
- final long glProcAddress = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glBufferData;
+ final long glProcAddress = _pat._addressof_glBufferData;
if ( 0 == glProcAddress ) {
throw new GLException(String.format("Method \"%s\" not available", "glBufferData"));
}
@@ -365,7 +361,7 @@ public final void glBufferData(int target, long size, Buffer data, int usage) {
@Override
public boolean glUnmapBuffer(int target) {
- final long glProcAddress = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glUnmapBuffer;
+ final long glProcAddress = _pat._addressof_glUnmapBuffer;
if ( 0 == glProcAddress ) {
throw new GLException(String.format("Method \"%s\" not available", "glUnmapBuffer"));
}
@@ -374,7 +370,7 @@ public boolean glUnmapBuffer(int target) {
@Override
public final GLBufferStorage mapBuffer(final int target, final int access) {
- final long glProcAddress = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer;
+ final long glProcAddress = _pat._addressof_glMapBuffer;
if ( 0 == glProcAddress ) {
throw new GLException("Method \"glMapBuffer\" not available");
}
@@ -382,7 +378,7 @@ public final GLBufferStorage mapBuffer(final int target, final int access) {
}
@Override
public final GLBufferStorage mapBufferRange(final int target, final long offset, final long length, final int access) {
- final long glProcAddress = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferRange;
+ final long glProcAddress = _pat._addressof_glMapBufferRange;
if ( 0 == glProcAddress ) {
throw new GLException("Method \"glMapBufferRange\" not available");
}