| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrDashingEffect.h" | 8 #include "GrDashingEffect.h" |
| 9 | 9 |
| 10 #include "GrBatchTarget.h" | 10 #include "GrBatchTarget.h" |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 SkScalar xBloat = SkPaint::kButt_Cap == cap ? 0 : halfStrokeWidth; | 610 SkScalar xBloat = SkPaint::kButt_Cap == cap ? 0 : halfStrokeWidth; |
| 611 fBounds.set(geometry.fPtsRot[0], geometry.fPtsRot[1]); | 611 fBounds.set(geometry.fPtsRot[0], geometry.fPtsRot[1]); |
| 612 fBounds.outset(xBloat, halfStrokeWidth); | 612 fBounds.outset(xBloat, halfStrokeWidth); |
| 613 | 613 |
| 614 // Note, we actually create the combined matrix here, and save the work | 614 // Note, we actually create the combined matrix here, and save the work |
| 615 SkMatrix& combinedMatrix = fGeoData[0].fSrcRotInv; | 615 SkMatrix& combinedMatrix = fGeoData[0].fSrcRotInv; |
| 616 combinedMatrix.postConcat(geometry.fViewMatrix); | 616 combinedMatrix.postConcat(geometry.fViewMatrix); |
| 617 combinedMatrix.mapRect(&fBounds); | 617 combinedMatrix.mapRect(&fBounds); |
| 618 } | 618 } |
| 619 | 619 |
| 620 bool onCombineIfPossible(GrBatch* t) override { | 620 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { |
| 621 if (!this->pipeline()->isEqual(*t->pipeline())) { | 621 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipel
ine(), t->bounds(), |
| 622 caps)) { |
| 622 return false; | 623 return false; |
| 623 } | 624 } |
| 624 | 625 |
| 625 DashBatch* that = t->cast<DashBatch>(); | 626 DashBatch* that = t->cast<DashBatch>(); |
| 626 | 627 |
| 627 if (this->aaMode() != that->aaMode()) { | 628 if (this->aaMode() != that->aaMode()) { |
| 628 return false; | 629 return false; |
| 629 } | 630 } |
| 630 | 631 |
| 631 if (this->fullDash() != that->fullDash()) { | 632 if (this->fullDash() != that->fullDash()) { |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 info.fIntervals = intervals; | 1298 info.fIntervals = intervals; |
| 1298 info.fCount = 2; | 1299 info.fCount = 2; |
| 1299 info.fPhase = phase; | 1300 info.fPhase = phase; |
| 1300 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); | 1301 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); |
| 1301 SkASSERT(success); | 1302 SkASSERT(success); |
| 1302 | 1303 |
| 1303 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); | 1304 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); |
| 1304 } | 1305 } |
| 1305 | 1306 |
| 1306 #endif | 1307 #endif |
| OLD | NEW |