OLD | NEW |
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 private: | 129 private: |
130 void initBatchTracker(const GrPipelineOptimizations& opt) override; | 130 void initBatchTracker(const GrPipelineOptimizations& opt) override; |
131 | 131 |
132 struct FlushInfo { | 132 struct FlushInfo { |
133 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 133 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
134 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 134 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
135 int fGlyphsToFlush; | 135 int fGlyphsToFlush; |
136 int fVertexOffset; | 136 int fVertexOffset; |
137 }; | 137 }; |
138 | 138 |
139 void onPrepareDraws(Target* target) override; | 139 void onPrepareDraws(Target* target) const override; |
140 | 140 |
141 GrAtlasTextBatch() : INHERITED(ClassID()) {} // initialized in factory funct
ions. | 141 GrAtlasTextBatch() : INHERITED(ClassID()) {} // initialized in factory funct
ions. |
142 | 142 |
143 ~GrAtlasTextBatch() { | 143 ~GrAtlasTextBatch() { |
144 for (int i = 0; i < fGeoCount; i++) { | 144 for (int i = 0; i < fGeoCount; i++) { |
145 fGeoData[i].fBlob->unref(); | 145 fGeoData[i].fBlob->unref(); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 GrMaskFormat maskFormat() const { | 149 GrMaskFormat maskFormat() const { |
(...skipping 18 matching lines...) Expand all Loading... |
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 template <bool regenTexCoords, bool regenPos, bool regenCol, bool regenGlyph
s> | 173 template <bool regenTexCoords, bool regenPos, bool regenCol, bool regenGlyph
s> |
174 inline void regenBlob(Target* target, FlushInfo* flushInfo, Blob* blob, Run*
run, | 174 inline void regenBlob(Target* target, FlushInfo* flushInfo, Blob* blob, Run*
run, |
175 TextInfo* info, SkGlyphCache** cache, | 175 TextInfo* info, SkGlyphCache** cache, |
176 SkTypeface** typeface, GrFontScaler** scaler, const Sk
Descriptor** desc, | 176 SkTypeface** typeface, GrFontScaler** scaler, const Sk
Descriptor** desc, |
177 const GrGeometryProcessor* gp, int glyphCount, size_t
vertexStride, | 177 const GrGeometryProcessor* gp, int glyphCount, size_t
vertexStride, |
178 GrColor color, SkScalar transX, SkScalar transY); | 178 GrColor color, SkScalar transX, SkScalar transY) const
; |
179 | 179 |
180 inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo); | 180 inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const
; |
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 |
189 // TODO just use class params | 189 // TODO just use class params |
190 // TODO trying to figure out why lcd is so whack | 190 // TODO trying to figure out why lcd is so whack |
191 GrGeometryProcessor* setupDfProcessor(const SkMatrix& viewMatrix, SkColor fi
lteredColor, | 191 GrGeometryProcessor* setupDfProcessor(const SkMatrix& viewMatrix, SkColor fi
lteredColor, |
192 GrColor color, GrTexture* texture); | 192 GrColor color, GrTexture* texture) con
st; |
193 | 193 |
194 struct BatchTracker { | 194 struct BatchTracker { |
195 GrColor fColor; | 195 GrColor fColor; |
196 SkMatrix fViewMatrix; | 196 SkMatrix fViewMatrix; |
197 bool fUsesLocalCoords; | 197 bool fUsesLocalCoords; |
198 bool fColorIgnored; | 198 bool fColorIgnored; |
199 bool fCoverageIgnored; | 199 bool fCoverageIgnored; |
200 int fNumGlyphs; | 200 int fNumGlyphs; |
201 }; | 201 }; |
202 | 202 |
(...skipping 15 matching lines...) Expand all Loading... |
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 |
OLD | NEW |