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

Unified Diff: src/effects/SkTableColorFilter.cpp

Issue 608253002: Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix isSolidWhite Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkTableColorFilter.cpp
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 4853f73e5c1e7461500b4906a6d145f9275ece65..f6726ca0782f79cb5ecf2a38979d503a3f391fdf 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -294,20 +294,20 @@ public:
static const char* Name() { return "ColorTable"; }
virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE;
- virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE;
-
typedef GLColorTableEffect GLProcessor;
private:
virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE;
+ virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE;
+
explicit ColorTableEffect(GrTexture* texture, unsigned flags);
GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
GrTextureAccess fTextureAccess;
unsigned fFlags; // currently not used in shader code, just to assist
- // getConstantColorComponents().
+ // onComputeInvariantOutput().
typedef GrFragmentProcessor INHERITED;
};
@@ -401,21 +401,22 @@ bool ColorTableEffect::onIsEqual(const GrProcessor& sBase) const {
return this->texture(0) == sBase.texture(0);
}
-void ColorTableEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const {
+void ColorTableEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
// If we kept the table in the effect then we could actually run known inputs through the
// table.
if (fFlags & SkTable_ColorFilter::kR_Flag) {
- *validFlags &= ~kR_GrColorComponentFlag;
+ inout->fValidFlags &= ~kR_GrColorComponentFlag;
}
if (fFlags & SkTable_ColorFilter::kG_Flag) {
- *validFlags &= ~kG_GrColorComponentFlag;
+ inout->fValidFlags &= ~kG_GrColorComponentFlag;
}
if (fFlags & SkTable_ColorFilter::kB_Flag) {
- *validFlags &= ~kB_GrColorComponentFlag;
+ inout->fValidFlags &= ~kB_GrColorComponentFlag;
}
if (fFlags & SkTable_ColorFilter::kA_Flag) {
- *validFlags &= ~kA_GrColorComponentFlag;
+ inout->fValidFlags &= ~kA_GrColorComponentFlag;
}
+ inout->fIsSingleComponent = false;
}
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698