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

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

Issue 1713693002: Use unorm shorts for texture coordinates when rendering text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix tabbing Created 4 years, 10 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/text/GrAtlasTextBlob_regenInBatch.cpp ('k') | src/gpu/text/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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return this->getAtlas(format)->addToAtlas(id, target, width, height, ima ge, loc); 164 return this->getAtlas(format)->addToAtlas(id, target, width, height, ima ge, loc);
165 } 165 }
166 166
167 // Some clients may wish to verify the integrity of the texture backing stor e of the 167 // Some clients may wish to verify the integrity of the texture backing stor e of the
168 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr easing number which 168 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr easing number which
169 // changes everytime something is removed from the texture backing store. 169 // changes everytime something is removed from the texture backing store.
170 uint64_t atlasGeneration(GrMaskFormat format) const { 170 uint64_t atlasGeneration(GrMaskFormat format) const {
171 return this->getAtlas(format)->atlasGeneration(); 171 return this->getAtlas(format)->atlasGeneration();
172 } 172 }
173 173
174 int log2Width(GrMaskFormat format) { return fAtlasConfigs[format].fLog2Width ; }
175 int log2Height(GrMaskFormat format) { return fAtlasConfigs[format].fLog2Heig ht; }
176
174 /////////////////////////////////////////////////////////////////////////// 177 ///////////////////////////////////////////////////////////////////////////
175 // Functions intended debug only 178 // Functions intended debug only
176 void dump() const; 179 void dump() const;
177 180
178 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]); 181 void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]);
179 182
180 private: 183 private:
181 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) { 184 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) {
182 static const GrPixelConfig kPixelConfigs[] = { 185 static const GrPixelConfig kPixelConfigs[] = {
183 kAlpha_8_GrPixelConfig, 186 kAlpha_8_GrPixelConfig,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 static void HandleEviction(GrBatchAtlas::AtlasID, void*); 222 static void HandleEviction(GrBatchAtlas::AtlasID, void*);
220 223
221 GrContext* fContext; 224 GrContext* fContext;
222 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; 225 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache;
223 GrBatchAtlas* fAtlases[kMaskFormatCount]; 226 GrBatchAtlas* fAtlases[kMaskFormatCount];
224 GrBatchTextStrike* fPreserveStrike; 227 GrBatchTextStrike* fPreserveStrike;
225 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount]; 228 GrBatchAtlasConfig fAtlasConfigs[kMaskFormatCount];
226 }; 229 };
227 230
228 #endif 231 #endif
OLDNEW
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp ('k') | src/gpu/text/GrBatchFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698