| 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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.fTarget->getAuditTrail(),"GrAAHairlinePathRen
derer::onDrawPath"); |
| 967 SkIRect devClipBounds; | 967 SkIRect devClipBounds; |
| 968 GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); | 968 GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); |
| 969 args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(
), &devClipBounds); | 969 args.fClip->getConservativeBounds(rt->width(), rt->height(), &devClipBounds)
; |
| 970 | 970 |
| 971 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi
ewMatrix, *args.fPath, | 971 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi
ewMatrix, *args.fPath, |
| 972 *args.fStyle, devClipB
ounds)); | 972 *args.fStyle, devClipB
ounds)); |
| 973 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); | 973 args.fTarget->drawBatch(*args.fPipelineBuilder, *args.fClip, batch); |
| 974 | 974 |
| 975 return true; | 975 return true; |
| 976 } | 976 } |
| 977 | 977 |
| 978 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 978 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 979 | 979 |
| 980 #ifdef GR_TEST_UTILS | 980 #ifdef GR_TEST_UTILS |
| 981 | 981 |
| 982 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { | 982 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { |
| 983 GrColor color = GrRandomColor(random); | 983 GrColor color = GrRandomColor(random); |
| 984 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 984 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 985 SkPath path = GrTest::TestPath(random); | 985 SkPath path = GrTest::TestPath(random); |
| 986 SkIRect devClipBounds; | 986 SkIRect devClipBounds; |
| 987 devClipBounds.setEmpty(); | 987 devClipBounds.setEmpty(); |
| 988 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); | 988 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); |
| 989 } | 989 } |
| 990 | 990 |
| 991 #endif | 991 #endif |
| OLD | NEW |