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

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

Issue 41213003: Hook in rough distance field support for fonts (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Replace magic number 32 with constant; fix comment in shader; fix Linux compiler error. Created 7 years, 1 month 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 | Annotate | Revision Log
« 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 GrTextStrike* fNext; 54 GrTextStrike* fNext;
55 55
56 private: 56 private:
57 class Key; 57 class Key;
58 GrTHashTable<GrGlyph, Key, 7> fCache; 58 GrTHashTable<GrGlyph, Key, 7> fCache;
59 const GrKey* fFontScalerKey; 59 const GrKey* fFontScalerKey;
60 GrTAllocPool<GrGlyph> fPool; 60 GrTAllocPool<GrGlyph> fPool;
61 61
62 GrFontCache* fFontCache; 62 GrFontCache* fFontCache;
63 GrAtlasMgr* fAtlasMgr; 63 GrAtlasMgr* fAtlasMgr;
64 GrMaskFormat fMaskFormat;
65 #if SK_DISTANCEFIELD_FONTS
66 bool fUseDistanceField;
67 #endif
68
64 GrAtlas fAtlas; 69 GrAtlas fAtlas;
65 70
66 GrMaskFormat fMaskFormat;
67
68 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler); 71 GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler);
69 72
70 friend class GrFontCache; 73 friend class GrFontCache;
71 }; 74 };
72 75
73 class GrFontCache { 76 class GrFontCache {
74 public: 77 public:
75 GrFontCache(GrGpu*); 78 GrFontCache(GrGpu*);
76 ~GrFontCache(); 79 ~GrFontCache();
77 80
81 #if SK_DISTANCEFIELD_FONTS
82 inline GrTextStrike* getStrike(GrFontScaler*, bool useDistanceField);
83 #else
78 inline GrTextStrike* getStrike(GrFontScaler*); 84 inline GrTextStrike* getStrike(GrFontScaler*);
85 #endif
79 86
80 void freeAll(); 87 void freeAll();
81 88
82 void purgeExceptFor(GrTextStrike*); 89 void purgeExceptFor(GrTextStrike*);
83 90
84 // remove an unused plot and its strike (if necessary) 91 // remove an unused plot and its strike (if necessary)
85 void freePlotExceptFor(GrTextStrike*); 92 void freePlotExceptFor(GrTextStrike*);
86 93
87 // testing 94 // testing
88 int countStrikes() const { return fCache.getArray().count(); } 95 int countStrikes() const { return fCache.getArray().count(); }
(...skipping 23 matching lines...) Expand all
112 119
113 GrGpu* fGpu; 120 GrGpu* fGpu;
114 GrAtlasMgr* fAtlasMgr[kMaskFormatCount]; 121 GrAtlasMgr* fAtlasMgr[kMaskFormatCount];
115 122
116 GrTextStrike* generateStrike(GrFontScaler*, const Key&); 123 GrTextStrike* generateStrike(GrFontScaler*, const Key&);
117 inline void detachStrikeFromList(GrTextStrike*); 124 inline void detachStrikeFromList(GrTextStrike*);
118 void purgeStrike(GrTextStrike* strike); 125 void purgeStrike(GrTextStrike* strike);
119 }; 126 };
120 127
121 #endif 128 #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