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

Side by Side Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 820523002: initial changes to add local matrix to primitive processor (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup-ccm-above-context
Patch Set: cleanup Created 6 years 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
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 GLProcessor::GenKey(*this, bt, caps, b); 603 GLProcessor::GenKey(*this, bt, caps, b);
604 } 604 }
605 605
606 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co nst SK_OVERRIDE { 606 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co nst SK_OVERRIDE {
607 return SkNEW_ARGS(GLProcessor, (*this, bt)); 607 return SkNEW_ARGS(GLProcessor, (*this, bt));
608 } 608 }
609 609
610 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR IDE { 610 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR IDE {
611 BatchTracker* local = bt->cast<BatchTracker>(); 611 BatchTracker* local = bt->cast<BatchTracker>();
612 local->fInputColorType = GetColorInputType(&local->fColor, this->color() , init, false); 612 local->fInputColorType = GetColorInputType(&local->fColor, this->color() , init, false);
613 local->fUsesLocalCoords = init.fUsesLocalCoords;
613 } 614 }
614 615
615 bool onCanMakeEqual(const GrBatchTracker& m, const GrBatchTracker& t) const SK_OVERRIDE { 616 bool onCanMakeEqual(const GrBatchTracker& m,
617 const GrGeometryProcessor& that,
618 const GrBatchTracker& t) const SK_OVERRIDE {
616 const BatchTracker& mine = m.cast<BatchTracker>(); 619 const BatchTracker& mine = m.cast<BatchTracker>();
617 const BatchTracker& theirs = t.cast<BatchTracker>(); 620 const BatchTracker& theirs = t.cast<BatchTracker>();
618 return CanCombineOutput(mine.fInputColorType, mine.fColor, 621 return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
622 that, theirs.fUsesLocalCoords) &&
623 CanCombineOutput(mine.fInputColorType, mine.fColor,
619 theirs.fInputColorType, theirs.fColor); 624 theirs.fInputColorType, theirs.fColor);
620 } 625 }
621 626
622 private: 627 private:
623 QuadEdgeEffect(GrColor color) : INHERITED(color) { 628 QuadEdgeEffect(GrColor color) : INHERITED(color) {
624 this->initClassID<QuadEdgeEffect>(); 629 this->initClassID<QuadEdgeEffect>();
625 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr VertexAttribType)); 630 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_Gr VertexAttribType));
626 fInQuadEdge = &this->addVertexAttrib(GrAttribute("inQuadEdge", kVec4f_Gr VertexAttribType)); 631 fInQuadEdge = &this->addVertexAttrib(GrAttribute("inQuadEdge", kVec4f_Gr VertexAttribType));
627 } 632 }
628 633
629 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { 634 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE {
630 return true; 635 return true;
631 } 636 }
632 637
633 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE { 638 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE {
634 out->setUnknownSingleComponent(); 639 out->setUnknownSingleComponent();
635 } 640 }
636 641
637 struct BatchTracker { 642 struct BatchTracker {
638 GrGPInput fInputColorType; 643 GrGPInput fInputColorType;
639 GrColor fColor; 644 GrColor fColor;
645 bool fUsesLocalCoords;
640 }; 646 };
641 647
642 const GrAttribute* fInPosition; 648 const GrAttribute* fInPosition;
643 const GrAttribute* fInQuadEdge; 649 const GrAttribute* fInQuadEdge;
644 650
645 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 651 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
646 652
647 typedef GrGeometryProcessor INHERITED; 653 typedef GrGeometryProcessor INHERITED;
648 }; 654 };
649 655
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 vOffset, // start vertex 758 vOffset, // start vertex
753 0, // start index 759 0, // start index
754 draw.fVertexCnt, 760 draw.fVertexCnt,
755 draw.fIndexCnt, 761 draw.fIndexCnt,
756 &devBounds); 762 &devBounds);
757 vOffset += draw.fVertexCnt; 763 vOffset += draw.fVertexCnt;
758 } 764 }
759 765
760 return true; 766 return true;
761 } 767 }
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698