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

Unified Diff: tools/bench_playback.cpp

Issue 277653002: Use a tilegrid for bench_playback. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_playback.cpp
diff --git a/tools/bench_playback.cpp b/tools/bench_playback.cpp
index 89b384842d88d09a665e9e8211573eb4432ee1d1..4e719959323552b8401d25861ce346f6fdf8b2ce 100644
--- a/tools/bench_playback.cpp
+++ b/tools/bench_playback.cpp
@@ -11,6 +11,7 @@
#include "SkGraphics.h"
#include "SkOSFile.h"
#include "SkPicture.h"
+#include "SkPictureRecorder.h"
#include "SkRecordDraw.h"
#include "SkRecordOpts.h"
#include "SkRecorder.h"
@@ -101,7 +102,21 @@ int tool_main(int argc, char** argv) {
continue;
}
- bench(scratch.get(), *src, filename.c_str());
+ // Rerecord into a picture using a tile grid.
+ SkTileGridFactory::TileGridInfo info;
+ info.fTileInterval.set(FLAGS_tile, FLAGS_tile);
+ info.fMargin.setEmpty();
+ info.fOffset.setZero();
+ SkTileGridFactory factory(info);
+
+ SkPictureRecorder recorder;
+ SkCanvas* canvas = recorder.beginRecording(src->width(), src->height(),
+ &factory,
+ SkPicture::kUsePathBoundsForClip_RecordingFlag);
+ src->draw(canvas);
+ SkAutoTUnref<SkPicture> replay(recorder.endRecording());
+
+ bench(scratch.get(), *replay, filename.c_str());
}
return failed ? 1 : 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698