Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1078)

Side by Side Diff: src/gpu/GrTextBlobCache.cpp

Issue 1065293003: Start caching masks / stroke fills for textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@textblobloopergm
Patch Set: tweak Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/gpu/GrAtlasTextContext.h ('K') | « src/gpu/GrTextBlobCache.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrTextBlobCache.h" 8 #include "GrTextBlobCache.h"
9 9
10 static const int kVerticesPerGlyph = 4; 10 static const int kVerticesPerGlyph = 4;
11 11
12 GrTextBlobCache::~GrTextBlobCache() { 12 GrTextBlobCache::~GrTextBlobCache() {
13 SkTDynamicHash<BitmapTextBlob, uint32_t>::Iter iter(&fCache); 13 SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key>::Iter iter(&fCache);
14 while (!iter.done()) { 14 while (!iter.done()) {
15 (&(*iter))->unref(); 15 (&(*iter))->unref();
16 ++iter; 16 ++iter;
17 } 17 }
18 } 18 }
19 19
20 GrAtlasTextContext::BitmapTextBlob* GrTextBlobCache::createBlob(int glyphCount, int runCount, 20 GrAtlasTextContext::BitmapTextBlob* GrTextBlobCache::createBlob(int glyphCount, int runCount,
21 size_t maxVASize ) { 21 size_t maxVASize ) {
22 // We allocate size for the BitmapTextBlob itself, plus size for the vertice s array, 22 // We allocate size for the BitmapTextBlob itself, plus size for the vertice s array,
23 // and size for the glyphIds array. 23 // and size for the glyphIds array.
(...skipping 12 matching lines...) Expand all
36 cacheBlob->fRuns = reinterpret_cast<BitmapTextBlob::Run*>(cacheBlob->fGlyphI Ds + glyphCount); 36 cacheBlob->fRuns = reinterpret_cast<BitmapTextBlob::Run*>(cacheBlob->fGlyphI Ds + glyphCount);
37 37
38 // Initialize runs 38 // Initialize runs
39 for (int i = 0; i < runCount; i++) { 39 for (int i = 0; i < runCount; i++) {
40 SkNEW_PLACEMENT(&cacheBlob->fRuns[i], BitmapTextBlob::Run); 40 SkNEW_PLACEMENT(&cacheBlob->fRuns[i], BitmapTextBlob::Run);
41 } 41 }
42 cacheBlob->fRunCount = runCount; 42 cacheBlob->fRunCount = runCount;
43 cacheBlob->fPool = &fPool; 43 cacheBlob->fPool = &fPool;
44 return cacheBlob; 44 return cacheBlob;
45 } 45 }
OLDNEW
« src/gpu/GrAtlasTextContext.h ('K') | « src/gpu/GrTextBlobCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698