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

Unified Diff: src/core/SkLiteDL.cpp

Issue 2315283002: SkLiteDL: drawAsLayer() (Closed)
Patch Set: tweaks Created 4 years, 3 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 | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLiteDL.cpp
diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp
index 8c8abb1cc3232e37ff5d71983e88c734b3cccc11..227c2f30b6ea20ee851dffb305878ad39432d436 100644
--- a/src/core/SkLiteDL.cpp
+++ b/src/core/SkLiteDL.cpp
@@ -816,3 +816,16 @@ void SkLiteDL::reset(SkRect bounds) {
fUsed = 0;
fBounds = bounds;
}
+
+void SkLiteDL::drawAsLayer(SkCanvas* canvas, const SkMatrix* matrix, const SkPaint* paint) {
+ auto fallback_plan = [&] {
+ SkRect bounds = this->getBounds();
+ canvas->saveLayer(&bounds, paint);
+ this->draw(canvas, matrix);
+ canvas->restore();
+ };
+
+ // TODO: single-draw specializations
+
+ return fallback_plan();
+}
« no previous file with comments | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698