| Index: src/gpu/GrProcessor.cpp
|
| diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
|
| index 9977018191578879f56aa9b70dd36ca4b05a8630..57bce1ca9e98c0bdc9237056e068bfdfaa5c905c 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);
|
| +}
|
|
|