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

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

Issue 1269743003: Dont try to draw glyphs with unexpected mask formats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 4 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/GrBatchFontCache.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 GrBatchFontCache_DEFINED 8 #ifndef GrBatchFontCache_DEFINED
9 #define GrBatchFontCache_DEFINED 9 #define GrBatchFontCache_DEFINED
10 10
(...skipping 22 matching lines...) Expand all
33 33
34 inline GrGlyph* getGlyph(const SkGlyph& skGlyph, GrGlyph::PackedID packed, 34 inline GrGlyph* getGlyph(const SkGlyph& skGlyph, GrGlyph::PackedID packed,
35 GrFontScaler* scaler) { 35 GrFontScaler* scaler) {
36 GrGlyph* glyph = fCache.find(packed); 36 GrGlyph* glyph = fCache.find(packed);
37 if (NULL == glyph) { 37 if (NULL == glyph) {
38 glyph = this->generateGlyph(skGlyph, packed, scaler); 38 glyph = this->generateGlyph(skGlyph, packed, scaler);
39 } 39 }
40 return glyph; 40 return glyph;
41 } 41 }
42 42
43 // returns true if glyph successfully added to texture atlas, false otherwis e 43 // returns true if glyph successfully added to texture atlas, false otherwis e. If the glyph's
44 bool addGlyphToAtlas(GrBatchTarget*, GrGlyph*, GrFontScaler*, const SkGlyph& ); 44 // mask format has changed, then addGlyphToAtlas will draw a clear box. Thi s will almost never
45 // happen.
46 // TODO we can handle some of these cases if we really want to, but the long term solution is to
47 // get the actual glyph image itself when we get the glyph metrics.
48 bool addGlyphToAtlas(GrBatchTarget*, GrGlyph*, GrFontScaler*, const SkGlyph& ,
49 GrMaskFormat expectedMaskFormat);
45 50
46 // testing 51 // testing
47 int countGlyphs() const { return fCache.count(); } 52 int countGlyphs() const { return fCache.count(); }
48 53
49 // remove any references to this plot 54 // remove any references to this plot
50 void removeID(GrBatchAtlas::AtlasID); 55 void removeID(GrBatchAtlas::AtlasID);
51 56
52 // If a TextStrike is abandoned by the cache, then the caller must get a new strike 57 // If a TextStrike is abandoned by the cache, then the caller must get a new strike
53 bool isAbandoned() const { return fIsAbandoned; } 58 bool isAbandoned() const { return fIsAbandoned; }
54 59
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 196
192 static void HandleEviction(GrBatchAtlas::AtlasID, void*); 197 static void HandleEviction(GrBatchAtlas::AtlasID, void*);
193 198
194 GrContext* fContext; 199 GrContext* fContext;
195 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; 200 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache;
196 GrBatchAtlas* fAtlases[kMaskFormatCount]; 201 GrBatchAtlas* fAtlases[kMaskFormatCount];
197 GrBatchTextStrike* fPreserveStrike; 202 GrBatchTextStrike* fPreserveStrike;
198 }; 203 };
199 204
200 #endif 205 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698