| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" | 8 #include "GrAAHairLinePathRenderer.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { | 965 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 966 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), | 966 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), |
| 967 "GrAAHairlinePathRenderer::onDrawPath"); | 967 "GrAAHairlinePathRenderer::onDrawPath"); |
| 968 SkIRect devClipBounds; | 968 SkIRect devClipBounds; |
| 969 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), | 969 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), |
| 970 &devClipBounds); | 970 &devClipBounds); |
| 971 | 971 |
| 972 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi
ewMatrix, *args.fPath, | 972 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi
ewMatrix, *args.fPath, |
| 973 *args.fStyle, devClipB
ounds)); | 973 *args.fStyle, devClipB
ounds)); |
| 974 | 974 |
| 975 GrPipelineBuilder pipelineBuilder(*args.fPaint, | 975 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnified
Multisampled()); |
| 976 args.fDrawContext->isStencilBufferMultisam
pled()); | |
| 977 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 976 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 978 | 977 |
| 979 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 978 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 980 | 979 |
| 981 return true; | 980 return true; |
| 982 } | 981 } |
| 983 | 982 |
| 984 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 983 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 985 | 984 |
| 986 #ifdef GR_TEST_UTILS | 985 #ifdef GR_TEST_UTILS |
| 987 | 986 |
| 988 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { | 987 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { |
| 989 GrColor color = GrRandomColor(random); | 988 GrColor color = GrRandomColor(random); |
| 990 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 989 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 991 SkPath path = GrTest::TestPath(random); | 990 SkPath path = GrTest::TestPath(random); |
| 992 SkIRect devClipBounds; | 991 SkIRect devClipBounds; |
| 993 devClipBounds.setEmpty(); | 992 devClipBounds.setEmpty(); |
| 994 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); | 993 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); |
| 995 } | 994 } |
| 996 | 995 |
| 997 #endif | 996 #endif |
| OLD | NEW |