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

Unified Diff: src/effects/SkLumaColorFilter.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/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLumaColorFilter.cpp
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index ee2bfa654ccefe5529cef610c38112ec1f309016..616bcde8912631ab103395d22a224df291d5ee61 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -73,13 +73,6 @@ public:
return GrTBackendFragmentProcessorFactory<LumaColorFilterEffect>::getInstance();
}
- virtual void getConstantColorComponents(GrColor* color,
- uint32_t* validFlags) const SK_OVERRIDE {
- // The output is always black.
- *color = GrColorPackRGBA(0, 0, 0, GrColorUnpackA(*color));
- *validFlags = kRGB_GrColorComponentFlags;
- }
-
class GLProcessor : public GrGLFragmentProcessor {
public:
GLProcessor(const GrBackendProcessorFactory& factory,
@@ -119,6 +112,13 @@ private:
virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE {
return true;
}
+
+ virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE {
+ // The output is always black.
+ inout->fColor = GrColorPackRGBA(0, 0, 0, GrColorUnpackA(inout->fColor));
+ inout->fValidFlags = kRGB_GrColorComponentFlags;
+ inout->fIsSingleComponent = false;
+ }
};
GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const {
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698