clipstacks can be on the stack or embedded, therefore should not be ref-counted
authorMike Reed <reed@google.com>
Fri, 10 Mar 2017 05:21:52 +0000 (00:21 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 10 Mar 2017 14:13:15 +0000 (14:13 +0000)
BUG=skia:

Change-Id: I7e16034d463a1db1baac404f775cf33076cbbf73
Reviewed-on: https://skia-review.googlesource.com/9509
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>

src/core/SkClipStack.h
src/gpu/GrClipStackClip.h

index 215e287..e889208 100644 (file)
@@ -29,7 +29,7 @@ class SkCanvasClipVisitor;
 // (i.e., the fSaveCount in force when it was added). Restores are thus
 // implemented by removing clips from fDeque that have an fSaveCount larger
 // then the freshly decremented count.
-class SK_API SkClipStack : public SkNVRefCnt<SkClipStack> {
+class SkClipStack {
 public:
     enum BoundsType {
         // The bounding box contains all the pixels that can be written to
index b8c5d17..6607595 100644 (file)
@@ -26,7 +26,7 @@ public:
 
     void reset(const SkClipStack* stack = nullptr, const SkIPoint* origin = nullptr) {
         fOrigin = origin ? *origin : SkIPoint::Make(0, 0);
-        fStack.reset(SkSafeRef(stack));
+        fStack = stack;
     }
 
     bool quickContains(const SkRect&) const final;
@@ -62,8 +62,8 @@ private:
                               const GrRenderTargetContext*,
                               const GrReducedClip&);
 
-    SkIPoint                 fOrigin;
-    sk_sp<const SkClipStack> fStack;
+    SkIPoint            fOrigin;
+    const SkClipStack*  fStack;
 };
 
 #endif // GrClipStackClip_DEFINED