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()); |