OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "GrAADistanceFieldPathRenderer.h" | 8 #include "GrAADistanceFieldPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 SkASSERT(shape.hasUnstyledKey()); | 139 SkASSERT(shape.hasUnstyledKey()); |
140 fBatch.fViewMatrix = viewMatrix; | 140 fBatch.fViewMatrix = viewMatrix; |
141 fGeoData.emplace_back(Geometry{color, shape, antiAlias}); | 141 fGeoData.emplace_back(Geometry{color, shape, antiAlias}); |
142 | 142 |
143 fAtlas = atlas; | 143 fAtlas = atlas; |
144 fShapeCache = shapeCache; | 144 fShapeCache = shapeCache; |
145 fShapeList = shapeList; | 145 fShapeList = shapeList; |
146 fGammaCorrect = gammaCorrect; | 146 fGammaCorrect = gammaCorrect; |
147 | 147 |
148 // Compute bounds | 148 // Compute bounds |
149 fBounds = shape.bounds(); | 149 this->setTransformedBounds(shape.bounds(), viewMatrix, HasAABloat::kYes,
IsZeroArea::kNo); |
150 viewMatrix.mapRect(&fBounds); | |
151 } | 150 } |
152 | 151 |
153 const char* name() const override { return "AADistanceFieldPathBatch"; } | 152 const char* name() const override { return "AADistanceFieldPathBatch"; } |
154 | 153 |
155 void computePipelineOptimizations(GrInitInvariantOutput* color, | 154 void computePipelineOptimizations(GrInitInvariantOutput* color, |
156 GrInitInvariantOutput* coverage, | 155 GrInitInvariantOutput* coverage, |
157 GrBatchToXPOverrides* overrides) const ove
rride { | 156 GrBatchToXPOverrides* overrides) const ove
rride { |
158 color->setKnownFourComponents(fGeoData[0].fColor); | 157 color->setKnownFourComponents(fGeoData[0].fColor); |
159 coverage->setUnknownSingleComponent(); | 158 coverage->setUnknownSingleComponent(); |
160 } | 159 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 that->bounds(), caps)) { | 476 that->bounds(), caps)) { |
478 return false; | 477 return false; |
479 } | 478 } |
480 | 479 |
481 // TODO We can position on the cpu | 480 // TODO We can position on the cpu |
482 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) { | 481 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) { |
483 return false; | 482 return false; |
484 } | 483 } |
485 | 484 |
486 fGeoData.push_back_n(that->fGeoData.count(), that->fGeoData.begin()); | 485 fGeoData.push_back_n(that->fGeoData.count(), that->fGeoData.begin()); |
487 this->joinBounds(that->bounds()); | 486 this->joinBounds(*that); |
488 return true; | 487 return true; |
489 } | 488 } |
490 | 489 |
491 struct BatchTracker { | 490 struct BatchTracker { |
492 SkMatrix fViewMatrix; | 491 SkMatrix fViewMatrix; |
493 bool fUsesLocalCoords; | 492 bool fUsesLocalCoords; |
494 bool fColorIgnored; | 493 bool fColorIgnored; |
495 bool fCoverageIgnored; | 494 bool fCoverageIgnored; |
496 }; | 495 }; |
497 | 496 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 shape, | 616 shape, |
618 antiAlias, | 617 antiAlias, |
619 viewMatrix, | 618 viewMatrix, |
620 gTestStruct.fAtlas, | 619 gTestStruct.fAtlas, |
621 &gTestStruct.fShapeCache, | 620 &gTestStruct.fShapeCache, |
622 &gTestStruct.fShapeList, | 621 &gTestStruct.fShapeList, |
623 gammaCorrect); | 622 gammaCorrect); |
624 } | 623 } |
625 | 624 |
626 #endif | 625 #endif |
OLD | NEW |