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 "GrBatchTarget.h" | 10 #include "GrBatchTarget.h" |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 batchTarget->initDraw(gp, this->pipeline()); | 1569 batchTarget->initDraw(gp, this->pipeline()); |
1570 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); | 1570 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); |
1571 | 1571 |
1572 GrPrimitiveType primitiveType = WIREFRAME ? kLines_GrPrimitiveType | 1572 GrPrimitiveType primitiveType = WIREFRAME ? kLines_GrPrimitiveType |
1573 : kTriangles_GrPrimitiveType; | 1573 : kTriangles_GrPrimitiveType; |
1574 GrVertices vertices; | 1574 GrVertices vertices; |
1575 vertices.init(primitiveType, vertexBuffer.get(), 0, actualCount); | 1575 vertices.init(primitiveType, vertexBuffer.get(), 0, actualCount); |
1576 batchTarget->draw(vertices); | 1576 batchTarget->draw(vertices); |
1577 } | 1577 } |
1578 | 1578 |
1579 bool onCombineIfPossible(GrBatch*) override { | 1579 bool onCombineIfPossible(GrBatch*, const GrCaps&) override { return false; } |
1580 return false; | |
1581 } | |
1582 | 1580 |
1583 private: | 1581 private: |
1584 TessellatingPathBatch(const GrColor& color, | 1582 TessellatingPathBatch(const GrColor& color, |
1585 const SkPath& path, | 1583 const SkPath& path, |
1586 const GrStrokeInfo& stroke, | 1584 const GrStrokeInfo& stroke, |
1587 const SkMatrix& viewMatrix, | 1585 const SkMatrix& viewMatrix, |
1588 const SkRect& clipBounds) | 1586 const SkRect& clipBounds) |
1589 : fColor(color) | 1587 : fColor(color) |
1590 , fPath(path) | 1588 , fPath(path) |
1591 , fStroke(stroke) | 1589 , fStroke(stroke) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 bool result = viewMatrix.invert(&vmi); | 1649 bool result = viewMatrix.invert(&vmi); |
1652 if (!result) { | 1650 if (!result) { |
1653 SkFAIL("Cannot invert matrix\n"); | 1651 SkFAIL("Cannot invert matrix\n"); |
1654 } | 1652 } |
1655 vmi.mapRect(&clipBounds); | 1653 vmi.mapRect(&clipBounds); |
1656 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); | 1654 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); |
1657 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl
ipBounds); | 1655 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl
ipBounds); |
1658 } | 1656 } |
1659 | 1657 |
1660 #endif | 1658 #endif |
OLD | NEW |