GrConstColorProcessor uses 4f colors in the destination space
Many places that construct one are explicitly specifying opaque white or
transparent black, which we can assume (based on the semantics of the
operation) should remain (0,0,0,0) or (1,1,1,1), so that's simple.
In other cases, we convert our source color to destination space.
One wrinkle is tht SkColorFilter now needs to know the destination color
space, due to SkModeColorFilter.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3903
Change-Id: I4969c0260588f4021300733f601b47dc606adf79
Reviewed-on: https://skia-review.googlesource.com/3903
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index fba4050..935747b 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -123,7 +123,7 @@
sk_sp<GrFragmentProcessor> src, sk_sp<GrFragmentProcessor> dst, SkXfermode::Mode mode) {
switch (mode) {
case SkXfermode::kClear_Mode:
- return GrConstColorProcessor::Make(GrColor_TRANSPARENT_BLACK,
+ return GrConstColorProcessor::Make(GrColor4f::TransparentBlack(),
GrConstColorProcessor::kIgnore_InputMode);
case SkXfermode::kSrc_Mode:
return src;
@@ -285,7 +285,7 @@
sk_sp<GrFragmentProcessor> dst, SkXfermode::Mode mode) {
switch (mode) {
case SkXfermode::kClear_Mode:
- return GrConstColorProcessor::Make(GrColor_TRANSPARENT_BLACK,
+ return GrConstColorProcessor::Make(GrColor4f::TransparentBlack(),
GrConstColorProcessor::kIgnore_InputMode);
case SkXfermode::kSrc_Mode:
return nullptr;
@@ -300,7 +300,7 @@
sk_sp<GrFragmentProcessor> src, SkXfermode::Mode mode) {
switch (mode) {
case SkXfermode::kClear_Mode:
- return GrConstColorProcessor::Make(GrColor_TRANSPARENT_BLACK,
+ return GrConstColorProcessor::Make(GrColor4f::TransparentBlack(),
GrConstColorProcessor::kIgnore_InputMode);
case SkXfermode::kDst_Mode:
return nullptr;