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

Unified Diff: tools/dump_record.cpp

Issue 2120333002: deferred canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: override drawTextRSXform Created 4 years, 5 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 | « tools/DumpRecord.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dump_record.cpp
diff --git a/tools/dump_record.cpp b/tools/dump_record.cpp
index 52f8f8c0b8245771077be2365ff06d0f445b0ab8..5d54f4d561c10c040fee0be22da29c4810f5b5c9 100644
--- a/tools/dump_record.cpp
+++ b/tools/dump_record.cpp
@@ -7,6 +7,7 @@
#include "DumpRecord.h"
#include "SkCommandLineFlags.h"
+#include "SkDeferredCanvas.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
#include "SkRecordDraw.h"
@@ -22,6 +23,7 @@ DEFINE_bool(optimize2, false, "Run SkRecordOptimize2 before dumping.");
DEFINE_int32(tile, 1000000000, "Simulated tile size.");
DEFINE_bool(timeWithCommand, false, "If true, print time next to command, else in first column.");
DEFINE_string2(write, w, "", "Write the (optimized) picture to the named file.");
+DEFINE_bool(defer, false, "Defer clips and translates");
static void dump(const char* name, int w, int h, const SkRecord& record) {
SkBitmap bitmap;
@@ -54,6 +56,12 @@ int tool_main(int argc, char** argv) {
SkDebugf("Could not read %s as an SkPicture.\n", FLAGS_skps[i]);
return 1;
}
+ if (FLAGS_defer) {
+ SkPictureRecorder recorder;
+ SkDeferredCanvas deferred(recorder.beginRecording(src->cullRect()));
+ src->playback(&deferred);
+ src = recorder.finishRecordingAsPicture();
+ }
const int w = SkScalarCeilToInt(src->cullRect().width());
const int h = SkScalarCeilToInt(src->cullRect().height());
« no previous file with comments | « tools/DumpRecord.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698