diff options
3 files changed, 1 insertions, 81 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java index ebebbda06..8d3ed2d8e 100644 --- a/src/jogl/classes/com/jogamp/graph/font/Font.java +++ b/src/jogl/classes/com/jogamp/graph/font/Font.java @@ -426,7 +426,6 @@ public interface Font { final CharSequence string, final AffineTransform temp1, final AffineTransform temp2); - PerfCounterCtrl perfCounter(); /** Returns {@link #getFullFamilyName()} */ @Override diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java index d2137ae36..c2c66bd36 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java @@ -370,68 +370,6 @@ class TypecastFont implements Font { return processString(visitor, transform, string, new AffineTransform(), new AffineTransform()); } - static class Perf { - long t0 = 0; - // all td_ values are in [ns] - long td_visitor = 0; - long td_total = 0; - long count = 0; - - public void print(final PrintStream out) { - out.printf("TypecastFont.process(): count %,3d, total %,5d [ms], per-add %,4.2f [ns]%n", count, TimeUnit.NANOSECONDS.toMillis(td_total), - ((double)td_total/(double)count)); - out.printf(" visitor %,5d [ms], per-add %,4.2f [ns]%n", TimeUnit.NANOSECONDS.toMillis(td_visitor), - ((double)td_visitor/(double)count)); - } - - public void clear() { - t0 = 0; - td_visitor = 0; - td_total = 0; - count = 0; - } - } - private Perf perf = null; - - private final PerfCounterCtrl perfCounterCtrl = new PerfCounterCtrl() { - @Override - public void enable(final boolean enable) { - if( enable ) { - if( null != perf ) { - perf.clear(); - } else { - perf = new Perf(); - } - } else { - perf = null; - } - } - - @Override - public void clear() { - if( null != perf ) { - perf.clear(); - } - } - - @Override - public long getTotalDuration() { - if( null != perf ) { - return perf.td_total; - } else { - return 0; - } - } - - @Override - public void print(final PrintStream out) { - if( null != perf ) { - perf.print(out); - } - } }; - @Override - public PerfCounterCtrl perfCounter() { return perfCounterCtrl; } - @Override public AABBox processString(final OutlineShape.Visitor visitor, final AffineTransform transform, final CharSequence string, @@ -439,10 +377,6 @@ class TypecastFont implements Font { if (null == string || 0 == string.length() ) { return new AABBox(); } - if( null != perf ) { - ++perf.count; - perf.t0 = Clock.currentNanos(); - } final AABBox res = new AABBox(); final int charCount = string.length(); @@ -482,20 +416,11 @@ class TypecastFont implements Font { } temp1.translate(advanceTotal, y, temp2); res.resize(temp1.transform(glyphShape.getBounds(), temp_box)); - if( null != perf ) { - final long t1 = Clock.currentNanos(); - visitor.visit(glyphShape, temp1); - perf.td_visitor += Clock.currentNanos() - t1; - } else { - visitor.visit(glyphShape, temp1); - } + visitor.visit(glyphShape, temp1); advanceTotal += glyph.getAdvance(); left_glyph = glyph; } } - if( null != perf ) { - perf.td_total += Clock.currentNanos() - perf.t0; - } return res; } diff --git a/src/test/com/jogamp/opengl/test/junit/graph/PerfTextRendererNEWT00.java b/src/test/com/jogamp/opengl/test/junit/graph/PerfTextRendererNEWT00.java index 44b1f087d..d7e55a778 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/PerfTextRendererNEWT00.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/PerfTextRendererNEWT00.java @@ -256,7 +256,6 @@ public class PerfTextRendererNEWT00 { final Perf perf = new Perf(); if( do_perf ) { region.perfCounter().enable(true); - font.perfCounter().enable(true); } final AffineTransform translation = new AffineTransform(); @@ -357,13 +356,11 @@ public class PerfTextRendererNEWT00 { // print + reset counter @ 1/3 loops if( do_perf ) { region.perfCounter().print(System.err); - font.perfCounter().print(System.err); } perf.print(System.err, loop_i+1, "Frame"+(loop_i+1)); perf.clear(); if( do_perf ) { region.perfCounter().clear(); - font.perfCounter().clear(); } } if( 0 == loop_i || loop_count - 1 == loop_i) { @@ -374,7 +371,6 @@ public class PerfTextRendererNEWT00 { region.printBufferStats(System.err); if( do_perf ) { region.perfCounter().print(System.err); - font.perfCounter().print(System.err); } perf.print(System.err, loop_i+1, "Frame"+(loop_i+1)); } |