OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrMSAAPathRenderer.h" | 8 #include "GrMSAAPathRenderer.h" |
9 | 9 |
10 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 } | 660 } |
661 } else { | 661 } else { |
662 bounds = path.getBounds(); | 662 bounds = path.getBounds(); |
663 } | 663 } |
664 const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? S
kMatrix::I() : | 664 const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? S
kMatrix::I() : |
665 v
iewMatrix; | 665 v
iewMatrix; |
666 SkAutoTUnref<GrDrawBatch> batch( | 666 SkAutoTUnref<GrDrawBatch> batch( |
667 GrRectBatchFactory::CreateNonAAFill(color, viewM, bounds, nu
llptr, | 667 GrRectBatchFactory::CreateNonAAFill(color, viewM, bounds, nu
llptr, |
668 &localMatrix)); | 668 &localMatrix)); |
669 | 669 |
670 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); | 670 GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(pa
int)); |
671 pipelineBuilder.setDrawFace(drawFace[p]); | 671 pipelineBuilder.setDrawFace(drawFace[p]); |
672 if (passes[p]) { | 672 if (passes[p]) { |
673 pipelineBuilder.setUserStencil(passes[p]); | 673 pipelineBuilder.setUserStencil(passes[p]); |
674 } else { | 674 } else { |
675 pipelineBuilder.setUserStencil(userStencilSettings); | 675 pipelineBuilder.setUserStencil(userStencilSettings); |
676 } | 676 } |
677 | 677 |
678 drawContext->drawBatch(pipelineBuilder, clip, batch); | 678 drawContext->drawBatch(pipelineBuilder, clip, batch); |
679 } else { | 679 } else { |
680 MSAAPathBatch::Geometry geometry; | 680 MSAAPathBatch::Geometry geometry; |
681 geometry.fColor = color; | 681 geometry.fColor = color; |
682 geometry.fPath = path; | 682 geometry.fPath = path; |
683 geometry.fTolerance = kTolerance; | 683 geometry.fTolerance = kTolerance; |
684 | 684 |
685 SkAutoTUnref<MSAAPathBatch> batch(MSAAPathBatch::Create(geometry, vi
ewMatrix, | 685 SkAutoTUnref<MSAAPathBatch> batch(MSAAPathBatch::Create(geometry, vi
ewMatrix, |
686 devBounds)); | 686 devBounds)); |
687 if (!batch->isValid()) { | 687 if (!batch->isValid()) { |
688 return false; | 688 return false; |
689 } | 689 } |
690 | 690 |
691 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); | 691 GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(pa
int)); |
692 pipelineBuilder.setDrawFace(drawFace[p]); | 692 pipelineBuilder.setDrawFace(drawFace[p]); |
693 if (passes[p]) { | 693 if (passes[p]) { |
694 pipelineBuilder.setUserStencil(passes[p]); | 694 pipelineBuilder.setUserStencil(passes[p]); |
695 } else { | 695 } else { |
696 pipelineBuilder.setUserStencil(userStencilSettings); | 696 pipelineBuilder.setUserStencil(userStencilSettings); |
697 } | 697 } |
698 if (passCount > 1) { | 698 if (passCount > 1) { |
699 pipelineBuilder.setDisableColorXPFactory(); | 699 pipelineBuilder.setDisableColorXPFactory(); |
700 } | 700 } |
701 | 701 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 paint, | 756 paint, |
757 &GrUserStencilSettings::kUnused, | 757 &GrUserStencilSettings::kUnused, |
758 *args.fClip, | 758 *args.fClip, |
759 GrColor_WHITE, | 759 GrColor_WHITE, |
760 *args.fViewMatrix, | 760 *args.fViewMatrix, |
761 *args.fPath, | 761 *args.fPath, |
762 true); | 762 true); |
763 } | 763 } |
764 | 764 |
765 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 765 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
OLD | NEW |