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

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

Issue 193163003: Enable use of distance fields via SkPaint flag. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change HACK to TEMP Created 6 years, 9 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 private: 58 private:
59 class Key; 59 class Key;
60 GrTHashTable<GrGlyph, Key, 7> fCache; 60 GrTHashTable<GrGlyph, Key, 7> fCache;
61 const GrKey* fFontScalerKey; 61 const GrKey* fFontScalerKey;
62 GrTAllocPool<GrGlyph> fPool; 62 GrTAllocPool<GrGlyph> fPool;
63 63
64 GrFontCache* fFontCache; 64 GrFontCache* fFontCache;
65 GrAtlasMgr* fAtlasMgr; 65 GrAtlasMgr* fAtlasMgr;
66 GrMaskFormat fMaskFormat; 66 GrMaskFormat fMaskFormat;
67 #if SK_DISTANCEFIELD_FONTS
68 bool fUseDistanceField; 67 bool fUseDistanceField;
69 #endif
70 68
71 GrAtlas fAtlas; 69 GrAtlas fAtlas;
72 70
73 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler); 71 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler);
74 72
75 friend class GrFontCache; 73 friend class GrFontCache;
76 }; 74 };
77 75
78 class GrFontCache { 76 class GrFontCache {
79 public: 77 public:
80 GrFontCache(GrGpu*); 78 GrFontCache(GrGpu*);
81 ~GrFontCache(); 79 ~GrFontCache();
82 80
83 #if SK_DISTANCEFIELD_FONTS
84 inline GrTextStrike* getStrike(GrFontScaler*, bool useDistanceField); 81 inline GrTextStrike* getStrike(GrFontScaler*, bool useDistanceField);
85 #else
86 inline GrTextStrike* getStrike(GrFontScaler*);
87 #endif
88 82
89 void freeAll(); 83 void freeAll();
90 84
91 // make an unused plot available 85 // make an unused plot available
92 bool freeUnusedPlot(GrTextStrike* preserveStrike); 86 bool freeUnusedPlot(GrTextStrike* preserveStrike);
93 87
94 // testing 88 // testing
95 int countStrikes() const { return fCache.getArray().count(); } 89 int countStrikes() const { return fCache.getArray().count(); }
96 const GrTextStrike* strikeAt(int index) const { 90 const GrTextStrike* strikeAt(int index) const {
97 return fCache.getArray()[index]; 91 return fCache.getArray()[index];
(...skipping 30 matching lines...) Expand all
128 122
129 GrGpu* fGpu; 123 GrGpu* fGpu;
130 GrAtlasMgr* fAtlasMgr[kAtlasCount]; 124 GrAtlasMgr* fAtlasMgr[kAtlasCount];
131 125
132 GrTextStrike* generateStrike(GrFontScaler*, const Key&); 126 GrTextStrike* generateStrike(GrFontScaler*, const Key&);
133 inline void detachStrikeFromList(GrTextStrike*); 127 inline void detachStrikeFromList(GrTextStrike*);
134 void purgeStrike(GrTextStrike* strike); 128 void purgeStrike(GrTextStrike* strike);
135 }; 129 };
136 130
137 #endif 131 #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