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

Unified Diff: include/gpu/GrProcessorDataManager.h

Issue 1225363002: Move GrProcessorDataManager to GrMemoryPool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 5 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/GrPaint.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrProcessorDataManager.h
diff --git a/include/gpu/GrProcessorDataManager.h b/include/gpu/GrProcessorDataManager.h
index 0f376b7be20b1eeaaeb3d014b5228fc4e04ae175..a58cb4ef5136e201544e1a754fbcff1fdd66f6ad 100644
--- a/include/gpu/GrProcessorDataManager.h
+++ b/include/gpu/GrProcessorDataManager.h
@@ -8,6 +8,43 @@
#ifndef GrProcessorDataManager_DEFINED
#define GrProcessorDataManager_DEFINED
-class GrProcessorDataManager {};
+#include "SkRefCnt.h"
+#include "SkTArray.h"
+
+class GrProcessorDataManager : public SkRefCnt {
+public:
+ GrProcessorDataManager() {}
+ GrProcessorDataManager(const GrProcessorDataManager& procDataManager) {
+ fIndices = procDataManager.fIndices;
+ fStorage = procDataManager.fStorage;
+ }
+
+ void* operator new(size_t size);
+ void operator delete(void* target);
+
+ void* operator new(size_t size, void* placement) {
+ return ::operator new(size, placement);
+ }
+ void operator delete(void* target, void* placement) {
+ ::operator delete(target, placement);
+ }
+
+private:
+ static const uint32_t kNumProcessor = 1;
+ static const uint32_t kDataIndicesPerProcessor = 1;
+ static const uint32_t kPreAllocDataPerProcessor = 1;
+
+ /*static const size_t kPreAllocStorage = kNumProcessor * kPreAllocDataPerProcessor;
+ static const uint32_t kNumProcessor = 8;
+ static const uint32_t kDataIndicesPerProcessor = 4;
+ static const uint32_t kPreAllocDataPerProcessor = kDataIndicesPerProcessor *
+ sizeof(GrCoordTransform);*/
+ static const size_t kPreAllocIndices = kNumProcessor * kDataIndicesPerProcessor;
+ static const size_t kPreAllocStorage = kNumProcessor * kPreAllocDataPerProcessor;
+ SkSTArray<kPreAllocIndices, uint32_t, true> fIndices;
+ SkSTArray<kPreAllocStorage, unsigned char, true> fStorage;
+
+ typedef SkRefCnt INHERITED;
+};
#endif
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698