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

Unified Diff: src/core/SkRemote.cpp

Issue 1533953002: change signature for virtual related to saveLayer, passing SaveLayerRec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment Created 5 years 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') | src/pipe/SkGPipeRead.cpp » ('j') | 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 1209be014c6f92ab90399c8b36285ee25b02cfe3..22185cddb06cc22d01aef0f5fec826b96362d638 100644
--- a/src/core/SkRemote.cpp
+++ b/src/core/SkRemote.cpp
@@ -163,18 +163,17 @@ namespace SkRemote {
void willSave() override { fEncoder-> save(); }
void didRestore() override { fEncoder->restore(); }
- SaveLayerStrategy willSaveLayer(const SkRect* bounds,
- const SkPaint* paint,
- SaveFlags flags) override {
+ SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec& rec) override {
SkPath path;
- if (bounds) {
- path.addRect(*bounds);
+ if (rec.fBounds) {
+ path.addRect(*rec.fBounds);
}
const SkPaint defaultPaint;
+ const SkPaint* paint = rec.fPaint;
if (!paint) {
paint = &defaultPaint;
}
- fEncoder->saveLayer(this->id(path), this->commonIDs(*paint), flags);
+ fEncoder->saveLayer(this->id(path), this->commonIDs(*paint), rec.fSaveLayerFlags);
return kNoLayer_SaveLayerStrategy;
}
@@ -500,11 +499,13 @@ namespace SkRemote {
void save() override { fCanvas->save(); }
void restore() override { fCanvas->restore(); }
- void saveLayer(ID bounds, CommonIDs common, SkCanvas::SaveFlags flags) override {
+ void saveLayer(ID bounds, CommonIDs common, SkCanvas::SaveLayerFlags flags) override {
SkPaint paint;
this->applyCommon(common, &paint);
SkRect rect;
- fCanvas->saveLayer(fPath.find(bounds).isRect(&rect) ? &rect : nullptr, &paint, flags);
+
+ fCanvas->saveLayer({ fPath.find(bounds).isRect(&rect) ? &rect : nullptr,
+ &paint, flags });
}
void setMatrix(ID matrix) override { fCanvas->setMatrix(fMatrix.find(matrix)); }
@@ -684,7 +685,7 @@ namespace SkRemote {
void save() override { fWrapped-> save(); }
void restore() override { fWrapped->restore(); }
- void saveLayer(ID bounds, CommonIDs common, SkCanvas::SaveFlags flags) override {
+ void saveLayer(ID bounds, CommonIDs common, SkCanvas::SaveLayerFlags flags) override {
fWrapped->saveLayer(bounds, common, flags);
}
« no previous file with comments | « src/core/SkRemote.h ('k') | src/pipe/SkGPipeRead.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698