Add isSingleComponent bool to getConstantColorComponent
Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b
Review URL: https://codereview.chromium.org/608253002
diff --git a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
index b9794c1..7362ba9 100644
--- a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
+++ b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
@@ -72,14 +72,13 @@
return fTextureAccess == cte.fTextureAccess;
}
-void GrCustomCoordsTextureEffect::getConstantColorComponents(GrColor* color,
- uint32_t* validFlags) const {
- if ((*validFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUnpackA(*color) &&
- GrPixelConfigIsOpaque(this->texture(0)->config())) {
- *validFlags = kA_GrColorComponentFlag;
+void GrCustomCoordsTextureEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
+ if (inout->isOpaque() && GrPixelConfigIsOpaque(this->texture(0)->config())) {
+ inout->fValidFlags = kA_GrColorComponentFlag;
} else {
- *validFlags = 0;
+ inout->fValidFlags = 0;
}
+ inout->fIsSingleComponent = false;
}
const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory() const {