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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 AAFlatteningConvexPathBatch(const Geometry& geometry) { | 254 AAFlatteningConvexPathBatch(const Geometry& geometry) { |
255 this->initClassID<AAFlatteningConvexPathBatch>(); | 255 this->initClassID<AAFlatteningConvexPathBatch>(); |
256 fGeoData.push_back(geometry); | 256 fGeoData.push_back(geometry); |
257 | 257 |
258 // compute bounds | 258 // compute bounds |
259 fBounds = geometry.fPath.getBounds(); | 259 fBounds = geometry.fPath.getBounds(); |
260 geometry.fViewMatrix.mapRect(&fBounds); | 260 geometry.fViewMatrix.mapRect(&fBounds); |
261 } | 261 } |
262 | 262 |
263 bool onCombineIfPossible(GrBatch* t) override { | 263 bool onCombineIfPossible(GrBatch* t) override { |
| 264 if (!this->pipeline()->isEqual(*t->pipeline())) { |
| 265 return false; |
| 266 } |
| 267 |
264 AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch>
(); | 268 AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch>
(); |
265 | 269 |
266 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); | 270 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); |
267 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi
ewMatrix())) { | 271 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi
ewMatrix())) { |
268 return false; | 272 return false; |
269 } | 273 } |
270 | 274 |
271 // In the event of two batches, one who can tweak, one who cannot, we ju
st fall back to | 275 // In the event of two batches, one who can tweak, one who cannot, we ju
st fall back to |
272 // not tweaking | 276 // not tweaking |
273 if (this->canTweakAlphaForCoverage() != that->canTweakAlphaForCoverage()
) { | 277 if (this->canTweakAlphaForCoverage() != that->canTweakAlphaForCoverage()
) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { | 334 BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { |
331 AAFlatteningConvexPathBatch::Geometry geometry; | 335 AAFlatteningConvexPathBatch::Geometry geometry; |
332 geometry.fColor = GrRandomColor(random); | 336 geometry.fColor = GrRandomColor(random); |
333 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 337 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
334 geometry.fPath = GrTest::TestPathConvex(random); | 338 geometry.fPath = GrTest::TestPathConvex(random); |
335 | 339 |
336 return AAFlatteningConvexPathBatch::Create(geometry); | 340 return AAFlatteningConvexPathBatch::Create(geometry); |
337 } | 341 } |
338 | 342 |
339 #endif | 343 #endif |
OLD | NEW |