diff options
author | Sven Gothel <[email protected]> | 2023-03-07 18:28:54 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-07 18:28:54 +0100 |
commit | b266c94103dae5ad7a117ab7e0fb6b401ca3c85b (patch) | |
tree | d2e508939ff0fa5248c884779e5925d21a9d02ac /src/jogl/classes/com/jogamp/graph/curve/Region.java | |
parent | 01aac34c2c08d01d728c7906cb1cc132e8e7fab1 (diff) |
Graph Perf: Region*: Add setBufferCapacity(..) and cut-off growBuffer() early if not needed (track capacity); Align all VBORegion* buffer init/set/grow impl.
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/Region.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/Region.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java index d82348b83..5147008a1 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/Region.java +++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java @@ -203,11 +203,25 @@ public abstract class Region { * Allow the renderer buffers to pre-emptively grow for given vertices- and index counts. * @param verticesCount number of vertices to hold * @param indicesCount number of indices to hold + * @see #setBufferCapacity(int, int) * @see #countOutlineShape(OutlineShape, int[]) * @see #countOutlineShapes(List, int[]) */ public abstract void growBuffer(int verticesCount, int indicesCount); + /** + * Set the renderer buffers pre-emptively for given vertices- and index counts. + * <p> + * If the buffers already exceeds given numbers, the buffers are unchanged. + * </p> + * @param verticesCount number of vertices to hold + * @param indicesCount number of indices to hold + * @see #growBuffer(int, int) + * @see #countOutlineShape(OutlineShape, int[]) + * @see #countOutlineShapes(List, int[]) + */ + public abstract void setBufferCapacity(int verticesCount, int indicesCount); + protected abstract void pushVertex(final float[] coords, final float[] texParams, float[] rgba); protected abstract void pushVertices(final float[] coords1, final float[] coords2, final float[] coords3, final float[] texParams1, final float[] texParams2, final float[] texParams3, float[] rgba); |