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

Unified Diff: src/effects/SkColorMatrixFilter.cpp

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter 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/SkColorFilters.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index e4d9f52aab40fd62969b8c9f44b2e3cfb1a4e36c..b3b861a82dd964e31958709ffaedc26bc1c49937 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -452,23 +452,22 @@ private:
// If any relevant component of the color to be passed through the matrix is non-const
// then we can't know the final result.
if (0 != fMatrix.fMat[kAlphaRowStartIdx + i]) {
- if (!(inout->fValidFlags & kRGBAFlags[i])) {
- inout->fValidFlags = 0;
+ if (!(inout->validFlags() & kRGBAFlags[i])) {
+ inout->setToUnknown();
return;
} else {
- uint32_t component = (inout->fColor >> kShifts[i]) & 0xFF;
+ uint32_t component = (inout->color() >> kShifts[i]) & 0xFF;
outputA += fMatrix.fMat[kAlphaRowStartIdx + i] * component;
}
}
}
outputA += fMatrix.fMat[kAlphaRowTranslateIdx];
- inout->fValidFlags = kA_GrColorComponentFlag;
// We pin the color to [0,1]. This would happen to the *final* color output from the frag
// shader but currently the effect does not pin its own output. So in the case of over/
// underflow this may deviate from the actual result. Maybe the effect should pin its
// result if the matrix could over/underflow for any component?
- inout->fColor = static_cast<uint8_t>(SkScalarPin(outputA, 0, 255)) << GrColor_SHIFT_A;
- inout->fIsSingleComponent = false;
+ inout->setToOther(kA_GrColorComponentFlag,
+ static_cast<uint8_t>(SkScalarPin(outputA, 0, 255)) << GrColor_SHIFT_A);
}
SkColorMatrix fMatrix;
« no previous file with comments | « src/effects/SkColorFilters.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698