| 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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), | 961 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), |
| 962 "GrAAHairlinePathRenderer::onDrawPath"); | 962 "GrAAHairlinePathRenderer::onDrawPath"); |
| 963 SkASSERT(!args.fDrawContext->isUnifiedMultisampled()); | 963 SkASSERT(!args.fDrawContext->isUnifiedMultisampled()); |
| 964 | 964 |
| 965 SkIRect devClipBounds; | 965 SkIRect devClipBounds; |
| 966 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), | 966 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), |
| 967 &devClipBounds); | 967 &devClipBounds); |
| 968 | 968 |
| 969 SkPath path; | 969 SkPath path; |
| 970 args.fShape->asPath(&path); | 970 args.fShape->asPath(&path); |
| 971 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi
ewMatrix, path, | 971 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fPaint->getColor(
), |
| 972 *args.fViewMatrix, pat
h, |
| 972 args.fShape->style(),
devClipBounds)); | 973 args.fShape->style(),
devClipBounds)); |
| 973 | 974 |
| 974 GrPipelineBuilder pipelineBuilder(*args.fPaint); | 975 GrPipelineBuilder pipelineBuilder(*args.fPaint); |
| 975 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 976 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 976 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 977 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 977 | 978 |
| 978 return true; | 979 return true; |
| 979 } | 980 } |
| 980 | 981 |
| 981 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 982 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 982 | 983 |
| 983 #ifdef GR_TEST_UTILS | 984 #ifdef GR_TEST_UTILS |
| 984 | 985 |
| 985 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { | 986 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { |
| 986 GrColor color = GrRandomColor(random); | 987 GrColor color = GrRandomColor(random); |
| 987 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 988 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 988 SkPath path = GrTest::TestPath(random); | 989 SkPath path = GrTest::TestPath(random); |
| 989 SkIRect devClipBounds; | 990 SkIRect devClipBounds; |
| 990 devClipBounds.setEmpty(); | 991 devClipBounds.setEmpty(); |
| 991 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); | 992 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); |
| 992 } | 993 } |
| 993 | 994 |
| 994 #endif | 995 #endif |
| OLD | NEW |