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

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

Issue 1110993002: Revert of removing equality / compute invariant loops from GrGeometryProcessors (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup1
Patch Set: Created 5 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
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrAADistanceFieldPathRenderer.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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 const GrGLCaps&) const over ride { 616 const GrGLCaps&) const over ride {
617 return SkNEW_ARGS(GLProcessor, (*this, bt)); 617 return SkNEW_ARGS(GLProcessor, (*this, bt));
618 } 618 }
619 619
620 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override { 620 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override {
621 BatchTracker* local = bt->cast<BatchTracker>(); 621 BatchTracker* local = bt->cast<BatchTracker>();
622 local->fInputColorType = GetColorInputType(&local->fColor, this->color() , init, false); 622 local->fInputColorType = GetColorInputType(&local->fColor, this->color() , init, false);
623 local->fUsesLocalCoords = init.fUsesLocalCoords; 623 local->fUsesLocalCoords = init.fUsesLocalCoords;
624 } 624 }
625 625
626 bool onCanMakeEqual(const GrBatchTracker& m,
627 const GrGeometryProcessor& that,
628 const GrBatchTracker& t) const override {
629 const BatchTracker& mine = m.cast<BatchTracker>();
630 const BatchTracker& theirs = t.cast<BatchTracker>();
631 return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
632 that, theirs.fUsesLocalCoords) &&
633 CanCombineOutput(mine.fInputColorType, mine.fColor,
634 theirs.fInputColorType, theirs.fColor);
635 }
636
626 private: 637 private:
627 QuadEdgeEffect(GrColor color, const SkMatrix& localMatrix) 638 QuadEdgeEffect(GrColor color, const SkMatrix& localMatrix)
628 : INHERITED(color, SkMatrix::I(), localMatrix) { 639 : INHERITED(color, SkMatrix::I(), localMatrix) {
629 this->initClassID<QuadEdgeEffect>(); 640 this->initClassID<QuadEdgeEffect>();
630 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe rtexAttribType)); 641 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe rtexAttribType));
631 fInQuadEdge = &this->addVertexAttrib(Attribute("inQuadEdge", kVec4f_GrVe rtexAttribType)); 642 fInQuadEdge = &this->addVertexAttrib(Attribute("inQuadEdge", kVec4f_GrVe rtexAttribType));
632 } 643 }
633 644
645 bool onIsEqual(const GrGeometryProcessor& other) const override {
646 return true;
647 }
648
649 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
650 out->setUnknownSingleComponent();
651 }
652
634 struct BatchTracker { 653 struct BatchTracker {
635 GrGPInput fInputColorType; 654 GrGPInput fInputColorType;
636 GrColor fColor; 655 GrColor fColor;
637 bool fUsesLocalCoords; 656 bool fUsesLocalCoords;
638 }; 657 };
639 658
640 const Attribute* fInPosition; 659 const Attribute* fInPosition;
641 const Attribute* fInQuadEdge; 660 const Attribute* fInQuadEdge;
642 661
643 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 662 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 geometry.fColor = color; 885 geometry.fColor = color;
867 geometry.fViewMatrix = vm; 886 geometry.fViewMatrix = vm;
868 geometry.fPath = path; 887 geometry.fPath = path;
869 888
870 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); 889 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry));
871 target->drawBatch(pipelineBuilder, batch, &devRect); 890 target->drawBatch(pipelineBuilder, batch, &devRect);
872 891
873 return true; 892 return true;
874 893
875 } 894 }
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698