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

Unified Diff: dm/DMUtil.cpp

Issue 345553003: Support serialization in SkRecord-backed SkPictures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: robert Created 6 years, 6 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 | « dm/DMUtil.h ('k') | gyp/dm.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMUtil.cpp
diff --git a/dm/DMUtil.cpp b/dm/DMUtil.cpp
index 94fdd6ec88fc46eba08c82b95969b3db37de0fa8..92ce38172e21b11e4cd612126314256a7efcd58e 100644
--- a/dm/DMUtil.cpp
+++ b/dm/DMUtil.cpp
@@ -20,10 +20,13 @@ SkString FileToTaskName(SkString filename) {
return filename;
}
-SkPicture* RecordPicture(skiagm::GM* gm, uint32_t recordFlags, SkBBHFactory* factory) {
- const SkISize size = gm->getISize();
+SkPicture* RecordPicture(skiagm::GM* gm, SkBBHFactory* factory, bool skr) {
+ const int w = gm->getISize().width(),
+ h = gm->getISize().height();
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(size.width(), size.height(), factory, recordFlags);
+
+ SkCanvas* canvas = skr ? recorder.EXPERIMENTAL_beginRecording(w, h, factory)
+ : recorder. beginRecording(w, h, factory);
canvas->concat(gm->getInitialTransform());
gm->draw(canvas);
canvas->flush();
@@ -39,11 +42,10 @@ void AllocatePixels(const SkBitmap& reference, SkBitmap* bitmap) {
AllocatePixels(reference.colorType(), reference.width(), reference.height(), bitmap);
}
-void DrawPicture(SkPicture* picture, SkBitmap* bitmap) {
- SkASSERT(picture != NULL);
+void DrawPicture(const SkPicture& picture, SkBitmap* bitmap) {
SkASSERT(bitmap != NULL);
SkCanvas canvas(*bitmap);
- canvas.drawPicture(picture);
+ canvas.drawPicture(&picture);
canvas.flush();
}
« no previous file with comments | « dm/DMUtil.h ('k') | gyp/dm.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698