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

Unified Diff: dm/DMSrcSink.cpp

Issue 2213333002: SkLite* (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: annoying... Created 4 years, 4 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') | gyp/core.gypi » ('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 2e9e565c86b35fb2fce73fbd5498e79d21310d8e..52e1dd9ef354914a11042449fa9997bb48130ee8 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -21,6 +21,8 @@
#include "SkImageGenerator.h"
#include "SkImageGeneratorCG.h"
#include "SkImageGeneratorWIC.h"
+#include "SkLiteDL.h"
+#include "SkLiteRecorder.h"
#include "SkMallocPixelRef.h"
#include "SkMultiPictureDraw.h"
#include "SkNullCanvas.h"
@@ -1609,4 +1611,24 @@ Error ViaSingletonPictures::draw(
});
}
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+Error ViaLite::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
+ auto size = src.size();
+ SkRect bounds = {0,0, (SkScalar)size.width(), (SkScalar)size.height()};
+ return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) -> Error {
+ sk_sp<SkLiteDL> dl = SkLiteDL::New(bounds);
+
+ SkLiteRecorder rec;
+ rec.reset(dl.get());
+
+ Error err = src.draw(&rec);
+ if (!err.isEmpty()) {
+ return err;
+ }
+ dl->draw(canvas);
+ return ""; //check_against_reference(bitmap, src, fSink);
+ });
+}
+
} // namespace DM
« no previous file with comments | « dm/DMSrcSink.h ('k') | gyp/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698