Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: src/gpu/batches/GrMSAAPathRenderer.cpp

Issue 1966903004: Remove clip from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@fix2_nvpr
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 int fMaxQuadVertices; 561 int fMaxQuadVertices;
562 int fMaxLineIndices; 562 int fMaxLineIndices;
563 int fMaxQuadIndices; 563 int fMaxQuadIndices;
564 bool fIsIndexed; 564 bool fIsIndexed;
565 565
566 typedef GrVertexBatch INHERITED; 566 typedef GrVertexBatch INHERITED;
567 }; 567 };
568 568
569 bool GrMSAAPathRenderer::internalDrawPath(GrDrawTarget* target, 569 bool GrMSAAPathRenderer::internalDrawPath(GrDrawTarget* target,
570 GrPipelineBuilder* pipelineBuilder, 570 GrPipelineBuilder* pipelineBuilder,
571 const GrClip& clip,
571 GrColor color, 572 GrColor color,
572 const SkMatrix& viewMatrix, 573 const SkMatrix& viewMatrix,
573 const SkPath& path, 574 const SkPath& path,
574 bool stencilOnly) { 575 bool stencilOnly) {
575 576
576 const GrXPFactory* xpFactory = pipelineBuilder->getXPFactory(); 577 const GrXPFactory* xpFactory = pipelineBuilder->getXPFactory();
577 SkAutoTUnref<const GrXPFactory> backupXPFactory(SkSafeRef(xpFactory)); 578 SkAutoTUnref<const GrXPFactory> backupXPFactory(SkSafeRef(xpFactory));
578 // face culling doesn't make sense here 579 // face culling doesn't make sense here
579 SkASSERT(GrPipelineBuilder::kBoth_DrawFace == pipelineBuilder->getDrawFace() ); 580 SkASSERT(GrPipelineBuilder::kBoth_DrawFace == pipelineBuilder->getDrawFace() );
580 581
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 } 670 }
670 } 671 }
671 } else { 672 } else {
672 bounds = path.getBounds(); 673 bounds = path.getBounds();
673 } 674 }
674 const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? S kMatrix::I() : 675 const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? S kMatrix::I() :
675 v iewMatrix; 676 v iewMatrix;
676 SkAutoTUnref<GrDrawBatch> batch( 677 SkAutoTUnref<GrDrawBatch> batch(
677 GrRectBatchFactory::CreateNonAAFill(color, viewM, bounds, nu llptr, 678 GrRectBatchFactory::CreateNonAAFill(color, viewM, bounds, nu llptr,
678 &localMatrix)); 679 &localMatrix));
679 target->drawBatch(*pipelineBuilder, batch); 680 target->drawBatch(*pipelineBuilder, clip, batch);
680 } else { 681 } else {
681 if (passCount > 1) { 682 if (passCount > 1) {
682 pipelineBuilder->setDisableColorXPFactory(); 683 pipelineBuilder->setDisableColorXPFactory();
683 } 684 }
684 685
685 MSAAPathBatch::Geometry geometry; 686 MSAAPathBatch::Geometry geometry;
686 geometry.fColor = color; 687 geometry.fColor = color;
687 geometry.fPath = path; 688 geometry.fPath = path;
688 geometry.fTolerance = kTolerance; 689 geometry.fTolerance = kTolerance;
689 690
690 SkAutoTUnref<MSAAPathBatch> batch(MSAAPathBatch::Create(geometry, vi ewMatrix, 691 SkAutoTUnref<MSAAPathBatch> batch(MSAAPathBatch::Create(geometry, vi ewMatrix,
691 devBounds)); 692 devBounds));
692 if (batch->isValid()) { 693 if (batch->isValid()) {
693 target->drawBatch(*pipelineBuilder, batch); 694 target->drawBatch(*pipelineBuilder, clip, batch);
694 } 695 }
695 else { 696 else {
696 return false; 697 return false;
697 } 698 }
698 } 699 }
699 } 700 }
700 return true; 701 return true;
701 } 702 }
702 703
703 bool GrMSAAPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { 704 bool GrMSAAPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
(...skipping 17 matching lines...) Expand all
721 } 722 }
722 // We don't accept styles that are hairlines or have path effects that c ould produce 723 // We don't accept styles that are hairlines or have path effects that c ould produce
723 // hairlines. 724 // hairlines.
724 SkASSERT(SkStrokeRec::kFill_InitStyle == fill); 725 SkASSERT(SkStrokeRec::kFill_InitStyle == fill);
725 path = &tmpPath; 726 path = &tmpPath;
726 } else { 727 } else {
727 path = args.fPath; 728 path = args.fPath;
728 } 729 }
729 return this->internalDrawPath(args.fTarget, 730 return this->internalDrawPath(args.fTarget,
730 args.fPipelineBuilder, 731 args.fPipelineBuilder,
732 *args.fClip,
731 args.fColor, 733 args.fColor,
732 *args.fViewMatrix, 734 *args.fViewMatrix,
733 *path, 735 *path,
734 false); 736 false);
735 } 737 }
736 738
737 void GrMSAAPathRenderer::onStencilPath(const StencilPathArgs& args) { 739 void GrMSAAPathRenderer::onStencilPath(const StencilPathArgs& args) {
738 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrMSAAPathRenderer: :onStencilPath"); 740 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrMSAAPathRenderer: :onStencilPath");
739 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType()); 741 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType());
740 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType()); 742 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType());
741 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, * args.fViewMatrix, 743 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, *args.fClip, GrC olor_WHITE,
742 *args.fPath, true); 744 *args.fViewMatrix, *args.fPath, true);
743 } 745 }
744 746
745 //////////////////////////////////////////////////////////////////////////////// /////////////////// 747 //////////////////////////////////////////////////////////////////////////////// ///////////////////
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698