aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2016-12-04 16:08:14 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-04 21:39:43 +0000
commit8b4b56ac2927bbb31c634f840916f4ce948d2f53 (patch)
tree8085ab368e66c687e40392d6438c307c4627ca66
parentd87fbee77524f83f0eccb7860516d1696e318a96 (diff)
Fix max/min error
BUG=skia: Change-Id: I6a690e843476e31077a90a8312f6335d8ef230f4 Reviewed-on: https://skia-review.googlesource.com/5544 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
-rw-r--r--src/core/SkColorSpaceXform.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp
index c5efbec2b9..fb603db45e 100644
--- a/src/core/SkColorSpaceXform.cpp
+++ b/src/core/SkColorSpaceXform.cpp
@@ -630,9 +630,9 @@ static AI void translate_gamut_1(const Sk4f& rTgTbT, Sk4f& rgba) {
static AI void premultiply(Sk4f& dr, Sk4f& dg, Sk4f& db, const Sk4f& da, bool kClamp) {
if (kClamp) {
- dr = Sk4f::Max(dr, 1.0f);
- dg = Sk4f::Max(dg, 1.0f);
- db = Sk4f::Max(db, 1.0f);
+ dr = Sk4f::Min(dr, 1.0f);
+ dg = Sk4f::Min(dg, 1.0f);
+ db = Sk4f::Min(db, 1.0f);
}
dr = da * dr;
@@ -642,7 +642,7 @@ static AI void premultiply(Sk4f& dr, Sk4f& dg, Sk4f& db, const Sk4f& da, bool kC
static AI void premultiply_1(const Sk4f& a, Sk4f& rgba, bool kClamp) {
if (kClamp) {
- rgba = Sk4f::Max(rgba, 1.0f);
+ rgba = Sk4f::Min(rgba, 1.0f);
}
rgba = a * rgba;