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

Side by Side Diff: src/gpu/batches/GrAtlasTextBatch.h

Issue 1466333003: Move GrAtlasTextBatch blob regeneration to template (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add inline qualifier Created 5 years 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 | « no previous file | src/gpu/batches/GrAtlasTextBatch.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 GrAtlasTextBatch_DEFINED 8 #ifndef GrAtlasTextBatch_DEFINED
9 #define GrAtlasTextBatch_DEFINED 9 #define GrAtlasTextBatch_DEFINED
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 bool usesDistanceFields() const { 163 bool usesDistanceFields() const {
164 return kGrayscaleDistanceField_MaskType == fMaskType || 164 return kGrayscaleDistanceField_MaskType == fMaskType ||
165 kLCDDistanceField_MaskType == fMaskType; 165 kLCDDistanceField_MaskType == fMaskType;
166 } 166 }
167 167
168 bool isLCD() const { 168 bool isLCD() const {
169 return kLCDCoverageMask_MaskType == fMaskType || 169 return kLCDCoverageMask_MaskType == fMaskType ||
170 kLCDDistanceField_MaskType == fMaskType; 170 kLCDDistanceField_MaskType == fMaskType;
171 } 171 }
172 172
173 inline void regenerateTextureCoords(GrGlyph* glyph, intptr_t vertex, size_t vertexStride); 173 template <bool regenTexCoords, bool regenPos, bool regenCol, bool regenGlyph s>
174 174 inline void regenBlob(Target* target, FlushInfo* flushInfo, Blob* blob, Run* run,
175 inline void regenerateColors(intptr_t vertex, size_t vertexStride, GrColor c olor); 175 TextInfo* info, SkGlyphCache** cache,
176 176 SkTypeface** typeface, GrFontScaler** scaler, const Sk Descriptor** desc,
177 inline void regeneratePositions(intptr_t vertex, size_t vertexStride, SkScal ar transX, 177 const GrGeometryProcessor* gp, int glyphCount, size_t vertexStride,
178 SkScalar transY); 178 GrColor color, SkScalar transX, SkScalar transY);
179 179
180 inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo); 180 inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo);
181 181
182 GrColor color() const { return fBatch.fColor; } 182 GrColor color() const { return fBatch.fColor; }
183 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } 183 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
184 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 184 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
185 int numGlyphs() const { return fBatch.fNumGlyphs; } 185 int numGlyphs() const { return fBatch.fNumGlyphs; }
186 186
187 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override; 187 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override;
188 188
(...skipping 29 matching lines...) Expand all
218 GrBatchFontCache* fFontCache; 218 GrBatchFontCache* fFontCache;
219 219
220 // Distance field properties 220 // Distance field properties
221 SkAutoTUnref<const DistanceAdjustTable> fDistanceAdjustTable; 221 SkAutoTUnref<const DistanceAdjustTable> fDistanceAdjustTable;
222 SkColor fFilteredColor; 222 SkColor fFilteredColor;
223 223
224 typedef GrVertexBatch INHERITED; 224 typedef GrVertexBatch INHERITED;
225 }; 225 };
226 226
227 #endif 227 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698