Index: src/gpu/GrProcessor.cpp |
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp |
index 44c8bf1957a0f18927ad973bc080f7ea26ddcae1..a1d063915fd2a600fd57bc7298e231deb657ba5a 100644 |
--- a/src/gpu/GrProcessor.cpp |
+++ b/src/gpu/GrProcessor.cpp |
@@ -8,7 +8,6 @@ |
#include "GrProcessor.h" |
#include "GrContext.h" |
#include "GrCoordTransform.h" |
-#include "GrGeometryData.h" |
#include "GrGeometryProcessor.h" |
#include "GrInvariantOutput.h" |
#include "GrMemoryPool.h" |
@@ -172,19 +171,38 @@ void GrFragmentProcessor::computeInvariantOutput(GrInvariantOutput* inout) const |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
-/* |
- * GrGeometryData shares the same pool so it lives in this file too |
- */ |
-void* GrGeometryData::operator new(size_t size) { |
- return GrProcessor_Globals::GetTLS()->allocate(size); |
-} |
+// Initial static variable from GrXPFactory |
+int32_t GrXPFactory::gCurrXPFClassID = |
+ GrXPFactory::kIllegalXPFClassID; |
-void GrGeometryData::operator delete(void* target) { |
- GrProcessor_Globals::GetTLS()->release(target); |
-} |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
+#include "GrBatch.h" |
+// TODO this just lives here to use the memory pool, we should move all the memory pool stuff to |
+// a separate file |
+class GrBatch_Globals { |
+public: |
+ static GrMemoryPool* GetTLS() { |
+ return (GrMemoryPool*)SkTLS::Get(CreateTLS, DeleteTLS); |
+ } |
-// Initial static variable from GrXPFactory |
-int32_t GrXPFactory::gCurrXPFClassID = |
- GrXPFactory::kIllegalXPFClassID; |
+private: |
+ static void* CreateTLS() { |
+ return SkNEW_ARGS(GrMemoryPool, (4096, 4096)); |
+ } |
+ |
+ static void DeleteTLS(void* pool) { |
+ SkDELETE(reinterpret_cast<GrMemoryPool*>(pool)); |
+ } |
+}; |
+ |
+int32_t GrBatch::gCurrBatchClassID = |
+ GrBatch::kIllegalBatchClassID; |
+ |
+void* GrBatch::operator new(size_t size) { |
+ return GrBatch_Globals::GetTLS()->allocate(size); |
+} |
+ |
+void GrBatch::operator delete(void* target) { |
+ GrBatch_Globals::GetTLS()->release(target); |
+} |