| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 public: | 213 public: |
| 214 struct Geometry { | 214 struct Geometry { |
| 215 GrColor fColor; | 215 GrColor fColor; |
| 216 SkPath fPath; | 216 SkPath fPath; |
| 217 SkScalar fTolerance; | 217 SkScalar fTolerance; |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage, | 220 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage, |
| 221 const SkMatrix& viewMatrix, bool isHairline, | 221 const SkMatrix& viewMatrix, bool isHairline, |
| 222 const SkRect& devBounds) { | 222 const SkRect& devBounds) { |
| 223 return SkNEW_ARGS(DefaultPathBatch, (geometry, coverage, viewMatrix, isH
airline, | 223 return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline,
devBounds); |
| 224 devBounds)); | |
| 225 } | 224 } |
| 226 | 225 |
| 227 const char* name() const override { return "DefaultPathBatch"; } | 226 const char* name() const override { return "DefaultPathBatch"; } |
| 228 | 227 |
| 229 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 228 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 230 // When this is called on a batch, there is only one geometry bundle | 229 // When this is called on a batch, there is only one geometry bundle |
| 231 out->setKnownFourComponents(fGeoData[0].fColor); | 230 out->setKnownFourComponents(fGeoData[0].fColor); |
| 232 } | 231 } |
| 233 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 232 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 234 out->setKnownSingleComponent(this->coverage()); | 233 out->setKnownSingleComponent(this->coverage()); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 geometry.fColor = color; | 752 geometry.fColor = color; |
| 754 geometry.fPath = path; | 753 geometry.fPath = path; |
| 755 geometry.fTolerance = srcSpaceTol; | 754 geometry.fTolerance = srcSpaceTol; |
| 756 | 755 |
| 757 viewMatrix.mapRect(&bounds); | 756 viewMatrix.mapRect(&bounds); |
| 758 uint8_t coverage = GrRandomCoverage(random); | 757 uint8_t coverage = GrRandomCoverage(random); |
| 759 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 758 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
| 760 } | 759 } |
| 761 | 760 |
| 762 #endif | 761 #endif |
| OLD | NEW |