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

Unified Diff: dm/DMSrcSink.cpp

Issue 885733002: Fold gmtoskp into DM, as --src gm --config skp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/DMSrcSink.h ('k') | experimental/tools/gmtoskp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 4e79c63b4a32e2d866d2e275f4c8249346738534..7979dff9bdfb21345b76319ca4fba1c3197bfe5f 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -197,6 +197,23 @@ Error PDFSink::draw(const Src& src, SkBitmap*, SkWStream* dst) const {
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+SKPSink::SKPSink() {}
+
+Error SKPSink::draw(const Src& src, SkBitmap*, SkWStream* dst) const {
+ SkSize size;
+ size = src.size();
+ SkPictureRecorder recorder;
+ Error err = src.draw(recorder.beginRecording(size.width(), size.height()));
+ if (!err.isEmpty()) {
+ return err;
+ }
+ SkAutoTUnref<SkPicture> pic(recorder.endRecording());
+ pic->serialize(dst);
+ return "";
+}
+
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
RasterSink::RasterSink(SkColorType colorType) : fColorType(colorType) {}
Error RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*) const {
« no previous file with comments | « dm/DMSrcSink.h ('k') | experimental/tools/gmtoskp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698