Fix up the clip mask manager's creation of paths (w.r.t. volatility)
authorrobertphillips <robertphillips@google.com>
Mon, 26 Oct 2015 21:37:03 +0000 (14:37 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 26 Oct 2015 21:37:03 +0000 (14:37 -0700)
I don't expect this to make any difference (perf-wise) but it seems more correct.

This CL relies on https://codereview.chromium.org/1421533007/ (Fix ClipMaskManager's SW-fallback logic)

Committed: https://skia.googlesource.com/skia/+/953fe3139fa60ce56abcfa45a3647d924e637083

Review URL: https://codereview.chromium.org/1419403002

src/core/SkClipStack.cpp
src/gpu/GrClipMaskManager.cpp

index f54d57f..4227eea 100644 (file)
@@ -136,14 +136,17 @@ void SkClipStack::Element::asPath(SkPath* path) const {
     switch (fType) {
         case kEmpty_Type:
             path->reset();
+            path->setIsVolatile(true);
             break;
         case kRect_Type:
             path->reset();
             path->addRect(this->getRect());
+            path->setIsVolatile(true);
             break;
         case kRRect_Type:
             path->reset();
             path->addRRect(fRRect);
+            path->setIsVolatile(true);
             break;
         case kPath_Type:
             *path = *fPath.get();
index b57f3cc..2596a06 100644 (file)
@@ -403,7 +403,6 @@ bool GrClipMaskManager::drawElement(GrPipelineBuilder* pipelineBuilder,
         default: {
             SkPath path;
             element->asPath(&path);
-            path.setIsVolatile(true);
             if (path.isInverseFillType()) {
                 path.toggleInverseFillType();
             }