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 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 return true; | 978 return true; |
979 } | 979 } |
980 SkASSERT(!inPLSDraw); | 980 SkASSERT(!inPLSDraw); |
981 SkDEBUGCODE(inPLSDraw = true;) | 981 SkDEBUGCODE(inPLSDraw = true;) |
982 PLSPathBatch::Geometry geometry; | 982 PLSPathBatch::Geometry geometry; |
983 geometry.fColor = args.fColor; | 983 geometry.fColor = args.fColor; |
984 geometry.fViewMatrix = *args.fViewMatrix; | 984 geometry.fViewMatrix = *args.fViewMatrix; |
985 geometry.fPath = *args.fPath; | 985 geometry.fPath = *args.fPath; |
986 | 986 |
987 SkAutoTUnref<GrDrawBatch> batch(PLSPathBatch::Create(geometry)); | 987 SkAutoTUnref<GrDrawBatch> batch(PLSPathBatch::Create(geometry)); |
988 args.fTarget->drawBatch(*args.fPipelineBuilder, *args.fClip, batch); | 988 |
| 989 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnified
Multisampled()); |
| 990 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarget()); |
| 991 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 992 |
| 993 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
989 | 994 |
990 SkDEBUGCODE(inPLSDraw = false;) | 995 SkDEBUGCODE(inPLSDraw = false;) |
991 return true; | 996 return true; |
992 | 997 |
993 } | 998 } |
994 | 999 |
995 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 1000 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
996 | 1001 |
997 #ifdef GR_TEST_UTILS | 1002 #ifdef GR_TEST_UTILS |
998 | 1003 |
999 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { | 1004 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { |
1000 PLSPathBatch::Geometry geometry; | 1005 PLSPathBatch::Geometry geometry; |
1001 geometry.fColor = GrRandomColor(random); | 1006 geometry.fColor = GrRandomColor(random); |
1002 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1007 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
1003 geometry.fPath = GrTest::TestPathConvex(random); | 1008 geometry.fPath = GrTest::TestPathConvex(random); |
1004 | 1009 |
1005 return PLSPathBatch::Create(geometry); | 1010 return PLSPathBatch::Create(geometry); |
1006 } | 1011 } |
1007 | 1012 |
1008 #endif | 1013 #endif |
OLD | NEW |