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

Unified Diff: src/core/SkMatrixClipStateMgr.h

Issue 169283011: Fix saveLayer bugs in SkMatrixClipStateMgr (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 10 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 | « no previous file | src/core/SkMatrixClipStateMgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMatrixClipStateMgr.h
===================================================================
--- src/core/SkMatrixClipStateMgr.h (revision 13521)
+++ src/core/SkMatrixClipStateMgr.h (working copy)
@@ -180,10 +180,10 @@
};
MatrixClipState(MatrixClipState* prev, int flags)
-#ifdef SK_DEBUG
: fPrev(prev)
-#endif
{
+ fHasOpen = false;
+
if (NULL == prev) {
fLayerID = 0;
@@ -193,6 +193,9 @@
// The identity/wide-open-clip state is current by default
fMCStateID = kIdentityWideOpenStateID;
+#ifdef SK_DEBUG
+ fExpectedDepth = 1;
+#endif
}
else {
fLayerID = prev->fLayerID;
@@ -214,6 +217,9 @@
// Initially a new save/saveLayer represents the same MC state
// as its predecessor.
fMCStateID = prev->fMCStateID;
+#ifdef SK_DEBUG
+ fExpectedDepth = prev->fExpectedDepth;
+#endif
}
fIsSaveLayer = false;
@@ -234,8 +240,13 @@
int32_t fSaveLayerBaseStateID;
SkTDArray<int>* fSavedSkipOffsets;
+ // Does the MC state have an open block in the skp?
+ bool fHasOpen;
+
+ MatrixClipState* fPrev;
+
#ifdef SK_DEBUG
- MatrixClipState* fPrev; // debugging aid
+ int fExpectedDepth; // debugging aid
#endif
int32_t fMCStateID;
@@ -365,6 +376,8 @@
void addClipOffset(int offset) {
SkASSERT(NULL != fSkipOffsets);
SkASSERT(kIdentityWideOpenStateID != fCurOpenStateID);
+ SkASSERT(fCurMCState->fHasOpen);
+ SkASSERT(!fCurMCState->fIsSaveLayer);
*fSkipOffsets->append() = offset;
}
@@ -385,6 +398,12 @@
SkASSERT(index >= 0 && index < fMatrixDict.count());
return fMatrixDict[index];
}
+
+ bool isCurrentlyOpen(int32_t stateID);
+
+#ifdef SK_DEBUG
+ int fActualDepth;
+#endif
};
#endif
« no previous file with comments | « no previous file | src/core/SkMatrixClipStateMgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698