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

Unified Diff: src/effects/SkColorFilters.cpp

Issue 1033583002: correct reporting of kAlphaUnchanged_Flag in ModeFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorFilters.cpp
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 8bcd0ebc5d67d96acf3d94149a744e30fd23f292..d4723ec18f6057623110a4e0a568f2da1e3398e7 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698