| 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 5f2f51ab3015ec90aceb98df1b6a28cfbb6b9533..dc9364edbde2bea1f7c0a43392244b658f961551 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/Color.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/Color.cpp
|
| @@ -50,17 +50,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)
|
|
|