Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1453)

Unified Diff: Source/platform/graphics/Color.cpp

Issue 519463002: Removing "using" declarations that import names in the C++ Standard library.(Source/platform/[geome… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/geometry/RoundedRect.cpp ('k') | Source/platform/graphics/CrossfadeGeneratedImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Color.cpp
diff --git a/Source/platform/graphics/Color.cpp b/Source/platform/graphics/Color.cpp
index 07a471ccce804e040f903b50387932ec2168a479..bd88d5de3d15d56c0fc33bfb1052366299c5255c 100644
--- a/Source/platform/graphics/Color.cpp
+++ b/Source/platform/graphics/Color.cpp
@@ -33,8 +33,6 @@
#include "wtf/dtoa.h"
#include "wtf/text/StringBuilder.h"
-using namespace std;
-
namespace blink {
#if !COMPILER(MSVC)
@@ -52,18 +50,18 @@ static const RGBA32 darkenedWhite = 0xFFABABAB;
RGBA32 makeRGB(int r, int g, int b)
{
- return 0xFF000000 | max(0, min(r, 255)) << 16 | max(0, min(g, 255)) << 8 | max(0, min(b, 255));
+ 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));
}
RGBA32 makeRGBA(int r, int g, int b, int a)
{
- return max(0, min(a, 255)) << 24 | max(0, min(r, 255)) << 16 | max(0, min(g, 255)) << 8 | max(0, min(b, 255));
+ 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));
}
static int colorFloatToRGBAByte(float f)
{
// We use lroundf and 255 instead of nextafterf(256, 0) to match CG's rounding
- return max(0, min(static_cast<int>(lroundf(255.0f * f)), 255));
+ return std::max(0, std::min(static_cast<int>(lroundf(255.0f * f)), 255));
}
RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a)
@@ -291,13 +289,13 @@ Color Color::light() const
float r, g, b, a;
getRGBA(r, g, b, a);
- float v = max(r, max(g, b));
+ float v = std::max(r, std::max(g, b));
if (v == 0.0f)
// Lightened black with alpha.
return Color(0x54, 0x54, 0x54, alpha());
- float multiplier = min(1.0f, v + 0.33f) / v;
+ float multiplier = std::min(1.0f, v + 0.33f) / v;
return Color(static_cast<int>(multiplier * r * scaleFactor),
static_cast<int>(multiplier * g * scaleFactor),
@@ -316,8 +314,8 @@ Color Color::dark() const
float r, g, b, a;
getRGBA(r, g, b, a);
- float v = max(r, max(g, b));
- float multiplier = max(0.0f, (v - 0.33f) / v);
+ float v = std::max(r, std::max(g, b));
+ float multiplier = std::max(0.0f, (v - 0.33f) / v);
return Color(static_cast<int>(multiplier * r * scaleFactor),
static_cast<int>(multiplier * g * scaleFactor),
« no previous file with comments | « Source/platform/geometry/RoundedRect.cpp ('k') | Source/platform/graphics/CrossfadeGeneratedImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698