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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 } | 75 } |
76 | 76 |
77 // to avoid even the initial copy of the struct, we have a getter for the fi rst item which | 77 // to avoid even the initial copy of the struct, we have a getter for the fi rst item which |
78 // is used to seed the batch with its initial geometry. After seeding, the client should call | 78 // is used to seed the batch with its initial geometry. After seeding, the client should call |
79 // init() so the Batch can initialize itself | 79 // init() so the Batch can initialize itself |
80 Geometry& geometry() { return fGeoData[0]; } | 80 Geometry& geometry() { return fGeoData[0]; } |
81 | 81 |
82 void init() { | 82 void init() { |
83 const Geometry& geo = fGeoData[0]; | 83 const Geometry& geo = fGeoData[0]; |
84 fBatch.fColor = geo.fColor; | 84 fBatch.fColor = geo.fColor; |
85 | 85 SkRect bounds; |
86 geo.fBlob->computeSubRunBounds(&fBounds, geo.fRun, geo.fSubRun, geo.fVie wMatrix, geo.fX, | 86 geo.fBlob->computeSubRunBounds(&bounds, geo.fRun, geo.fSubRun, geo.fView Matrix, geo.fX, |
87 geo.fY); | 87 geo.fY); |
robertphillips
2016/07/07 20:26:42
// The AA of the text is contained in the atlased
bsalomon
2016/07/07 23:40:57
Done.
| |
88 this->setBounds(bounds, HasAABloat ::kNo, IsZeroArea::kNo); | |
88 } | 89 } |
89 | 90 |
90 const char* name() const override { return "TextBatch"; } | 91 const char* name() const override { return "TextBatch"; } |
91 | 92 |
92 SkString dumpInfo() const override; | 93 SkString dumpInfo() const override; |
93 | 94 |
94 protected: | 95 protected: |
95 void computePipelineOptimizations(GrInitInvariantOutput* color, | 96 void computePipelineOptimizations(GrInitInvariantOutput* color, |
96 GrInitInvariantOutput* coverage, | 97 GrInitInvariantOutput* coverage, |
97 GrBatchToXPOverrides* overrides) const ove rride; | 98 GrBatchToXPOverrides* overrides) const ove rride; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 fFlushInfo->fGlyphsToFlush += glyphCount; | 211 fFlushInfo->fGlyphsToFlush += glyphCount; |
211 } | 212 } |
212 | 213 |
213 private: | 214 private: |
214 const GrAtlasTextBatch* fBatch; | 215 const GrAtlasTextBatch* fBatch; |
215 GrVertexBatch::Target* fTarget; | 216 GrVertexBatch::Target* fTarget; |
216 GrAtlasTextBatch::FlushInfo* fFlushInfo; | 217 GrAtlasTextBatch::FlushInfo* fFlushInfo; |
217 }; | 218 }; |
218 | 219 |
219 #endif | 220 #endif |
OLD | NEW |