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
This commit is contained in:
commit-bot@chromium.org 2013-10-11 15:20:29 +00:00
Родитель b4227d20b9
Коммит f8a6b20e76
2 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -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, true); )
DEF_BENCH( return new BitmapBench(true, SkBitmap::kARGB_8888_Config, true, false); ) 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 // 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(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); ) 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 | kBilerp_Flag | kBicubic_Flag); )
DEF_BENCH( return new FilterBitmapBench(false, SkBitmap::kARGB_8888_Config, false, false, kScale_Flag | kRotate_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} // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon}
DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_SourceAlpha, SkBitmap::kARGB_8888_Config); ) DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_SourceAlpha, SkBitmap::kARGB_8888_Config); )

Просмотреть файл

@ -593,15 +593,14 @@ int tool_main(int argc, char** argv) {
} }
timer.start(); timer.start();
if (NULL != canvas) {
canvas->save();
}
// Inner loop that allows us to break the run into smaller // Inner loop that allows us to break the run into smaller
// chunks (e.g. frames). This is especially useful for the GPU // chunks (e.g. frames). This is especially useful for the GPU
// as we can flush and/or swap buffers to keep the GPU from // as we can flush and/or swap buffers to keep the GPU from
// queuing up too much work. // queuing up too much work.
for (int loopCount = loopsPerIter; loopCount > 0; ) { for (int loopCount = loopsPerIter; loopCount > 0; ) {
if (NULL != canvas) {
canvas->save();
}
if (frameIntervalComputed && loopCount > loopsPerFrame) { if (frameIntervalComputed && loopCount > loopsPerFrame) {
bench->setLoops(loopsPerFrame); bench->setLoops(loopsPerFrame);
loopCount -= loopsPerFrame; loopCount -= loopsPerFrame;
@ -629,11 +628,11 @@ int tool_main(int argc, char** argv) {
glContext->swapBuffers(); glContext->swapBuffers();
} }
#endif #endif
}
if (NULL != canvas) { if (NULL != canvas) {
canvas->restore(); canvas->restore();
} }
}
// Stop truncated timers before GL calls complete, and stop the full timers after. // Stop truncated timers before GL calls complete, and stop the full timers after.