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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 public: | 121 public: |
122 struct Geometry { | 122 struct Geometry { |
123 GrColor fColor; | 123 GrColor fColor; |
124 SkMatrix fViewMatrix; | 124 SkMatrix fViewMatrix; |
125 SkPath fPath; | 125 SkPath fPath; |
126 SkScalar fStrokeWidth; | 126 SkScalar fStrokeWidth; |
127 SkPaint::Join fJoin; | 127 SkPaint::Join fJoin; |
128 SkScalar fMiterLimit; | 128 SkScalar fMiterLimit; |
129 }; | 129 }; |
130 | 130 |
| 131 BATCH_CLASS_ID |
| 132 |
131 static GrDrawBatch* Create(const Geometry& geometry) { | 133 static GrDrawBatch* Create(const Geometry& geometry) { |
132 return new AAFlatteningConvexPathBatch(geometry); | 134 return new AAFlatteningConvexPathBatch(geometry); |
133 } | 135 } |
134 | 136 |
135 const char* name() const override { return "AAConvexBatch"; } | 137 const char* name() const override { return "AAConvexBatch"; } |
136 | 138 |
137 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 139 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
138 // 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 |
139 out->setKnownFourComponents(fGeoData[0].fColor); | 141 out->setKnownFourComponents(fGeoData[0].fColor); |
140 } | 142 } |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { | 338 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { |
337 AAFlatteningConvexPathBatch::Geometry geometry; | 339 AAFlatteningConvexPathBatch::Geometry geometry; |
338 geometry.fColor = GrRandomColor(random); | 340 geometry.fColor = GrRandomColor(random); |
339 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 341 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
340 geometry.fPath = GrTest::TestPathConvex(random); | 342 geometry.fPath = GrTest::TestPathConvex(random); |
341 | 343 |
342 return AAFlatteningConvexPathBatch::Create(geometry); | 344 return AAFlatteningConvexPathBatch::Create(geometry); |
343 } | 345 } |
344 | 346 |
345 #endif | 347 #endif |
OLD | NEW |