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

Side by Side Diff: src/gpu/effects/GrRRectEffect.cpp

Issue 1734163002: Replace fWillReadFragmentPosition with a bitfield (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 2014 Google Inc. 2 * Copyright 2014 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 "GrRRectEffect.h" 8 #include "GrRRectEffect.h"
9 9
10 #include "GrConvexPolyEffect.h" 10 #include "GrConvexPolyEffect.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void CircularRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) con st { 90 void CircularRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) con st {
91 inout->mulByUnknownSingleComponent(); 91 inout->mulByUnknownSingleComponent();
92 } 92 }
93 93
94 CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t circularCornerFlags, 94 CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t circularCornerFlags,
95 const SkRRect& rrect) 95 const SkRRect& rrect)
96 : fRRect(rrect) 96 : fRRect(rrect)
97 , fEdgeType(edgeType) 97 , fEdgeType(edgeType)
98 , fCircularCornerFlags(circularCornerFlags) { 98 , fCircularCornerFlags(circularCornerFlags) {
99 this->initClassID<CircularRRectEffect>(); 99 this->initClassID<CircularRRectEffect>();
100 this->setWillReadFragmentPosition(); 100 this->enableBuiltInState(kFragmentPosition_BuiltInState);
101 } 101 }
102 102
103 bool CircularRRectEffect::onIsEqual(const GrFragmentProcessor& other) const { 103 bool CircularRRectEffect::onIsEqual(const GrFragmentProcessor& other) const {
104 const CircularRRectEffect& crre = other.cast<CircularRRectEffect>(); 104 const CircularRRectEffect& crre = other.cast<CircularRRectEffect>();
105 // The corner flags are derived from fRRect, so no need to check them. 105 // The corner flags are derived from fRRect, so no need to check them.
106 return fEdgeType == crre.fEdgeType && fRRect == crre.fRRect; 106 return fEdgeType == crre.fEdgeType && fRRect == crre.fRRect;
107 } 107 }
108 108
109 ////////////////////////////////////////////////////////////////////////////// 109 //////////////////////////////////////////////////////////////////////////////
110 110
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 } 425 }
426 426
427 void EllipticalRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c onst { 427 void EllipticalRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c onst {
428 inout->mulByUnknownSingleComponent(); 428 inout->mulByUnknownSingleComponent();
429 } 429 }
430 430
431 EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const SkRRect& rrect) 431 EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const SkRRect& rrect)
432 : fRRect(rrect) 432 : fRRect(rrect)
433 , fEdgeType(edgeType) { 433 , fEdgeType(edgeType) {
434 this->initClassID<EllipticalRRectEffect>(); 434 this->initClassID<EllipticalRRectEffect>();
435 this->setWillReadFragmentPosition(); 435 this->enableBuiltInState(kFragmentPosition_BuiltInState);
436 } 436 }
437 437
438 bool EllipticalRRectEffect::onIsEqual(const GrFragmentProcessor& other) const { 438 bool EllipticalRRectEffect::onIsEqual(const GrFragmentProcessor& other) const {
439 const EllipticalRRectEffect& erre = other.cast<EllipticalRRectEffect>(); 439 const EllipticalRRectEffect& erre = other.cast<EllipticalRRectEffect>();
440 return fEdgeType == erre.fEdgeType && fRRect == erre.fRRect; 440 return fEdgeType == erre.fEdgeType && fRRect == erre.fRRect;
441 } 441 }
442 442
443 ////////////////////////////////////////////////////////////////////////////// 443 //////////////////////////////////////////////////////////////////////////////
444 444
445 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(EllipticalRRectEffect); 445 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(EllipticalRRectEffect);
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 if (rrect.isNinePatch()) { 769 if (rrect.isNinePatch()) {
770 return EllipticalRRectEffect::Create(edgeType, rrect); 770 return EllipticalRRectEffect::Create(edgeType, rrect);
771 } 771 }
772 return nullptr; 772 return nullptr;
773 } 773 }
774 } 774 }
775 } 775 }
776 776
777 return nullptr; 777 return nullptr;
778 } 778 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698