OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrAALinearizingConvexPathRenderer.h" | 9 #include "GrAALinearizingConvexPathRenderer.h" |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 SkPaint::Join fJoin; | 128 SkPaint::Join fJoin; |
129 SkScalar fMiterLimit; | 129 SkScalar fMiterLimit; |
130 }; | 130 }; |
131 | 131 |
132 static GrDrawBatch* Create(const Geometry& geometry) { | 132 static GrDrawBatch* Create(const Geometry& geometry) { |
133 return new AAFlatteningConvexPathBatch(geometry); | 133 return new AAFlatteningConvexPathBatch(geometry); |
134 } | 134 } |
135 | 135 |
136 const char* name() const override { return "AAConvexBatch"; } | 136 const char* name() const override { return "AAConvexBatch"; } |
137 | 137 |
138 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 138 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant
Output* coverage, |
| 139 bool* usePLSDstRead) const { |
139 // When this is called on a batch, there is only one geometry bundle | 140 // When this is called on a batch, there is only one geometry bundle |
140 out->setKnownFourComponents(fGeoData[0].fColor); | 141 color->setKnownFourComponents(fGeoData[0].fColor); |
141 } | 142 coverage->setUnknownSingleComponent(); |
142 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 143 *usePLSDstRead = false; |
143 out->setUnknownSingleComponent(); | |
144 } | 144 } |
145 | 145 |
146 private: | 146 private: |
147 void initBatchTracker(const GrPipelineOptimizations& opt) override { | 147 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
148 // Handle any color overrides | 148 // Handle any color overrides |
149 if (!opt.readsColor()) { | 149 if (!opt.readsColor()) { |
150 fGeoData[0].fColor = GrColor_ILLEGAL; | 150 fGeoData[0].fColor = GrColor_ILLEGAL; |
151 } | 151 } |
152 opt.getOverrideColorIfSet(&fGeoData[0].fColor); | 152 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
153 | 153 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { | 338 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { |
339 AAFlatteningConvexPathBatch::Geometry geometry; | 339 AAFlatteningConvexPathBatch::Geometry geometry; |
340 geometry.fColor = GrRandomColor(random); | 340 geometry.fColor = GrRandomColor(random); |
341 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 341 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
342 geometry.fPath = GrTest::TestPathConvex(random); | 342 geometry.fPath = GrTest::TestPathConvex(random); |
343 | 343 |
344 return AAFlatteningConvexPathBatch::Create(geometry); | 344 return AAFlatteningConvexPathBatch::Create(geometry); |
345 } | 345 } |
346 | 346 |
347 #endif | 347 #endif |
OLD | NEW |