| Index: third_party/WebKit/Source/platform/graphics/Color.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/Color.cpp b/third_party/WebKit/Source/platform/graphics/Color.cpp
|
| index 3bce2cc162277667e6bcfcad4fc817a5fa797488..67663b735028e876ab0664cdbfc4b4dcc4b44b55 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/Color.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/Color.cpp
|
| @@ -51,17 +51,17 @@ static const RGBA32 darkenedWhite = 0xFFABABAB;
|
|
|
| RGBA32 makeRGB(int r, int g, int b)
|
| {
|
| - return 0xFF000000 | std::max(0, std::min(r, 255)) << 16 | std::max(0, std::min(g, 255)) << 8 | std::max(0, std::min(b, 255));
|
| + return 0xFF000000 | clampTo(r, 0, 255) << 16 | clampTo(g, 0, 255) << 8 | clampTo(b, 0, 255);
|
| }
|
|
|
| RGBA32 makeRGBA(int r, int g, int b, int a)
|
| {
|
| - return std::max(0, std::min(a, 255)) << 24 | std::max(0, std::min(r, 255)) << 16 | std::max(0, std::min(g, 255)) << 8 | std::max(0, std::min(b, 255));
|
| + return clampTo(a, 0, 255) << 24 | clampTo(r, 0, 255) << 16 | clampTo(g, 0, 255) << 8 | clampTo(b, 0, 255);
|
| }
|
|
|
| static int colorFloatToRGBAByte(float f)
|
| {
|
| - return std::max(0, std::min(static_cast<int>(lroundf(255.0f * f)), 255));
|
| + return clampTo(static_cast<int>(lroundf(255.0f * f)), 0, 255);
|
| }
|
|
|
| RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a)
|
|
|