virtual ~GrProcessor();
struct InvariantOutput{
- InvariantOutput() : fColor(0), fValidFlags(0), fIsSingleComponent(false) {}
+ InvariantOutput() : fColor(0), fValidFlags(0), fIsSingleComponent(false),
+ fNonMulStageFound(false) {}
void mulByUnknownOpaqueColor() {
if (this->isOpaque()) {
void mulByUnknownColor() {
if (this->hasZeroAlpha()) {
- this->setToTransparentBlack();
+ this->internalSetToTransparentBlack();
} else {
- this->setToUnknown();
+ this->internalSetToUnknown();
}
}
void mulByUnknownAlpha() {
if (this->hasZeroAlpha()) {
- this->setToTransparentBlack();
+ this->internalSetToTransparentBlack();
} else {
// We don't need to change fIsSingleComponent in this case
fValidFlags = 0;
}
void setToTransparentBlack() {
- fValidFlags = kRGBA_GrColorComponentFlags;
- fColor = 0;
- fIsSingleComponent = true;
+ this->internalSetToTransparentBlack();
+ fNonMulStageFound = true;
}
void setToOther(uint8_t validFlags, GrColor color) {
fValidFlags = validFlags;
fColor = color;
fIsSingleComponent = false;
+ fNonMulStageFound = true;
}
void setToUnknown() {
- fValidFlags = 0;
- fIsSingleComponent = false;
+ this->internalSetToUnknown();
+ fNonMulStageFound= true;
}
bool isOpaque() const {
SkDEBUGCODE(void validate() const;)
private:
+ void internalSetToTransparentBlack() {
+ fValidFlags = kRGBA_GrColorComponentFlags;
+ fColor = 0;
+ fIsSingleComponent = true;
+ }
+
+ void internalSetToUnknown() {
+ fValidFlags = 0;
+ fIsSingleComponent = false;
+ }
+
bool hasZeroAlpha() const {
return ((fValidFlags & kA_GrColorComponentFlag) && 0 == GrColorUnpackA(fColor));
}
GrColor fColor;
uint32_t fValidFlags;
bool fIsSingleComponent;
+ bool fNonMulStageFound;
};
/**