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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->isUnifiedMulti
sampled()); |
671 pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget()); | |
672 pipelineBuilder.setDrawFace(drawFace[p]); | 671 pipelineBuilder.setDrawFace(drawFace[p]); |
673 if (passes[p]) { | 672 if (passes[p]) { |
674 pipelineBuilder.setUserStencil(passes[p]); | 673 pipelineBuilder.setUserStencil(passes[p]); |
675 } else { | 674 } else { |
676 pipelineBuilder.setUserStencil(userStencilSettings); | 675 pipelineBuilder.setUserStencil(userStencilSettings); |
677 } | 676 } |
678 | 677 |
679 drawContext->drawBatch(pipelineBuilder, clip, batch); | 678 drawContext->drawBatch(pipelineBuilder, clip, batch); |
680 } else { | 679 } else { |
681 MSAAPathBatch::Geometry geometry; | 680 MSAAPathBatch::Geometry geometry; |
682 geometry.fColor = color; | 681 geometry.fColor = color; |
683 geometry.fPath = path; | 682 geometry.fPath = path; |
684 geometry.fTolerance = kTolerance; | 683 geometry.fTolerance = kTolerance; |
685 | 684 |
686 SkAutoTUnref<MSAAPathBatch> batch(MSAAPathBatch::Create(geometry, vi
ewMatrix, | 685 SkAutoTUnref<MSAAPathBatch> batch(MSAAPathBatch::Create(geometry, vi
ewMatrix, |
687 devBounds)); | 686 devBounds)); |
688 if (!batch->isValid()) { | 687 if (!batch->isValid()) { |
689 return false; | 688 return false; |
690 } | 689 } |
691 | 690 |
692 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); | 691 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); |
693 pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget()); | |
694 pipelineBuilder.setDrawFace(drawFace[p]); | 692 pipelineBuilder.setDrawFace(drawFace[p]); |
695 if (passes[p]) { | 693 if (passes[p]) { |
696 pipelineBuilder.setUserStencil(passes[p]); | 694 pipelineBuilder.setUserStencil(passes[p]); |
697 } else { | 695 } else { |
698 pipelineBuilder.setUserStencil(userStencilSettings); | 696 pipelineBuilder.setUserStencil(userStencilSettings); |
699 } | 697 } |
700 if (passCount > 1) { | 698 if (passCount > 1) { |
701 pipelineBuilder.setDisableColorXPFactory(); | 699 pipelineBuilder.setDisableColorXPFactory(); |
702 } | 700 } |
703 | 701 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 paint, | 756 paint, |
759 &GrUserStencilSettings::kUnused, | 757 &GrUserStencilSettings::kUnused, |
760 *args.fClip, | 758 *args.fClip, |
761 GrColor_WHITE, | 759 GrColor_WHITE, |
762 *args.fViewMatrix, | 760 *args.fViewMatrix, |
763 *args.fPath, | 761 *args.fPath, |
764 true); | 762 true); |
765 } | 763 } |
766 | 764 |
767 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 765 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
OLD | NEW |