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