aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-03-23 20:05:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-23 20:05:04 -0700
commitafced66b508ac4cd3616e2f707db27b7d6f670e1 (patch)
treef6c64e8f86555490cddf127a4b534cc85ded72a5 /src/effects
parent374a4c3b744e8c77455efa73b139950136f7b374 (diff)
correct reporting of kAlphaUnchanged_Flag in ModeFilter
BUG=skia: TBR= Review URL: https://codereview.chromium.org/1033583002
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkColorFilters.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 8bcd0ebc5d..d4723ec18f 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -27,7 +27,18 @@ bool SkModeColorFilter::asColorMode(SkColor* color, SkXfermode::Mode* mode) cons
}
uint32_t SkModeColorFilter::getFlags() const {
- return fProc16 ? (kAlphaUnchanged_Flag | kHasFilter16_Flag) : 0;
+ uint32_t flags = 0;
+ switch (fMode) {
+ case SkXfermode::kDst_Mode: //!< [Da, Dc]
+ case SkXfermode::kSrcATop_Mode: //!< [Da, Sc * Da + (1 - Sa) * Dc]
+ flags |= kAlphaUnchanged_Flag;
+ default:
+ break;
+ }
+ if (fProc16) {
+ flags |= kHasFilter16_Flag;
+ }
+ return flags;
}
void SkModeColorFilter::filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) const {
@@ -390,7 +401,7 @@ public:
uint32_t getFlags() const SK_OVERRIDE {
if (SkGetPackedA32(this->getPMColor()) == 0xFF) {
- return kAlphaUnchanged_Flag | kHasFilter16_Flag;
+ return kHasFilter16_Flag;
} else {
return 0;
}
@@ -420,7 +431,7 @@ public:
uint32_t getFlags() const SK_OVERRIDE {
if (SkGetPackedA32(this->getPMColor()) == 0xFF) {
- return kAlphaUnchanged_Flag | kHasFilter16_Flag;
+ return kHasFilter16_Flag;
} else {
return 0;
}