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 "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 }; | 1627 }; |
1628 | 1628 |
1629 bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) { | 1629 bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) { |
1630 SkASSERT(!args.fAntiAlias); | 1630 SkASSERT(!args.fAntiAlias); |
1631 const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); | 1631 const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); |
1632 if (nullptr == rt) { | 1632 if (nullptr == rt) { |
1633 return false; | 1633 return false; |
1634 } | 1634 } |
1635 | 1635 |
1636 SkIRect clipBoundsI; | 1636 SkIRect clipBoundsI; |
1637 args.fPipelineBuilder->clip().getConservativeBounds(rt, &clipBoundsI); | 1637 args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(
), &clipBoundsI); |
1638 SkRect clipBounds = SkRect::Make(clipBoundsI); | 1638 SkRect clipBounds = SkRect::Make(clipBoundsI); |
1639 SkMatrix vmi; | 1639 SkMatrix vmi; |
1640 if (!args.fViewMatrix->invert(&vmi)) { | 1640 if (!args.fViewMatrix->invert(&vmi)) { |
1641 return false; | 1641 return false; |
1642 } | 1642 } |
1643 vmi.mapRect(&clipBounds); | 1643 vmi.mapRect(&clipBounds); |
1644 SkAutoTUnref<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fColor, *
args.fPath, | 1644 SkAutoTUnref<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fColor, *
args.fPath, |
1645 *args.fStroke,
*args.fViewMatrix, | 1645 *args.fStroke,
*args.fViewMatrix, |
1646 clipBounds)); | 1646 clipBounds)); |
1647 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); | 1647 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); |
(...skipping 14 matching lines...) Expand all Loading... |
1662 bool result = viewMatrix.invert(&vmi); | 1662 bool result = viewMatrix.invert(&vmi); |
1663 if (!result) { | 1663 if (!result) { |
1664 SkFAIL("Cannot invert matrix\n"); | 1664 SkFAIL("Cannot invert matrix\n"); |
1665 } | 1665 } |
1666 vmi.mapRect(&clipBounds); | 1666 vmi.mapRect(&clipBounds); |
1667 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); | 1667 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); |
1668 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl
ipBounds); | 1668 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl
ipBounds); |
1669 } | 1669 } |
1670 | 1670 |
1671 #endif | 1671 #endif |
OLD | NEW |