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

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: 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
Index: src/core/SkRemote.cpp
diff --git a/src/core/SkRemote.cpp b/src/core/SkRemote.cpp
index 1209be014c6f92ab90399c8b36285ee25b02cfe3..9d2e2e50797acbaec625cc8692614c01ba049f19 100644
--- a/src/core/SkRemote.cpp
+++ b/src/core/SkRemote.cpp
@@ -163,18 +163,19 @@ 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);
+ // TODO: what to do with rec.fBackdrop?
+ fEncoder->saveLayer(this->id(path), this->commonIDs(*paint), rec.fSaveLayerFlags);
robertphillips 2015/12/17 19:53:57 ?
+ SkASSERT(false);
return kNoLayer_SaveLayerStrategy;
}
@@ -500,11 +501,12 @@ 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, uint32_t saveLayerFlags) override {
SkPaint paint;
this->applyCommon(common, &paint);
SkRect rect;
robertphillips 2015/12/17 19:53:57 \n somewhere ?
reed1 2015/12/17 20:22:31 Done.
- fCanvas->saveLayer(fPath.find(bounds).isRect(&rect) ? &rect : nullptr, &paint, flags);
+
+ fCanvas->saveLayer({ fPath.find(bounds).isRect(&rect) ? &rect : nullptr, &paint, saveLayerFlags });
}
void setMatrix(ID matrix) override { fCanvas->setMatrix(fMatrix.find(matrix)); }
@@ -684,8 +686,8 @@ 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 saveLayer(ID bounds, CommonIDs common, uint32_t saveLayerFlags) override {
+ fWrapped->saveLayer(bounds, common, saveLayerFlags);
}
void setMatrix(ID matrix) override { fWrapped->setMatrix(matrix); }
« src/core/SkPictureFlat.h ('K') | « src/core/SkRemote.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698