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

Unified Diff: src/effects/SkLayerDrawLooper.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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/effects/SkEmbossMaskFilter.cpp ('k') | src/effects/SkLayerRasterizer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLayerDrawLooper.cpp
diff --git a/src/effects/SkLayerDrawLooper.cpp b/src/effects/SkLayerDrawLooper.cpp
index aed2c9bbd4ef9e12a3f5bf2ac272d55d134cb253..19525eca51f61ab868fcdf2583a634fa4fba4d08 100644
--- a/src/effects/SkLayerDrawLooper.cpp
+++ b/src/effects/SkLayerDrawLooper.cpp
@@ -200,20 +200,6 @@ bool SkLayerDrawLooper::asABlurShadow(BlurShadowRec* bsRec) const {
///////////////////////////////////////////////////////////////////////////////
void SkLayerDrawLooper::flatten(SkWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
-
-#ifdef SK_DEBUG
- {
- Rec* rec = fRecs;
- int count = 0;
- while (rec) {
- rec = rec->fNext;
- count += 1;
- }
- SkASSERT(count == fCount);
- }
-#endif
-
buffer.writeInt(fCount);
Rec* rec = fRecs;
@@ -245,22 +231,7 @@ SkFlattenable* SkLayerDrawLooper::CreateProc(SkReadBuffer& buffer) {
info.fPostTranslate = buffer.readBool();
buffer.readPaint(builder.addLayerOnTop(info));
}
- SkLayerDrawLooper* looper = builder.detachLooper();
- SkASSERT(count == looper->fCount);
-
-#ifdef SK_DEBUG
- {
- Rec* rec = looper->fRecs;
- int n = 0;
- while (rec) {
- rec = rec->fNext;
- n += 1;
- }
- SkASSERT(count == n);
- }
-#endif
-
- return looper;
+ return builder.detachLooper();
}
#ifndef SK_IGNORE_TO_STRING
« no previous file with comments | « src/effects/SkEmbossMaskFilter.cpp ('k') | src/effects/SkLayerRasterizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698