| 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 "GrPLSPathRenderer.h" | 8 #include "GrPLSPathRenderer.h" |
| 9 | 9 |
| 10 #include "SkChunkAlloc.h" | 10 #include "SkChunkAlloc.h" |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 }; | 941 }; |
| 942 | 942 |
| 943 SkDEBUGCODE(bool inPLSDraw = false;) | 943 SkDEBUGCODE(bool inPLSDraw = false;) |
| 944 bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) { | 944 bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 945 SkASSERT(!args.fShape->isEmpty()) | 945 SkASSERT(!args.fShape->isEmpty()) |
| 946 SkASSERT(!inPLSDraw); | 946 SkASSERT(!inPLSDraw); |
| 947 SkDEBUGCODE(inPLSDraw = true;) | 947 SkDEBUGCODE(inPLSDraw = true;) |
| 948 SkPath path; | 948 SkPath path; |
| 949 args.fShape->asPath(&path); | 949 args.fShape->asPath(&path); |
| 950 | 950 |
| 951 SkAutoTUnref<GrDrawBatch> batch(new PLSPathBatch(args.fColor, path, *args.fV
iewMatrix)); | 951 SkAutoTUnref<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(), |
| 952 path, *args.fViewMatrix)); |
| 952 | 953 |
| 953 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHW
AA(*args.fPaint)); | 954 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHW
AA(*args.fPaint)); |
| 954 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 955 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 955 | 956 |
| 956 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 957 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 957 | 958 |
| 958 SkDEBUGCODE(inPLSDraw = false;) | 959 SkDEBUGCODE(inPLSDraw = false;) |
| 959 return true; | 960 return true; |
| 960 | 961 |
| 961 } | 962 } |
| 962 | 963 |
| 963 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 964 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 964 | 965 |
| 965 #ifdef GR_TEST_UTILS | 966 #ifdef GR_TEST_UTILS |
| 966 | 967 |
| 967 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { | 968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { |
| 968 GrColor color = GrRandomColor(random); | 969 GrColor color = GrRandomColor(random); |
| 969 SkMatrix vm = GrTest::TestMatrixInvertible(random); | 970 SkMatrix vm = GrTest::TestMatrixInvertible(random); |
| 970 SkPath path = GrTest::TestPathConvex(random); | 971 SkPath path = GrTest::TestPathConvex(random); |
| 971 | 972 |
| 972 return new PLSPathBatch(color, path, vm); | 973 return new PLSPathBatch(color, path, vm); |
| 973 } | 974 } |
| 974 | 975 |
| 975 #endif | 976 #endif |
| OLD | NEW |