Index: src/gpu/text/GrTextBlobCache.cpp |
diff --git a/src/gpu/text/GrTextBlobCache.cpp b/src/gpu/text/GrTextBlobCache.cpp |
index 7fa2d1a80a14b3721e20bb6c82e29c311b86d0eb..ce74977e49fa1b65628706f216acf8a337b2a9a3 100644 |
--- a/src/gpu/text/GrTextBlobCache.cpp |
+++ b/src/gpu/text/GrTextBlobCache.cpp |
@@ -7,43 +7,10 @@ |
#include "GrTextBlobCache.h" |
-static const int kVerticesPerGlyph = 4; |
- |
GrTextBlobCache::~GrTextBlobCache() { |
this->freeAll(); |
} |
-GrAtlasTextBlob* GrTextBlobCache::createBlob(int glyphCount, int runCount, size_t maxVASize) { |
- // We allocate size for the GrAtlasTextBlob itself, plus size for the vertices array, |
- // and size for the glyphIds array. |
- size_t verticesCount = glyphCount * kVerticesPerGlyph * maxVASize; |
- size_t size = sizeof(GrAtlasTextBlob) + |
- verticesCount + |
- glyphCount * sizeof(GrGlyph**) + |
- sizeof(GrAtlasTextBlob::Run) * runCount; |
- |
- void* allocation = fPool.allocate(size); |
- if (CACHE_SANITY_CHECK) { |
- sk_bzero(allocation, size); |
- } |
- |
- GrAtlasTextBlob* cacheBlob = new (allocation) GrAtlasTextBlob; |
- cacheBlob->fSize = size; |
- |
- // setup offsets for vertices / glyphs |
- cacheBlob->fVertices = sizeof(GrAtlasTextBlob) + reinterpret_cast<unsigned char*>(cacheBlob); |
- cacheBlob->fGlyphs = reinterpret_cast<GrGlyph**>(cacheBlob->fVertices + verticesCount); |
- cacheBlob->fRuns = reinterpret_cast<GrAtlasTextBlob::Run*>(cacheBlob->fGlyphs + glyphCount); |
- |
- // Initialize runs |
- for (int i = 0; i < runCount; i++) { |
- new (&cacheBlob->fRuns[i]) GrAtlasTextBlob::Run; |
- } |
- cacheBlob->fRunCount = runCount; |
- cacheBlob->fPool = &fPool; |
- return cacheBlob; |
-} |
- |
void GrTextBlobCache::freeAll() { |
SkTDynamicHash<GrAtlasTextBlob, GrAtlasTextBlob::Key>::Iter iter(&fCache); |
while (!iter.done()) { |