aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-11 15:20:29 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-11 15:20:29 +0000
commitf8a6b20e765619ee50da9d9afa7f63f9603cf260 (patch)
treec14b34aec02e67c034eb5a03c6570fa598656d8b /bench
parentb4227d20b98d3de3bf2d037d55590187b690a582 (diff)
save/restore the canvas around every bench draw call
BUG= R=djsollen@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/26848013 git-svn-id: http://skia.googlecode.com/svn/trunk@11728 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r--bench/BitmapBench.cpp2
-rw-r--r--bench/benchmain.cpp13
2 files changed, 6 insertions, 9 deletions
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index a9b10f4669..982c917c02 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -363,7 +363,6 @@ DEF_BENCH( return new BitmapBench(true, SkBitmap::kIndex8_Config); )
DEF_BENCH( return new BitmapBench(true, SkBitmap::kARGB_8888_Config, true, true); )
DEF_BENCH( return new BitmapBench(true, SkBitmap::kARGB_8888_Config, true, false); )
-/* TODO(mtklein): figure out why these are broken (suspect caching is interfering) and restore
// scale filter -> S32_opaque_D32_filter_DX_{SSE2,SSSE3} and Fact9 is also for S32_D16_filter_DX_SSE2
DEF_BENCH( return new FilterBitmapBench(false, SkBitmap::kARGB_8888_Config, false, false, kScale_Flag | kBilerp_Flag); )
DEF_BENCH( return new FilterBitmapBench(true, SkBitmap::kARGB_8888_Config, false, false, kScale_Flag | kBilerp_Flag); )
@@ -378,7 +377,6 @@ DEF_BENCH( return new FilterBitmapBench(true, SkBitmap::kARGB_8888_Config, true,
DEF_BENCH( return new FilterBitmapBench(false, SkBitmap::kARGB_8888_Config, false, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); )
DEF_BENCH( return new FilterBitmapBench(false, SkBitmap::kARGB_8888_Config, false, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); )
-*/
// source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon}
DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_SourceAlpha, SkBitmap::kARGB_8888_Config); )
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index b970d09bc8..6b52508163 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -593,15 +593,14 @@ int tool_main(int argc, char** argv) {
}
timer.start();
- if (NULL != canvas) {
- canvas->save();
- }
-
// Inner loop that allows us to break the run into smaller
// chunks (e.g. frames). This is especially useful for the GPU
// as we can flush and/or swap buffers to keep the GPU from
// queuing up too much work.
for (int loopCount = loopsPerIter; loopCount > 0; ) {
+ if (NULL != canvas) {
+ canvas->save();
+ }
if (frameIntervalComputed && loopCount > loopsPerFrame) {
bench->setLoops(loopsPerFrame);
loopCount -= loopsPerFrame;
@@ -629,11 +628,11 @@ int tool_main(int argc, char** argv) {
glContext->swapBuffers();
}
#endif
+ if (NULL != canvas) {
+ canvas->restore();
+ }
}
- if (NULL != canvas) {
- canvas->restore();
- }
// Stop truncated timers before GL calls complete, and stop the full timers after.