| 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); |
| 88 // We don't have tight bounds on the glyph paths in device space. For th
e purposes of bounds |
| 89 // we treat this as a set of non-AA rects rendered with a texture. |
| 90 this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo); |
| 88 } | 91 } |
| 89 | 92 |
| 90 const char* name() const override { return "TextBatch"; } | 93 const char* name() const override { return "TextBatch"; } |
| 91 | 94 |
| 92 SkString dumpInfo() const override; | 95 SkString dumpInfo() const override; |
| 93 | 96 |
| 94 protected: | 97 protected: |
| 95 void computePipelineOptimizations(GrInitInvariantOutput* color, | 98 void computePipelineOptimizations(GrInitInvariantOutput* color, |
| 96 GrInitInvariantOutput* coverage, | 99 GrInitInvariantOutput* coverage, |
| 97 GrBatchToXPOverrides* overrides) const ove
rride; | 100 GrBatchToXPOverrides* overrides) const ove
rride; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 fFlushInfo->fGlyphsToFlush += glyphCount; | 213 fFlushInfo->fGlyphsToFlush += glyphCount; |
| 211 } | 214 } |
| 212 | 215 |
| 213 private: | 216 private: |
| 214 const GrAtlasTextBatch* fBatch; | 217 const GrAtlasTextBatch* fBatch; |
| 215 GrVertexBatch::Target* fTarget; | 218 GrVertexBatch::Target* fTarget; |
| 216 GrAtlasTextBatch::FlushInfo* fFlushInfo; | 219 GrAtlasTextBatch::FlushInfo* fFlushInfo; |
| 217 }; | 220 }; |
| 218 | 221 |
| 219 #endif | 222 #endif |
| OLD | NEW |