Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / include / core / SkTemplates.h
index 5005713..a3a8466 100644 (file)
@@ -143,6 +143,10 @@ public:
         return obj;
     }
 
+    void swap(SkAutoTDelete* that) {
+        SkTSwap(fObj, that->fObj);
+    }
+
 private:
     T*  fObj;
 };
@@ -174,6 +178,13 @@ public:
     void    free() { SkDELETE_ARRAY(fArray); fArray = NULL; }
     T*      detach() { T* array = fArray; fArray = NULL; return array; }
 
+    void reset(T array[]) {
+        if (fArray != array) {
+            SkDELETE_ARRAY(fArray);
+            fArray = array;
+        }
+    }
+
 private:
     T*  fArray;
 };