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 |