Create aliases AddRef() and Release() to SkRefCnt for compatibility with scoped_refptr
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 Nov 2012 21:30:42 +0000 (21:30 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 Nov 2012 21:30:42 +0000 (21:30 +0000)
Review URL: https://codereview.appspot.com/6844116

git-svn-id: http://skia.googlecode.com/svn/trunk@6639 2bbb7eff-a529-9590-31e7-b0007b416f81

include/core/SkRefCnt.h

index 3a0f8be..21ed0ef 100644 (file)
@@ -71,6 +71,16 @@ public:
         SkASSERT(fRefCnt > 0);
     }
 
+    /**
+     *  Alias for ref(), for compatibility with scoped_refptr.
+     */
+    void AddRef() { this->ref(); }
+
+    /**
+     *  Alias for unref(), for compatibility with scoped_refptr.
+     */
+    void Release() { this->unref(); }
+
 protected:
     /**
      *  Allow subclasses to call this if they've overridden internal_dispose