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

Unified Diff: src/core/SkCanvas.cpp

Issue 22947003: Make ClipStack honor save flags (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | « include/core/SkDeque.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
===================================================================
--- src/core/SkCanvas.cpp (revision 10709)
+++ src/core/SkCanvas.cpp (working copy)
@@ -720,8 +720,9 @@
newTop->fNext = fMCRec;
fMCRec = newTop;
- fClipStack.save();
- SkASSERT(fClipStack.getSaveCount() == this->getSaveCount() - 1);
+ if (SkCanvas::kClip_SaveFlag & flags) {
+ fClipStack.save();
+ }
return saveCount;
}
@@ -896,7 +897,8 @@
fDeviceCMDirty = true;
fLocalBoundsCompareTypeDirty = true;
- fClipStack.restore();
+ SkRasterClip* oldRasterClip = fMCRec->fRasterClip;
+
// reserve our layer (if any)
DeviceCM* layer = fMCRec->fLayer; // may be null
// now detach it from fMCRec so we can pop(). Gets freed after its drawn
@@ -907,6 +909,10 @@
fMCStack.pop_back();
fMCRec = (MCRec*)fMCStack.back();
+ if (NULL == fMCRec || fMCRec->fRasterClip != oldRasterClip) {
bsalomon 2013/08/14 15:49:13 eek.. don't we want to stop computing raster clip
robertphillips 2013/08/14 16:16:58 That is the problem.
reed1 2013/08/14 16:51:31 If we pass the flags (or a subset of them) to clip
robertphillips 2013/08/14 17:00:16 So a ClipStack frame would store the number of res
bsalomon 2013/08/14 18:23:28 yeah I don't see why clip stack should see saves t
+ fClipStack.restore();
+ }
+
/* Time to draw the layer's offscreen. We can't call the public drawSprite,
since if we're being recorded, we don't want to record this (the
recorder will have already recorded the restore).
« no previous file with comments | « include/core/SkDeque.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698