OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 }; | 221 }; |
222 | 222 |
223 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage, | 223 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage, |
224 const SkMatrix& viewMatrix, bool isHairline, | 224 const SkMatrix& viewMatrix, bool isHairline, |
225 const SkRect& devBounds) { | 225 const SkRect& devBounds) { |
226 return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline,
devBounds); | 226 return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline,
devBounds); |
227 } | 227 } |
228 | 228 |
229 const char* name() const override { return "DefaultPathBatch"; } | 229 const char* name() const override { return "DefaultPathBatch"; } |
230 | 230 |
231 void computePipelineOptimizations(GrInitInvariantOutput* color, | 231 void computePipelineOptimizations(GrInitInvariantOutput* color, |
232 GrInitInvariantOutput* coverage, | 232 GrInitInvariantOutput* coverage, |
233 GrBatchToXPOverrides* overrides) const ove
rride { | 233 GrBatchToXPOverrides* overrides) const ove
rride { |
234 // When this is called on a batch, there is only one geometry bundle | 234 // When this is called on a batch, there is only one geometry bundle |
235 color->setKnownFourComponents(fGeoData[0].fColor); | 235 color->setKnownFourComponents(fGeoData[0].fColor); |
236 coverage->setKnownSingleComponent(this->coverage()); | 236 coverage->setKnownSingleComponent(this->coverage()); |
237 } | 237 } |
238 | 238 |
239 private: | 239 private: |
240 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { | 240 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { |
241 // Handle any color overrides | 241 // Handle any color overrides |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 geometry.fColor = color; | 769 geometry.fColor = color; |
770 geometry.fPath = path; | 770 geometry.fPath = path; |
771 geometry.fTolerance = srcSpaceTol; | 771 geometry.fTolerance = srcSpaceTol; |
772 | 772 |
773 viewMatrix.mapRect(&bounds); | 773 viewMatrix.mapRect(&bounds); |
774 uint8_t coverage = GrRandomCoverage(random); | 774 uint8_t coverage = GrRandomCoverage(random); |
775 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 775 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
776 } | 776 } |
777 | 777 |
778 #endif | 778 #endif |
OLD | NEW |