diff options
author | joshualitt <joshualitt@chromium.org> | 2016-02-10 11:55:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 11:55:52 -0800 |
commit | 923037724231f11b9249dbb5bf9688835b5ff9b0 (patch) | |
tree | 8c827edfa396d0116fb4069d2f29f5f2acf81d89 /src/gpu/text/GrTextBlobCache.cpp | |
parent | 60ae6b0e3299db06f53bf39f96df8a304583b043 (diff) |
Remove GrTextBlobCache/GrAtlasTextBlob friendliness
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686113002
Review URL: https://codereview.chromium.org/1686113002
Diffstat (limited to 'src/gpu/text/GrTextBlobCache.cpp')
-rw-r--r-- | src/gpu/text/GrTextBlobCache.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/gpu/text/GrTextBlobCache.cpp b/src/gpu/text/GrTextBlobCache.cpp index 7fa2d1a80a..ce74977e49 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()) { |