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

Unified Diff: src/core/SkPictureRecord.cpp

Issue 1565203002: Revert of add backdrop option to SaveLayerRec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkPicturePlayback.cpp ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 2822a1ac1643a2c0681418b79ae1ec75baf4c326..7907ee0d2935f22b30ceca2be899d0b1b5a506e6 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -76,44 +76,19 @@
void SkPictureRecord::recordSaveLayer(const SaveLayerRec& rec) {
fContentInfo.onSaveLayer();
- // op + flatflags
+ // op + bool for 'bounds'
size_t size = 2 * kUInt32Size;
- uint32_t flatFlags = 0;
-
if (rec.fBounds) {
- flatFlags |= SAVELAYERREC_HAS_BOUNDS;
- size += sizeof(*rec.fBounds);
- }
- if (rec.fPaint) {
- flatFlags |= SAVELAYERREC_HAS_PAINT;
- size += sizeof(uint32_t); // index
- }
- if (rec.fBackdrop) {
- flatFlags |= SAVELAYERREC_HAS_BACKDROP;
- size += sizeof(uint32_t); // (paint) index
- }
- if (rec.fSaveLayerFlags) {
- flatFlags |= SAVELAYERREC_HAS_FLAGS;
- size += sizeof(uint32_t);
- }
-
- const size_t initialOffset = this->addDraw(SAVE_LAYER_SAVELAYERREC, &size);
- this->addInt(flatFlags);
- if (flatFlags & SAVELAYERREC_HAS_BOUNDS) {
- this->addRect(*rec.fBounds);
- }
- if (flatFlags & SAVELAYERREC_HAS_PAINT) {
- this->addPaintPtr(rec.fPaint);
- }
- if (flatFlags & SAVELAYERREC_HAS_BACKDROP) {
- // overkill, but we didn't already track single flattenables, so using a paint for that
- SkPaint paint;
- paint.setImageFilter(const_cast<SkImageFilter*>(rec.fBackdrop));
- this->addPaint(paint);
- }
- if (flatFlags & SAVELAYERREC_HAS_FLAGS) {
- this->addInt(rec.fSaveLayerFlags);
- }
+ size += sizeof(*rec.fBounds); // + rect
+ }
+ // + paint index + flags
+ size += 2 * kUInt32Size;
+
+ size_t initialOffset = this->addDraw(SAVE_LAYER_SAVELAYERFLAGS, &size);
+ this->addRectPtr(rec.fBounds);
+ this->addPaintPtr(rec.fPaint);
+ this->addInt(rec.fSaveLayerFlags);
+
this->validate(initialOffset, size);
}
@@ -249,8 +224,7 @@
uint32_t opSize;
DrawType drawOp = peek_op_and_size(&fWriter, -offset, &opSize);
SkASSERT(SAVE_LAYER_SAVEFLAGS_DEPRECATED != drawOp);
- SkASSERT(SAVE_LAYER_SAVELAYERFLAGS_DEPRECATED_JAN_2016 != drawOp);
- SkASSERT(SAVE == drawOp || SAVE_LAYER_SAVELAYERREC == drawOp);
+ SkASSERT(SAVE == drawOp || SAVE_LAYER_SAVELAYERFLAGS == drawOp);
}
#endif
}
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698