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); } |