Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Unified Diff: include/gpu/GrTypes.h

Issue 459263003: Add a parameter GR_ALWAYS_ALLOCATE_ON_HEAP to allow for only ever creating temporary buffers on the… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Build fixes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrConfig.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « include/gpu/GrConfig.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698