diff options
| author | 2018-10-30 10:50:41 -0700 | |
|---|---|---|
| committer | 2018-10-30 10:50:41 -0700 | |
| commit | f401c7e8f5c9f49f6d384b021b9f0df87f48211b (patch) | |
| tree | eb89bc6401636aa2ecdb30b8d0c655e775834a88 | |
| parent | 367d14a1b5172efb2e60e20fc8daf708603aaeda (diff) | |
Add missing endRecording calls
StaticLayoutPerfTest was previously leaking
display lists. RenderNode now notices and yells
about that, exposing this bug
Change-Id: If85c85211a115a4af09edf2a215415fd0d2d0b4b
Fixes: 118650198
Test: this
| -rw-r--r-- | apct-tests/perftests/core/src/android/text/StaticLayoutPerfTest.java | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/apct-tests/perftests/core/src/android/text/StaticLayoutPerfTest.java b/apct-tests/perftests/core/src/android/text/StaticLayoutPerfTest.java index e224fa39422c..35d380232bec 100644 --- a/apct-tests/perftests/core/src/android/text/StaticLayoutPerfTest.java +++ b/apct-tests/perftests/core/src/android/text/StaticLayoutPerfTest.java @@ -245,10 +245,11 @@ public class StaticLayoutPerfTest { state.pauseTiming(); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -261,10 +262,11 @@ public class StaticLayoutPerfTest { final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -277,10 +279,11 @@ public class StaticLayoutPerfTest { final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -293,11 +296,12 @@ public class StaticLayoutPerfTest { final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); Canvas.freeTextLayoutCaches(); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -310,11 +314,12 @@ public class StaticLayoutPerfTest { final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); Canvas.freeTextLayoutCaches(); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -328,10 +333,11 @@ public class StaticLayoutPerfTest { mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT), PAINT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -345,10 +351,11 @@ public class StaticLayoutPerfTest { mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT), PAINT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -362,11 +369,12 @@ public class StaticLayoutPerfTest { mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT), PAINT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); Canvas.freeTextLayoutCaches(); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } @@ -380,11 +388,12 @@ public class StaticLayoutPerfTest { mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT), PAINT); final StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build(); - final RecordingCanvas c = node.start(1200, 200); + final RecordingCanvas c = node.startRecording(1200, 200); Canvas.freeTextLayoutCaches(); state.resumeTiming(); layout.draw(c); + node.endRecording(); } } |