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