| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 AAFlatteningConvexPathBatch::Geometry geometry; | 328 AAFlatteningConvexPathBatch::Geometry geometry; |
| 329 geometry.fColor = args.fColor; | 329 geometry.fColor = args.fColor; |
| 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 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); | 338 args.fTarget->drawBatch(*args.fPipelineBuilder, *args.fClip, batch); |
| 339 | 339 |
| 340 return true; | 340 return true; |
| 341 } | 341 } |
| 342 | 342 |
| 343 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 343 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 344 | 344 |
| 345 #ifdef GR_TEST_UTILS | 345 #ifdef GR_TEST_UTILS |
| 346 | 346 |
| 347 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { | 347 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { |
| 348 AAFlatteningConvexPathBatch::Geometry geometry; | 348 AAFlatteningConvexPathBatch::Geometry geometry; |
| 349 geometry.fColor = GrRandomColor(random); | 349 geometry.fColor = GrRandomColor(random); |
| 350 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 350 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
| 351 geometry.fPath = GrTest::TestPathConvex(random); | 351 geometry.fPath = GrTest::TestPathConvex(random); |
| 352 | 352 |
| 353 return AAFlatteningConvexPathBatch::Create(geometry); | 353 return AAFlatteningConvexPathBatch::Create(geometry); |
| 354 } | 354 } |
| 355 | 355 |
| 356 #endif | 356 #endif |
| OLD | NEW |