| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 private: | 131 private: |
| 132 void initBatchTracker(const GrXPOverridesForBatch& overrides) override; | 132 void initBatchTracker(const GrXPOverridesForBatch& overrides) override; |
| 133 | 133 |
| 134 struct FlushInfo { | 134 struct FlushInfo { |
| 135 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 135 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
| 136 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 136 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
| 137 int fGlyphsToFlush; | 137 int fGlyphsToFlush; |
| 138 int fVertexOffset; | 138 int fVertexOffset; |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 void onPrepareDraws(Target* target) override; | 141 void onPrepareDraws(Target* target) const override; |
| 142 | 142 |
| 143 GrAtlasTextBatch() : INHERITED(ClassID()) {} // initialized in factory funct
ions. | 143 GrAtlasTextBatch() : INHERITED(ClassID()) {} // initialized in factory funct
ions. |
| 144 | 144 |
| 145 ~GrAtlasTextBatch() { | 145 ~GrAtlasTextBatch() { |
| 146 for (int i = 0; i < fGeoCount; i++) { | 146 for (int i = 0; i < fGeoCount; i++) { |
| 147 fGeoData[i].fBlob->unref(); | 147 fGeoData[i].fBlob->unref(); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 GrMaskFormat maskFormat() const { | 151 GrMaskFormat maskFormat() const { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 170 bool isLCD() const { | 170 bool isLCD() const { |
| 171 return kLCDCoverageMask_MaskType == fMaskType || | 171 return kLCDCoverageMask_MaskType == fMaskType || |
| 172 kLCDDistanceField_MaskType == fMaskType; | 172 kLCDDistanceField_MaskType == fMaskType; |
| 173 } | 173 } |
| 174 | 174 |
| 175 template <bool regenTexCoords, bool regenPos, bool regenCol, bool regenGlyph
s> | 175 template <bool regenTexCoords, bool regenPos, bool regenCol, bool regenGlyph
s> |
| 176 inline void regenBlob(Target* target, FlushInfo* flushInfo, Blob* blob, Run*
run, | 176 inline void regenBlob(Target* target, FlushInfo* flushInfo, Blob* blob, Run*
run, |
| 177 TextInfo* info, SkGlyphCache** cache, | 177 TextInfo* info, SkGlyphCache** cache, |
| 178 SkTypeface** typeface, GrFontScaler** scaler, const Sk
Descriptor** desc, | 178 SkTypeface** typeface, GrFontScaler** scaler, const Sk
Descriptor** desc, |
| 179 const GrGeometryProcessor* gp, int glyphCount, size_t
vertexStride, | 179 const GrGeometryProcessor* gp, int glyphCount, size_t
vertexStride, |
| 180 GrColor color, SkScalar transX, SkScalar transY); | 180 GrColor color, SkScalar transX, SkScalar transY) const
; |
| 181 | 181 |
| 182 inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo); | 182 inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const
; |
| 183 | 183 |
| 184 GrColor color() const { return fBatch.fColor; } | 184 GrColor color() const { return fBatch.fColor; } |
| 185 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } | 185 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } |
| 186 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } | 186 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } |
| 187 int numGlyphs() const { return fBatch.fNumGlyphs; } | 187 int numGlyphs() const { return fBatch.fNumGlyphs; } |
| 188 | 188 |
| 189 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override; | 189 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override; |
| 190 | 190 |
| 191 // TODO just use class params | 191 // TODO just use class params |
| 192 // TODO trying to figure out why lcd is so whack | 192 // TODO trying to figure out why lcd is so whack |
| 193 GrGeometryProcessor* setupDfProcessor(const SkMatrix& viewMatrix, SkColor fi
lteredColor, | 193 GrGeometryProcessor* setupDfProcessor(const SkMatrix& viewMatrix, SkColor fi
lteredColor, |
| 194 GrColor color, GrTexture* texture); | 194 GrColor color, GrTexture* texture) con
st; |
| 195 | 195 |
| 196 struct BatchTracker { | 196 struct BatchTracker { |
| 197 GrColor fColor; | 197 GrColor fColor; |
| 198 SkMatrix fViewMatrix; | 198 SkMatrix fViewMatrix; |
| 199 bool fUsesLocalCoords; | 199 bool fUsesLocalCoords; |
| 200 bool fColorIgnored; | 200 bool fColorIgnored; |
| 201 bool fCoverageIgnored; | 201 bool fCoverageIgnored; |
| 202 int fNumGlyphs; | 202 int fNumGlyphs; |
| 203 }; | 203 }; |
| 204 | 204 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 220 GrBatchFontCache* fFontCache; | 220 GrBatchFontCache* fFontCache; |
| 221 | 221 |
| 222 // Distance field properties | 222 // Distance field properties |
| 223 SkAutoTUnref<const DistanceAdjustTable> fDistanceAdjustTable; | 223 SkAutoTUnref<const DistanceAdjustTable> fDistanceAdjustTable; |
| 224 SkColor fFilteredColor; | 224 SkColor fFilteredColor; |
| 225 | 225 |
| 226 typedef GrVertexBatch INHERITED; | 226 typedef GrVertexBatch INHERITED; |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 #endif | 229 #endif |
| OLD | NEW |