diff options
Diffstat (limited to 'src/gpu/effects/GrSingleTextureEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrSingleTextureEffect.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp index 14f5b64472..2cf83472d7 100644 --- a/src/gpu/effects/GrSingleTextureEffect.cpp +++ b/src/gpu/effects/GrSingleTextureEffect.cpp @@ -98,6 +98,17 @@ GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, GrSingleTextureEffect::~GrSingleTextureEffect() { } +void GrSingleTextureEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const { + // If the input alpha is 0xff and the texture has no alpha channel, then the output alpha is + // 0xff + if ((*validFlags & kA_ValidComponentFlag) && 0xFF == GrColorUnpackA(*color) && + GrPixelConfigIsOpaque(fTextureAccess.getTexture()->config())) { + *validFlags = kA_ValidComponentFlag; + } else { + *validFlags = 0; + } +} + const GrBackendEffectFactory& GrSingleTextureEffect::getFactory() const { return GrTBackendEffectFactory<GrSingleTextureEffect>::getInstance(); } |