Index: include/gpu/GrTypes.h |
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h |
index 41cc7eab79171c422ab84de8ad0233a8d8bf324e..22b2e224f6edd3dbe513adb6215d1502d569403a 100644 |
--- a/include/gpu/GrTypes.h |
+++ b/include/gpu/GrTypes.h |
@@ -708,4 +708,20 @@ static const uint32_t kAll_GrBackendState = 0xffffffff; |
/////////////////////////////////////////////////////////////////////////////// |
+#if GR_ALWAYS_ALLOCATE_ON_HEAP |
+ #define GrAutoMallocBaseType SkAutoMalloc |
+#else |
+ #define GrAutoMallocBaseType SkAutoSMalloc<S> |
+#endif |
+ |
+template <size_t S> class GrAutoMalloc : public GrAutoMallocBaseType { |
+public: |
+ GrAutoMalloc() : INHERITED() {} |
+ explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
+ virtual ~GrAutoMalloc() {} |
+private: |
+ typedef GrAutoMallocBaseType INHERITED; |
+}; |
+ |
+#undef GrAutoMallocBaseType |
#endif |