| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrAALinearizingConvexPathRenderer.h" | 8 #include "GrAALinearizingConvexPathRenderer.h" |
| 9 | 9 |
| 10 #include "GrAAConvexTessellator.h" | 10 #include "GrAAConvexTessellator.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 geometry.fViewMatrix = *args.fViewMatrix; | 330 geometry.fViewMatrix = *args.fViewMatrix; |
| 331 geometry.fPath = *args.fPath; | 331 geometry.fPath = *args.fPath; |
| 332 bool fill = args.fStyle->isSimpleFill(); | 332 bool fill = args.fStyle->isSimpleFill(); |
| 333 geometry.fStrokeWidth = fill ? -1.0f : args.fStyle->strokeRec().getWidth(); | 333 geometry.fStrokeWidth = fill ? -1.0f : args.fStyle->strokeRec().getWidth(); |
| 334 geometry.fJoin = fill ? SkPaint::Join::kMiter_Join : args.fStyle->strokeRec(
).getJoin(); | 334 geometry.fJoin = fill ? SkPaint::Join::kMiter_Join : args.fStyle->strokeRec(
).getJoin(); |
| 335 geometry.fMiterLimit = args.fStyle->strokeRec().getMiter(); | 335 geometry.fMiterLimit = args.fStyle->strokeRec().getMiter(); |
| 336 | 336 |
| 337 SkAutoTUnref<GrDrawBatch> batch(AAFlatteningConvexPathBatch::Create(geometry
)); | 337 SkAutoTUnref<GrDrawBatch> batch(AAFlatteningConvexPathBatch::Create(geometry
)); |
| 338 | 338 |
| 339 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnified
Multisampled()); | 339 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnified
Multisampled()); |
| 340 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarget()); | |
| 341 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 340 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
| 342 | 341 |
| 343 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 342 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
| 344 | 343 |
| 345 return true; | 344 return true; |
| 346 } | 345 } |
| 347 | 346 |
| 348 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 347 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 349 | 348 |
| 350 #ifdef GR_TEST_UTILS | 349 #ifdef GR_TEST_UTILS |
| 351 | 350 |
| 352 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { | 351 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { |
| 353 AAFlatteningConvexPathBatch::Geometry geometry; | 352 AAFlatteningConvexPathBatch::Geometry geometry; |
| 354 geometry.fColor = GrRandomColor(random); | 353 geometry.fColor = GrRandomColor(random); |
| 355 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 354 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
| 356 geometry.fPath = GrTest::TestPathConvex(random); | 355 geometry.fPath = GrTest::TestPathConvex(random); |
| 357 | 356 |
| 358 return AAFlatteningConvexPathBatch::Create(geometry); | 357 return AAFlatteningConvexPathBatch::Create(geometry); |
| 359 } | 358 } |
| 360 | 359 |
| 361 #endif | 360 #endif |
| OLD | NEW |