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/com/jogamp/graph/geom/Outline.java | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/jogl/classes/com/jogamp/graph/geom/Outline.java') diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java index 80aea2af4..15a45b056 100644 --- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java +++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java @@ -47,18 +47,35 @@ import com.jogamp.opengl.math.geom.AABBox; * * @see OutlineShape, Region */ -public class Outline implements Cloneable, Comparable { +public class Outline implements Comparable { - private ArrayList vertices = new ArrayList(3); - private boolean closed = false; - private AABBox bbox = new AABBox(); - private boolean dirtyBBox = false; + private ArrayList vertices; + private boolean closed; + private final AABBox bbox; + private boolean dirtyBBox; /**Create an outline defined by control vertices. * An outline can contain off Curve vertices which define curved * regions in the outline. */ public Outline() { + vertices = new ArrayList(3); + closed = false; + bbox = new AABBox(); + dirtyBBox = false; + } + + /** + * Copy ctor + */ + public Outline(final Outline src) { + vertices = new ArrayList(src.vertices.size()); + for(int i=0; i { } return true; } - - /** - * @return deep clone of this Outline - */ - @Override - public Outline clone() { - Outline o; - try { - o = (Outline) super.clone(); - } catch (CloneNotSupportedException e) { throw new InternalError(); } - o.bbox = bbox.clone(); - o.vertices = new ArrayList(vertices.size()); - for(int i=0; i