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

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

Issue 1062863002: Avoid regenerating cached textblobs on integer scrolls (Closed) Base URL: https://skia.googlesource.com/skia.git@atlastextcache
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
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrTextBlobCache.cpp » ('j') | 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 #ifndef GrTextBlobCache_DEFINED 8 #ifndef GrTextBlobCache_DEFINED
9 #define GrTextBlobCache_DEFINED 9 #define GrTextBlobCache_DEFINED
10 10
(...skipping 14 matching lines...) Expand all
25 GrTextBlobCache(PFOverBudgetCB cb, void* data) 25 GrTextBlobCache(PFOverBudgetCB cb, void* data)
26 : fPool(kPreAllocSize, kMinGrowthSize) 26 : fPool(kPreAllocSize, kMinGrowthSize)
27 , fCallback(cb) 27 , fCallback(cb)
28 , fData(data) { 28 , fData(data) {
29 SkASSERT(cb && data); 29 SkASSERT(cb && data);
30 } 30 }
31 ~GrTextBlobCache(); 31 ~GrTextBlobCache();
32 32
33 // creates an uncached blob 33 // creates an uncached blob
34 BitmapTextBlob* createBlob(int glyphCount, int runCount, size_t maxVASize); 34 BitmapTextBlob* createBlob(int glyphCount, int runCount, size_t maxVASize);
35 BitmapTextBlob* createBlob(const SkTextBlob* blob, size_t maxVAStride) {
36 int glyphCount = 0;
37 int runCount = 0;
38 BlobGlyphCount(&glyphCount, &runCount, blob);
39 BitmapTextBlob* cacheBlob = this->createBlob(glyphCount, runCount, maxVA Stride);
40 return cacheBlob;
41 }
35 42
36 BitmapTextBlob* createCachedBlob(const SkTextBlob* blob, size_t maxVAStride) { 43 BitmapTextBlob* createCachedBlob(const SkTextBlob* blob, size_t maxVAStride) {
37 int glyphCount = 0; 44 int glyphCount = 0;
38 int runCount = 0; 45 int runCount = 0;
39 BlobGlyphCount(&glyphCount, &runCount, blob); 46 BlobGlyphCount(&glyphCount, &runCount, blob);
40 BitmapTextBlob* cacheBlob = this->createBlob(glyphCount, runCount, maxVA Stride); 47 BitmapTextBlob* cacheBlob = this->createBlob(glyphCount, runCount, maxVA Stride);
41 cacheBlob->fUniqueID = blob->uniqueID(); 48 cacheBlob->fUniqueID = blob->uniqueID();
42 this->add(cacheBlob); 49 this->add(cacheBlob);
43 return cacheBlob; 50 return cacheBlob;
44 } 51 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 static const int kMinGrowthSize = 1 << 17; 120 static const int kMinGrowthSize = 1 << 17;
114 static const int kBudget = 1 << 22; 121 static const int kBudget = 1 << 22;
115 BitmapBlobList fBlobList; 122 BitmapBlobList fBlobList;
116 SkTDynamicHash<BitmapTextBlob, uint32_t> fCache; 123 SkTDynamicHash<BitmapTextBlob, uint32_t> fCache;
117 GrMemoryPool fPool; 124 GrMemoryPool fPool;
118 PFOverBudgetCB fCallback; 125 PFOverBudgetCB fCallback;
119 void* fData; 126 void* fData;
120 }; 127 };
121 128
122 #endif 129 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrTextBlobCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698