| 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 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 bool fCanTweakAlphaForCoverage; | 988 bool fCanTweakAlphaForCoverage; |
| 989 }; | 989 }; |
| 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.fTarget->getAuditTrail(), "GrAAConvexPathRend
erer::onDrawPath"); | 998 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), |
| 999 "GrAAConvexPathRenderer::onDrawPath"); |
| 999 if (args.fPath->isEmpty()) { | 1000 if (args.fPath->isEmpty()) { |
| 1000 return true; | 1001 return true; |
| 1001 } | 1002 } |
| 1002 | 1003 |
| 1003 AAConvexPathBatch::Geometry geometry; | 1004 AAConvexPathBatch::Geometry geometry; |
| 1004 geometry.fColor = args.fColor; | 1005 geometry.fColor = args.fColor; |
| 1005 geometry.fViewMatrix = *args.fViewMatrix; | 1006 geometry.fViewMatrix = *args.fViewMatrix; |
| 1006 geometry.fPath = *args.fPath; | 1007 geometry.fPath = *args.fPath; |
| 1007 | 1008 |
| 1008 SkAutoTUnref<GrDrawBatch> batch(AAConvexPathBatch::Create(geometry)); | 1009 SkAutoTUnref<GrDrawBatch> batch(AAConvexPathBatch::Create(geometry)); |
| 1009 args.fTarget->drawBatch(*args.fPipelineBuilder, *args.fClip, batch); | 1010 |
| 1011 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnified
Multisampled()); |
| 1012 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarget()); |
| 1013 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 1014 |
| 1015 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 1010 | 1016 |
| 1011 return true; | 1017 return true; |
| 1012 | 1018 |
| 1013 } | 1019 } |
| 1014 | 1020 |
| 1015 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 1021 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 1016 | 1022 |
| 1017 #ifdef GR_TEST_UTILS | 1023 #ifdef GR_TEST_UTILS |
| 1018 | 1024 |
| 1019 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1025 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { |
| 1020 AAConvexPathBatch::Geometry geometry; | 1026 AAConvexPathBatch::Geometry geometry; |
| 1021 geometry.fColor = GrRandomColor(random); | 1027 geometry.fColor = GrRandomColor(random); |
| 1022 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1028 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
| 1023 geometry.fPath = GrTest::TestPathConvex(random); | 1029 geometry.fPath = GrTest::TestPathConvex(random); |
| 1024 | 1030 |
| 1025 return AAConvexPathBatch::Create(geometry); | 1031 return AAConvexPathBatch::Create(geometry); |
| 1026 } | 1032 } |
| 1027 | 1033 |
| 1028 #endif | 1034 #endif |
| OLD | NEW |