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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 1567063002: Revert[2] of "add backdrop option to SaveLayerRec" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add test and fix for svg-savelayer optimization Created 4 years, 11 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/SkPictureFlat.h ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.cpp
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 82b8f0e5782ef6ac494e124952f46719448c98cd..4b028f714e91da5d2c96a108fd177c4afedab023 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -483,11 +483,29 @@ void SkPicturePlayback::handleOp(SkReader32* reader,
auto flags = SkCanvas::LegacySaveFlagsToSaveLayerFlags(reader->readInt());
canvas->saveLayer(SkCanvas::SaveLayerRec(boundsPtr, paint, flags));
} break;
- case SAVE_LAYER_SAVELAYERFLAGS: {
+ case SAVE_LAYER_SAVELAYERFLAGS_DEPRECATED_JAN_2016: {
const SkRect* boundsPtr = get_rect_ptr(reader);
const SkPaint* paint = fPictureData->getPaint(reader);
canvas->saveLayer(SkCanvas::SaveLayerRec(boundsPtr, paint, reader->readInt()));
} break;
+ case SAVE_LAYER_SAVELAYERREC: {
+ SkCanvas::SaveLayerRec rec(nullptr, nullptr, nullptr, 0);
+ const uint32_t flatFlags = reader->readInt();
+ if (flatFlags & SAVELAYERREC_HAS_BOUNDS) {
+ rec.fBounds = &reader->skipT<SkRect>();
+ }
+ if (flatFlags & SAVELAYERREC_HAS_PAINT) {
+ rec.fPaint = fPictureData->getPaint(reader);
+ }
+ if (flatFlags & SAVELAYERREC_HAS_BACKDROP) {
+ const SkPaint* paint = fPictureData->getPaint(reader);
+ rec.fBackdrop = paint->getImageFilter();
+ }
+ if (flatFlags & SAVELAYERREC_HAS_FLAGS) {
+ rec.fSaveLayerFlags = reader->readInt();
+ }
+ canvas->saveLayer(rec);
+ } break;
case SCALE: {
SkScalar sx = reader->readScalar();
SkScalar sy = reader->readScalar();
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698