Chromium Code Reviews| Index: src/gpu/GrProcessor.cpp |
| diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp |
| index 45298b522d3ef9e1bf367c19ea8989a8b02f900e..79542c83b5f5d9898785e1d869491ff71b4e3d15 100644 |
| --- a/src/gpu/GrProcessor.cpp |
| +++ b/src/gpu/GrProcessor.cpp |
| @@ -88,4 +88,20 @@ void GrProcessor::assertEquality(const GrProcessor& other) const { |
| SkASSERT(this->textureAccess(i) == other.textureAccess(i)); |
| } |
| } |
| + |
| +void GrProcessor::InvarientOutput::validate() const { |
| + if (isSingleComponent) { |
| + SkASSERT(0 == validFlags || kRGBA_GrColorComponentFlags == validFlags); |
| + if (kRGBA_GrColorComponentFlags == validFlags) { |
| + SkASSERT(this->colorComponentsAllEqual()); |
| + } |
| + } |
|
bsalomon
2014/09/30 00:41:01
else {
SkASSERT(!kRGBA || !<all components the s
egdaniel
2014/10/02 14:58:33
Once we have better helper functions that will set
|
| +} |
| + |
| +bool GrProcessor::InvarientOutput::colorComponentsAllEqual() const { |
| + unsigned colorA = GrColorUnpackA(color); |
| + return(GrColorUnpackR(color) == colorA && |
| + GrColorUnpackG(color) == colorA && |
| + GrColorUnpackB(color) == colorA); |
| +} |
| #endif |