| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrTessellatingPathRenderer.h" | 8 #include "GrTessellatingPathRenderer.h" |
| 9 | 9 |
| 10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
| (...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 private: | 1478 private: |
| 1479 TessellatingPathBatch(const GrColor& color, | 1479 TessellatingPathBatch(const GrColor& color, |
| 1480 const SkPath& path, | 1480 const SkPath& path, |
| 1481 const SkMatrix& viewMatrix, | 1481 const SkMatrix& viewMatrix, |
| 1482 const SkRect& clipBounds) | 1482 const SkRect& clipBounds) |
| 1483 : fColor(color) | 1483 : fColor(color) |
| 1484 , fPath(path) | 1484 , fPath(path) |
| 1485 , fViewMatrix(viewMatrix) | 1485 , fViewMatrix(viewMatrix) |
| 1486 , fClipBounds(clipBounds) { | 1486 , fClipBounds(clipBounds) { |
| 1487 this->initClassID<TessellatingPathBatch>(); | 1487 this->initClassID<TessellatingPathBatch>(); |
| 1488 |
| 1489 fBounds = path.getBounds(); |
| 1490 viewMatrix.mapRect(&fBounds); |
| 1488 } | 1491 } |
| 1489 | 1492 |
| 1490 GrColor fColor; | 1493 GrColor fColor; |
| 1491 SkPath fPath; | 1494 SkPath fPath; |
| 1492 SkMatrix fViewMatrix; | 1495 SkMatrix fViewMatrix; |
| 1493 SkRect fClipBounds; // in source space | 1496 SkRect fClipBounds; // in source space |
| 1494 GrPipelineInfo fPipelineInfo; | 1497 GrPipelineInfo fPipelineInfo; |
| 1495 }; | 1498 }; |
| 1496 | 1499 |
| 1497 bool GrTessellatingPathRenderer::onDrawPath(GrDrawTarget* target, | 1500 bool GrTessellatingPathRenderer::onDrawPath(GrDrawTarget* target, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1513 SkMatrix vmi; | 1516 SkMatrix vmi; |
| 1514 if (!viewM.invert(&vmi)) { | 1517 if (!viewM.invert(&vmi)) { |
| 1515 return false; | 1518 return false; |
| 1516 } | 1519 } |
| 1517 vmi.mapRect(&clipBounds); | 1520 vmi.mapRect(&clipBounds); |
| 1518 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM
, clipBounds)); | 1521 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM
, clipBounds)); |
| 1519 target->drawBatch(pipelineBuilder, batch); | 1522 target->drawBatch(pipelineBuilder, batch); |
| 1520 | 1523 |
| 1521 return true; | 1524 return true; |
| 1522 } | 1525 } |
| OLD | NEW |