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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 geometry.fColor = color; | 967 geometry.fColor = color; |
968 geometry.fCoverage = newCoverage; | 968 geometry.fCoverage = newCoverage; |
969 geometry.fViewMatrix = viewMatrix; | 969 geometry.fViewMatrix = viewMatrix; |
970 geometry.fPath = path; | 970 geometry.fPath = path; |
971 geometry.fDevClipBounds = devClipBounds; | 971 geometry.fDevClipBounds = devClipBounds; |
972 | 972 |
973 return AAHairlineBatch::Create(geometry); | 973 return AAHairlineBatch::Create(geometry); |
974 } | 974 } |
975 | 975 |
976 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { | 976 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 977 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrAAHairlinePathRen
derer::onDrawPath"); |
977 SkIRect devClipBounds; | 978 SkIRect devClipBounds; |
978 GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); | 979 GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); |
979 args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(
), &devClipBounds); | 980 args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(
), &devClipBounds); |
980 | 981 |
981 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi
ewMatrix, *args.fPath, | 982 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi
ewMatrix, *args.fPath, |
982 *args.fStroke, devClip
Bounds)); | 983 *args.fStroke, devClip
Bounds)); |
983 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); | 984 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); |
984 | 985 |
985 return true; | 986 return true; |
986 } | 987 } |
987 | 988 |
988 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 989 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
989 | 990 |
990 #ifdef GR_TEST_UTILS | 991 #ifdef GR_TEST_UTILS |
991 | 992 |
992 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { | 993 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { |
993 GrColor color = GrRandomColor(random); | 994 GrColor color = GrRandomColor(random); |
994 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 995 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
995 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 996 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
996 SkPath path = GrTest::TestPath(random); | 997 SkPath path = GrTest::TestPath(random); |
997 SkIRect devClipBounds; | 998 SkIRect devClipBounds; |
998 devClipBounds.setEmpty(); | 999 devClipBounds.setEmpty(); |
999 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 1000 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
1000 } | 1001 } |
1001 | 1002 |
1002 #endif | 1003 #endif |
OLD | NEW |