aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-09-08 09:33:50 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-08 09:33:50 -0700
commit4cea3b9e9d9836c926a8feb55d050993d40b4b5e (patch)
tree4e6f16e5bd96f10cfb9a116e00242ed76f30cd2c /include/gpu
parent3b10b37a1c5f273906249012ddbdfd37a91b3ae8 (diff)
Push usage of GrColor4f into OverrideInput
Just a change to preserve precision. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2324553002 Review-Url: https://codereview.chromium.org/2324553002
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrColor.h11
-rw-r--r--include/gpu/GrFragmentProcessor.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h
index 911b18fc16..f52671732a 100644
--- a/include/gpu/GrColor.h
+++ b/include/gpu/GrColor.h
@@ -195,6 +195,17 @@ struct GrColor4f {
return GrColor4f(color.fR, color.fG, color.fB, color.fA);
}
+ bool operator==(const GrColor4f& other) const {
+ return
+ fRGBA[0] == other.fRGBA[0] &&
+ fRGBA[1] == other.fRGBA[1] &&
+ fRGBA[2] == other.fRGBA[2] &&
+ fRGBA[3] == other.fRGBA[3];
+ }
+ bool operator!=(const GrColor4f& other) const {
+ return !(*this == other);
+ }
+
GrColor toGrColor() const {
return GrColorPackRGBA(
SkTPin<unsigned>(static_cast<unsigned>(fRGBA[0] * 255.0f + 0.5f), 0, 255),
diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h
index ffbf576dbe..f955207385 100644
--- a/include/gpu/GrFragmentProcessor.h
+++ b/include/gpu/GrFragmentProcessor.h
@@ -45,7 +45,7 @@ public:
* The parent will ignore its input color and instead feed the passed in color as input to the
* child.
*/
- static sk_sp<GrFragmentProcessor> OverrideInput(sk_sp<GrFragmentProcessor>, GrColor);
+ static sk_sp<GrFragmentProcessor> OverrideInput(sk_sp<GrFragmentProcessor>, GrColor4f);
/**
* Returns a fragment processor that premuls the input before calling the passed in fragment