From abc833631e0ab30a06c7aff47a39a551544fd735 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 2 Apr 2014 19:25:16 +0200 Subject: Bug 801: Reduce temp. object creation, i.e. GC load --- .../classes/javax/media/opengl/GLBufferStorage.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/GLBufferStorage.java b/src/jogl/classes/javax/media/opengl/GLBufferStorage.java index 929ecf60a..b36e87101 100644 --- a/src/jogl/classes/javax/media/opengl/GLBufferStorage.java +++ b/src/jogl/classes/javax/media/opengl/GLBufferStorage.java @@ -78,10 +78,10 @@ import java.nio.IntBuffer; */ public abstract class GLBufferStorage { private final int name; - private final long size; - private final int mutableUsage; - private final int immutableFlags; - protected ByteBuffer mappedBuffer; + private /* final */ long size; + private /* final */ int mutableUsage; + private /* final */ int immutableFlags; + private ByteBuffer mappedBuffer; protected GLBufferStorage(final int name, final long size, final int mutableUsage, final int immutableFlags) { this.name = name; @@ -91,6 +91,16 @@ public abstract class GLBufferStorage { this.mappedBuffer = null; } + protected void reset(final long size, final int mutableUsage, final int immutableFlags) { + this.size = size; + this.mutableUsage = mutableUsage; + this.immutableFlags = immutableFlags; + this.mappedBuffer = null; + } + protected void setMappedBuffer(final ByteBuffer buffer) { + this.mappedBuffer = buffer; + } + /** Return the buffer name */ public final int getName() { return name; } -- cgit v1.2.3