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 "GrBatchTarget.h" | 10 #include "GrBatchTarget.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 bool isHairline, const SkRect& devBounds) { | 382 bool isHairline, const SkRect& devBounds) { |
383 this->initClassID<DefaultPathBatch>(); | 383 this->initClassID<DefaultPathBatch>(); |
384 fBatch.fCoverage = coverage; | 384 fBatch.fCoverage = coverage; |
385 fBatch.fIsHairline = isHairline; | 385 fBatch.fIsHairline = isHairline; |
386 fBatch.fViewMatrix = viewMatrix; | 386 fBatch.fViewMatrix = viewMatrix; |
387 fGeoData.push_back(geometry); | 387 fGeoData.push_back(geometry); |
388 | 388 |
389 this->setBounds(devBounds); | 389 this->setBounds(devBounds); |
390 } | 390 } |
391 | 391 |
392 bool onCombineIfPossible(GrBatch* t) override { | 392 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { |
393 if (!this->pipeline()->isEqual(*t->pipeline())) { | 393 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipel
ine(), t->bounds(), |
| 394 caps)) { |
394 return false; | 395 return false; |
395 } | 396 } |
396 | 397 |
397 DefaultPathBatch* that = t->cast<DefaultPathBatch>(); | 398 DefaultPathBatch* that = t->cast<DefaultPathBatch>(); |
398 | 399 |
399 if (this->color() != that->color()) { | 400 if (this->color() != that->color()) { |
400 return false; | 401 return false; |
401 } | 402 } |
402 | 403 |
403 if (this->coverage() != that->coverage()) { | 404 if (this->coverage() != that->coverage()) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 geometry.fColor = color; | 755 geometry.fColor = color; |
755 geometry.fPath = path; | 756 geometry.fPath = path; |
756 geometry.fTolerance = srcSpaceTol; | 757 geometry.fTolerance = srcSpaceTol; |
757 | 758 |
758 viewMatrix.mapRect(&bounds); | 759 viewMatrix.mapRect(&bounds); |
759 uint8_t coverage = GrRandomCoverage(random); | 760 uint8_t coverage = GrRandomCoverage(random); |
760 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 761 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
761 } | 762 } |
762 | 763 |
763 #endif | 764 #endif |
OLD | NEW |