Index: src/gpu/GrResourceProvider.cpp |
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp |
index 5e9177da115f5cf55997e5ecdc7d87ccc0ba8925..8fc3272ae2204715650cd45e664b5d56a1ff1399 100644 |
--- a/src/gpu/GrResourceProvider.cpp |
+++ b/src/gpu/GrResourceProvider.cpp |
@@ -26,7 +26,7 @@ |
const GrUniqueKey& key) { |
size_t bufferSize = patternSize * reps * sizeof(uint16_t); |
- GrIndexBuffer* buffer = this->getIndexBuffer(bufferSize, /* dynamic = */ false, true); |
+ GrIndexBuffer* buffer = this->gpu()->createIndexBuffer(bufferSize, /* dynamic = */ false); |
if (!buffer) { |
return NULL; |
} |
@@ -63,58 +63,3 @@ |
return this->createInstancedIndexBuffer(kPattern, 6, kMaxQuads, 4, fQuadIndexBufferKey); |
} |
-GrIndexBuffer* GrResourceProvider::getIndexBuffer(size_t size, bool dynamic, |
- bool calledDuringFlush) { |
- if (this->isAbandoned()) { |
- return NULL; |
- } |
- |
- if (dynamic) { |
- // bin by pow2 with a reasonable min |
- static const uint32_t MIN_SIZE = 1 << 12; |
- size = SkTMax(MIN_SIZE, GrNextPow2(SkToUInt(size))); |
- |
- GrScratchKey key; |
- GrIndexBuffer::ComputeScratchKey(size, dynamic, &key); |
- uint32_t scratchFlags = 0; |
- if (calledDuringFlush) { |
- scratchFlags = GrResourceCache::kRequireNoPendingIO_ScratchFlag; |
- } else { |
- scratchFlags = GrResourceCache::kPreferNoPendingIO_ScratchFlag; |
- } |
- GrGpuResource* resource = this->cache()->findAndRefScratchResource(key, scratchFlags); |
- if (resource) { |
- return static_cast<GrIndexBuffer*>(resource); |
- } |
- } |
- |
- return this->gpu()->createIndexBuffer(size, dynamic); |
-} |
- |
-GrVertexBuffer* GrResourceProvider::getVertexBuffer(size_t size, bool dynamic, |
- bool calledDuringFlush) { |
- if (this->isAbandoned()) { |
- return NULL; |
- } |
- |
- if (dynamic) { |
- // bin by pow2 with a reasonable min |
- static const uint32_t MIN_SIZE = 1 << 15; |
- size = SkTMax(MIN_SIZE, GrNextPow2(SkToUInt(size))); |
- |
- GrScratchKey key; |
- GrVertexBuffer::ComputeScratchKey(size, dynamic, &key); |
- uint32_t scratchFlags = 0; |
- if (calledDuringFlush) { |
- scratchFlags = GrResourceCache::kRequireNoPendingIO_ScratchFlag; |
- } else { |
- scratchFlags = GrResourceCache::kPreferNoPendingIO_ScratchFlag; |
- } |
- GrGpuResource* resource = this->cache()->findAndRefScratchResource(key, scratchFlags); |
- if (resource) { |
- return static_cast<GrVertexBuffer*>(resource); |
- } |
- } |
- |
- return this->gpu()->createVertexBuffer(size, dynamic); |
-} |