aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecord.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-01-07 08:15:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-07 08:15:10 -0800
commit0575cb2def2f4dfdad04e0674d0f8eb8e7c24cec (patch)
tree9fc4c73da2ed766a9cab0eee77d67d44233b76d1 /src/core/SkPictureRecord.cpp
parent983dc2541a729609037a05eba731b3eb9788c517 (diff)
Revert of add backdrop option to SaveLayerRec (patchset #14 id:260001 of https://codereview.chromium.org/1523053003/ )
Reason for revert: serialized != direct, will investigate Original issue's description: > add backdrop option to SaveLayerRec > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1523053003 > > Committed: https://skia.googlesource.com/skia/+/247415969a9a5ed6c83cc09395472416c4b7de7f TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1565203002
Diffstat (limited to 'src/core/SkPictureRecord.cpp')
-rw-r--r--src/core/SkPictureRecord.cpp46
1 files changed, 10 insertions, 36 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 2822a1ac16..7907ee0d29 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -76,44 +76,19 @@ SkCanvas::SaveLayerStrategy SkPictureRecord::getSaveLayerStrategy(const SaveLaye
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);
+ 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);
- 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);
- }
this->validate(initialOffset, size);
}
@@ -249,8 +224,7 @@ void SkPictureRecord::fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t
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
}