| 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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 | 992 |
| 993 bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { | 993 bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 994 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), | 994 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), |
| 995 "GrAAConvexPathRenderer::onDrawPath"); | 995 "GrAAConvexPathRenderer::onDrawPath"); |
| 996 SkASSERT(!args.fDrawContext->isUnifiedMultisampled()); | 996 SkASSERT(!args.fDrawContext->isUnifiedMultisampled()); |
| 997 SkASSERT(!args.fShape->isEmpty()); | 997 SkASSERT(!args.fShape->isEmpty()); |
| 998 | 998 |
| 999 SkPath path; | 999 SkPath path; |
| 1000 args.fShape->asPath(&path); | 1000 args.fShape->asPath(&path); |
| 1001 | 1001 |
| 1002 SkAutoTUnref<GrDrawBatch> batch(new AAConvexPathBatch(args.fColor, *args.fVi
ewMatrix, path)); | 1002 SkAutoTUnref<GrDrawBatch> batch(new AAConvexPathBatch(args.fPaint->getColor(
), |
| 1003 *args.fViewMatrix, pat
h)); |
| 1003 | 1004 |
| 1004 GrPipelineBuilder pipelineBuilder(*args.fPaint); | 1005 GrPipelineBuilder pipelineBuilder(*args.fPaint); |
| 1005 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 1006 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 1006 | 1007 |
| 1007 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 1008 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 1008 | 1009 |
| 1009 return true; | 1010 return true; |
| 1010 | 1011 |
| 1011 } | 1012 } |
| 1012 | 1013 |
| 1013 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 1014 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 1014 | 1015 |
| 1015 #ifdef GR_TEST_UTILS | 1016 #ifdef GR_TEST_UTILS |
| 1016 | 1017 |
| 1017 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1018 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { |
| 1018 GrColor color = GrRandomColor(random); | 1019 GrColor color = GrRandomColor(random); |
| 1019 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); | 1020 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); |
| 1020 SkPath path = GrTest::TestPathConvex(random); | 1021 SkPath path = GrTest::TestPathConvex(random); |
| 1021 | 1022 |
| 1022 return new AAConvexPathBatch(color, viewMatrix, path); | 1023 return new AAConvexPathBatch(color, viewMatrix, path); |
| 1023 } | 1024 } |
| 1024 | 1025 |
| 1025 #endif | 1026 #endif |
| OLD | NEW |