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

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

Issue 1244093004: Remove some fields from BitmapTextBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: friendship Created 5 years, 5 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return this->getAtlas(format)->addToAtlas(id, batchTarget, width, height , image, loc); 140 return this->getAtlas(format)->addToAtlas(id, batchTarget, width, height , image, loc);
141 } 141 }
142 142
143 // Some clients may wish to verify the integrity of the texture backing stor e of the 143 // Some clients may wish to verify the integrity of the texture backing stor e of the
144 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr easing number which 144 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr easing number which
145 // changes everytime something is removed from the texture backing store. 145 // changes everytime something is removed from the texture backing store.
146 uint64_t atlasGeneration(GrMaskFormat format) const { 146 uint64_t atlasGeneration(GrMaskFormat format) const {
147 return this->getAtlas(format)->atlasGeneration(); 147 return this->getAtlas(format)->atlasGeneration();
148 } 148 }
149 149
150 GrPixelConfig getPixelConfig(GrMaskFormat) const;
151
152 void dump() const; 150 void dump() const;
153 151
154 private: 152 private:
153 static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) {
154 static const GrPixelConfig kPixelConfigs[] = {
155 kAlpha_8_GrPixelConfig,
156 kRGB_565_GrPixelConfig,
157 kSkia8888_GrPixelConfig
158 };
159 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kPixelConfigs) == kMaskFormatCount, arr ay_size_mismatch);
160
161 return kPixelConfigs[format];
162 }
163
155 // There is a 1:1 mapping between GrMaskFormats and atlas indices 164 // There is a 1:1 mapping between GrMaskFormats and atlas indices
156 static int MaskFormatToAtlasIndex(GrMaskFormat format) { 165 static int MaskFormatToAtlasIndex(GrMaskFormat format) {
157 static const int sAtlasIndices[] = { 166 static const int sAtlasIndices[] = {
158 kA8_GrMaskFormat, 167 kA8_GrMaskFormat,
159 kA565_GrMaskFormat, 168 kA565_GrMaskFormat,
160 kARGB_GrMaskFormat, 169 kARGB_GrMaskFormat,
161 }; 170 };
162 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sAtlasIndices) == kMaskFormatCount, arr ay_size_mismatch); 171 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sAtlasIndices) == kMaskFormatCount, arr ay_size_mismatch);
163 172
164 SkASSERT(sAtlasIndices[format] < kMaskFormatCount); 173 SkASSERT(sAtlasIndices[format] < kMaskFormatCount);
(...skipping 16 matching lines...) Expand all
181 190
182 static void HandleEviction(GrBatchAtlas::AtlasID, void*); 191 static void HandleEviction(GrBatchAtlas::AtlasID, void*);
183 192
184 GrContext* fContext; 193 GrContext* fContext;
185 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; 194 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache;
186 GrBatchAtlas* fAtlases[kMaskFormatCount]; 195 GrBatchAtlas* fAtlases[kMaskFormatCount];
187 GrBatchTextStrike* fPreserveStrike; 196 GrBatchTextStrike* fPreserveStrike;
188 }; 197 };
189 198
190 #endif 199 #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