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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 bool fUsesLocalCoords; | 935 bool fUsesLocalCoords; |
936 | 936 |
937 GrColor fColor; | 937 GrColor fColor; |
938 SkPath fPath; | 938 SkPath fPath; |
939 SkMatrix fViewMatrix; | 939 SkMatrix fViewMatrix; |
940 typedef GrVertexBatch INHERITED; | 940 typedef GrVertexBatch INHERITED; |
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.fPaint->getColor(), | 951 SkAutoTUnref<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(), |
952 path, *args.fViewMatrix)); | 952 path, *args.fViewMatrix)); |
953 | 953 |
954 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHW
AA(*args.fPaint)); | 954 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHW
AA(*args.fPaint)); |
955 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 955 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
(...skipping 11 matching lines...) Expand all Loading... |
967 | 967 |
968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { | 968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { |
969 GrColor color = GrRandomColor(random); | 969 GrColor color = GrRandomColor(random); |
970 SkMatrix vm = GrTest::TestMatrixInvertible(random); | 970 SkMatrix vm = GrTest::TestMatrixInvertible(random); |
971 SkPath path = GrTest::TestPathConvex(random); | 971 SkPath path = GrTest::TestPathConvex(random); |
972 | 972 |
973 return new PLSPathBatch(color, path, vm); | 973 return new PLSPathBatch(color, path, vm); |
974 } | 974 } |
975 | 975 |
976 #endif | 976 #endif |
OLD | NEW |