OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrProcessorDataManager_DEFINED | 8 #ifndef GrProcessorDataManager_DEFINED |
9 #define GrProcessorDataManager_DEFINED | 9 #define GrProcessorDataManager_DEFINED |
10 | 10 |
11 #include "SkRefCnt.h" | 11 // TODO this class is just an empty stub for now |
12 #include "SkTArray.h" | |
13 | 12 |
14 class GrProcessorDataManager : public SkRefCnt { | 13 class GrProcessorDataManager { |
15 public: | |
16 GrProcessorDataManager() {} | |
17 GrProcessorDataManager(const GrProcessorDataManager& procDataManager) { | |
18 fIndices = procDataManager.fIndices; | |
19 fStorage = procDataManager.fStorage; | |
20 } | |
21 | |
22 void* operator new(size_t size); | |
23 void operator delete(void* target); | |
24 | |
25 void* operator new(size_t size, void* placement) { | |
26 return ::operator new(size, placement); | |
27 } | |
28 void operator delete(void* target, void* placement) { | |
29 ::operator delete(target, placement); | |
30 } | |
31 | |
32 private: | |
33 uint32_t currentSaveMarker() const { return 0; } | |
34 void restoreToSaveMarker(/*uint32_t marker*/) {} | |
35 | |
36 // For GrPipelineBuilder::AutoRestoreProcessorDataManager | |
37 friend class GrPipelineBuilder; | |
38 static const uint32_t kNumProcessor = 1; | |
39 static const uint32_t kDataIndicesPerProcessor = 1; | |
40 static const uint32_t kPreAllocDataPerProcessor = 1; | |
41 | |
42 /*static const size_t kPreAllocStorage = kNumProcessor * kPreAllocDataPerPro
cessor; | |
43 static const uint32_t kNumProcessor = 8; | |
44 static const uint32_t kDataIndicesPerProcessor = 4; | |
45 static const uint32_t kPreAllocDataPerProcessor = kDataIndicesPerProcessor * | |
46 sizeof(GrCoordTransform);*
/ | |
47 static const size_t kPreAllocIndices = kNumProcessor * kDataIndicesPerProces
sor; | |
48 static const size_t kPreAllocStorage = kNumProcessor * kPreAllocDataPerProce
ssor; | |
49 SkSTArray<kPreAllocIndices, uint32_t, true> fIndices; | |
50 SkSTArray<kPreAllocStorage, unsigned char, true> fStorage; | |
51 | |
52 typedef SkRefCnt INHERITED; | |
53 }; | 14 }; |
54 | 15 |
55 #endif | 16 #endif |
OLD | NEW |