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

Unified Diff: src/core/SkRemote.cpp

Issue 1432593002: SkRemote: saveLayer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/SkRemote.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRemote.cpp
diff --git a/src/core/SkRemote.cpp b/src/core/SkRemote.cpp
index dd0b25d62c472eadddd117100a0f7592f98ee157..236a1a8c24098a7ca992bb3b01604c9c97dca1bd 100644
--- a/src/core/SkRemote.cpp
+++ b/src/core/SkRemote.cpp
@@ -165,7 +165,15 @@ namespace SkRemote {
SaveLayerStrategy willSaveLayer(const SkRect* bounds,
const SkPaint* paint,
SaveFlags flags) override {
- // TODO
+ SkPath path;
+ if (bounds) {
+ path.addRect(*bounds);
+ }
+ const SkPaint defaultPaint;
+ if (!paint) {
+ paint = &defaultPaint;
+ }
+ fEncoder->saveLayer(this->id(path), this->commonIDs(*paint), flags);
return kNoLayer_SaveLayerStrategy;
}
@@ -473,6 +481,12 @@ namespace SkRemote {
void save() override { fCanvas->save(); }
void restore() override { fCanvas->restore(); }
+ void saveLayer(ID bounds, CommonIDs common, SkCanvas::SaveFlags flags) override {
+ SkPaint paint;
+ this->applyCommon(common, &paint);
+ SkRect rect;
+ fCanvas->saveLayer(fPath.find(bounds).isRect(&rect) ? &rect : nullptr, &paint, flags);
+ }
void setMatrix(ID matrix) override { fCanvas->setMatrix(fMatrix.find(matrix)); }
@@ -636,6 +650,9 @@ namespace SkRemote {
void save() override { fWrapped-> save(); }
void restore() override { fWrapped->restore(); }
+ void saveLayer(ID bounds, CommonIDs common, SkCanvas::SaveFlags flags) override {
+ fWrapped->saveLayer(bounds, common, flags);
+ }
void setMatrix(ID matrix) override { fWrapped->setMatrix(matrix); }
« no previous file with comments | « src/core/SkRemote.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698