OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrAAConvexPathRenderer.h" | 8 #include "GrAAConvexPathRenderer.h" |
9 | 9 |
10 #include "GrAAConvexTessellator.h" | 10 #include "GrAAConvexTessellator.h" |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 | 990 |
991 BatchTracker fBatch; | 991 BatchTracker fBatch; |
992 SkSTArray<1, Geometry, true> fGeoData; | 992 SkSTArray<1, Geometry, true> fGeoData; |
993 | 993 |
994 typedef GrVertexBatch INHERITED; | 994 typedef GrVertexBatch INHERITED; |
995 }; | 995 }; |
996 | 996 |
997 bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { | 997 bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { |
998 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), | 998 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), |
999 "GrAAConvexPathRenderer::onDrawPath"); | 999 "GrAAConvexPathRenderer::onDrawPath"); |
| 1000 SkASSERT(!args.fDrawContext->isUnifiedMultisampled()); |
| 1001 |
1000 if (args.fPath->isEmpty()) { | 1002 if (args.fPath->isEmpty()) { |
1001 return true; | 1003 return true; |
1002 } | 1004 } |
1003 | 1005 |
1004 AAConvexPathBatch::Geometry geometry; | 1006 AAConvexPathBatch::Geometry geometry; |
1005 geometry.fColor = args.fColor; | 1007 geometry.fColor = args.fColor; |
1006 geometry.fViewMatrix = *args.fViewMatrix; | 1008 geometry.fViewMatrix = *args.fViewMatrix; |
1007 geometry.fPath = *args.fPath; | 1009 geometry.fPath = *args.fPath; |
1008 | 1010 |
1009 SkAutoTUnref<GrDrawBatch> batch(AAConvexPathBatch::Create(geometry)); | 1011 SkAutoTUnref<GrDrawBatch> batch(AAConvexPathBatch::Create(geometry)); |
1010 | 1012 |
1011 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnified
Multisampled()); | 1013 GrPipelineBuilder pipelineBuilder(*args.fPaint); |
1012 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 1014 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
1013 | 1015 |
1014 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 1016 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
1015 | 1017 |
1016 return true; | 1018 return true; |
1017 | 1019 |
1018 } | 1020 } |
1019 | 1021 |
1020 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 1022 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
1021 | 1023 |
1022 #ifdef GR_TEST_UTILS | 1024 #ifdef GR_TEST_UTILS |
1023 | 1025 |
1024 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1026 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { |
1025 AAConvexPathBatch::Geometry geometry; | 1027 AAConvexPathBatch::Geometry geometry; |
1026 geometry.fColor = GrRandomColor(random); | 1028 geometry.fColor = GrRandomColor(random); |
1027 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1029 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
1028 geometry.fPath = GrTest::TestPathConvex(random); | 1030 geometry.fPath = GrTest::TestPathConvex(random); |
1029 | 1031 |
1030 return AAConvexPathBatch::Create(geometry); | 1032 return AAConvexPathBatch::Create(geometry); |
1031 } | 1033 } |
1032 | 1034 |
1033 #endif | 1035 #endif |
OLD | NEW |