| 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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 geometry.fColor = color; | 956 geometry.fColor = color; |
| 957 geometry.fCoverage = newCoverage; | 957 geometry.fCoverage = newCoverage; |
| 958 geometry.fViewMatrix = viewMatrix; | 958 geometry.fViewMatrix = viewMatrix; |
| 959 geometry.fPath = path; | 959 geometry.fPath = path; |
| 960 geometry.fDevClipBounds = devClipBounds; | 960 geometry.fDevClipBounds = devClipBounds; |
| 961 | 961 |
| 962 return AAHairlineBatch::Create(geometry); | 962 return AAHairlineBatch::Create(geometry); |
| 963 } | 963 } |
| 964 | 964 |
| 965 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { | 965 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 966 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrAAHairlinePathRen
derer::onDrawPath"); | 966 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), |
| 967 "GrAAHairlinePathRenderer::onDrawPath"); |
| 967 SkIRect devClipBounds; | 968 SkIRect devClipBounds; |
| 968 GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); | 969 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), |
| 969 args.fClip->getConservativeBounds(rt->width(), rt->height(), &devClipBounds)
; | 970 &devClipBounds); |
| 970 | 971 |
| 971 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, |
| 972 *args.fStyle, devClipB
ounds)); | 973 *args.fStyle, devClipB
ounds)); |
| 973 args.fTarget->drawBatch(*args.fPipelineBuilder, *args.fClip, batch); | 974 |
| 975 GrPipelineBuilder pipelineBuilder(*args.fPaint, |
| 976 args.fDrawContext->isStencilBufferMultisam
pled()); |
| 977 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarget()); |
| 978 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 979 |
| 980 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 974 | 981 |
| 975 return true; | 982 return true; |
| 976 } | 983 } |
| 977 | 984 |
| 978 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 985 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 979 | 986 |
| 980 #ifdef GR_TEST_UTILS | 987 #ifdef GR_TEST_UTILS |
| 981 | 988 |
| 982 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { | 989 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { |
| 983 GrColor color = GrRandomColor(random); | 990 GrColor color = GrRandomColor(random); |
| 984 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 991 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 985 SkPath path = GrTest::TestPath(random); | 992 SkPath path = GrTest::TestPath(random); |
| 986 SkIRect devClipBounds; | 993 SkIRect devClipBounds; |
| 987 devClipBounds.setEmpty(); | 994 devClipBounds.setEmpty(); |
| 988 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); | 995 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); |
| 989 } | 996 } |
| 990 | 997 |
| 991 #endif | 998 #endif |
| OLD | NEW |