Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3258)

Unified Diff: bench/benchmain.cpp

Issue 26848013: save/restore the canvas around every bench draw call (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/BitmapBench.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/benchmain.cpp
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index b970d09bc808ce72b4a5356283bfb32ceda3e8a2..6b52508163b79950f21e37f53b1a00f9b7a5002f 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) {
reed1 2013/10/14 13:18:04 We have SkAutoCanvasRestore. One if its smarts is
+ 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.
« no previous file with comments | « bench/BitmapBench.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698