| 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 "GrAAHairlinePathRenderer::onDrawPath"); | 967 "GrAAHairlinePathRenderer::onDrawPath"); |
| 968 SkIRect devClipBounds; | 968 SkIRect devClipBounds; |
| 969 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), | 969 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), |
| 970 &devClipBounds); | 970 &devClipBounds); |
| 971 | 971 |
| 972 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, |
| 973 *args.fStyle, devClipB
ounds)); | 973 *args.fStyle, devClipB
ounds)); |
| 974 | 974 |
| 975 GrPipelineBuilder pipelineBuilder(*args.fPaint, | 975 GrPipelineBuilder pipelineBuilder(*args.fPaint, |
| 976 args.fDrawContext->isStencilBufferMultisam
pled()); | 976 args.fDrawContext->isStencilBufferMultisam
pled()); |
| 977 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarget()); | |
| 978 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 977 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 979 | 978 |
| 980 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 979 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 981 | 980 |
| 982 return true; | 981 return true; |
| 983 } | 982 } |
| 984 | 983 |
| 985 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 984 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 986 | 985 |
| 987 #ifdef GR_TEST_UTILS | 986 #ifdef GR_TEST_UTILS |
| 988 | 987 |
| 989 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { | 988 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { |
| 990 GrColor color = GrRandomColor(random); | 989 GrColor color = GrRandomColor(random); |
| 991 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 990 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 992 SkPath path = GrTest::TestPath(random); | 991 SkPath path = GrTest::TestPath(random); |
| 993 SkIRect devClipBounds; | 992 SkIRect devClipBounds; |
| 994 devClipBounds.setEmpty(); | 993 devClipBounds.setEmpty(); |
| 995 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); | 994 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin
e(), devClipBounds); |
| 996 } | 995 } |
| 997 | 996 |
| 998 #endif | 997 #endif |
| OLD | NEW |