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/GrTextStrike.h

Issue 585853003: Don't try to add large glyphs to the font atlas. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comments Created 6 years, 3 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/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrTextStrike.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 19 matching lines...) Expand all
30 public: 30 public:
31 GrTextStrike(GrFontCache*, const GrFontDescKey* fontScalerKey, GrMaskFormat, GrAtlas*); 31 GrTextStrike(GrFontCache*, const GrFontDescKey* fontScalerKey, GrMaskFormat, GrAtlas*);
32 ~GrTextStrike(); 32 ~GrTextStrike();
33 33
34 const GrFontDescKey* getFontScalerKey() const { return fFontScalerKey; } 34 const GrFontDescKey* getFontScalerKey() const { return fFontScalerKey; }
35 GrFontCache* getFontCache() const { return fFontCache; } 35 GrFontCache* getFontCache() const { return fFontCache; }
36 GrMaskFormat getMaskFormat() const { return fMaskFormat; } 36 GrMaskFormat getMaskFormat() const { return fMaskFormat; }
37 GrTexture* getTexture() const { return fAtlas->getTexture(); } 37 GrTexture* getTexture() const { return fAtlas->getTexture(); }
38 38
39 inline GrGlyph* getGlyph(GrGlyph::PackedID, GrFontScaler*); 39 inline GrGlyph* getGlyph(GrGlyph::PackedID, GrFontScaler*);
40 // returns true if glyph (or glyph+padding for distance field)
41 // is too large to ever fit in texture atlas subregions (GrPlots)
42 bool glyphTooLargeForAtlas(GrGlyph*);
43 // returns true if glyph successfully added to texture atlas, false otherwis e
40 bool addGlyphToAtlas(GrGlyph*, GrFontScaler*); 44 bool addGlyphToAtlas(GrGlyph*, GrFontScaler*);
41 45
42 // testing 46 // testing
43 int countGlyphs() const { return fCache.count(); } 47 int countGlyphs() const { return fCache.count(); }
44 48
45 // remove any references to this plot 49 // remove any references to this plot
46 void removePlot(const GrPlot* plot); 50 void removePlot(const GrPlot* plot);
47 51
48 static const GrFontDescKey& GetKey(const GrTextStrike& ts) { 52 static const GrFontDescKey& GetKey(const GrTextStrike& ts) {
49 return *(ts.fFontScalerKey); 53 return *(ts.fFontScalerKey);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 129
126 GrGpu* fGpu; 130 GrGpu* fGpu;
127 GrAtlas* fAtlases[kAtlasCount]; 131 GrAtlas* fAtlases[kAtlasCount];
128 132
129 GrTextStrike* generateStrike(GrFontScaler*); 133 GrTextStrike* generateStrike(GrFontScaler*);
130 inline void detachStrikeFromList(GrTextStrike*); 134 inline void detachStrikeFromList(GrTextStrike*);
131 void purgeStrike(GrTextStrike* strike); 135 void purgeStrike(GrTextStrike* strike);
132 }; 136 };
133 137
134 #endif 138 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698