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

Unified Diff: Source/core/frame/ImageBitmap.cpp

Issue 333173002: Removing using declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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/core/frame/DOMTimer.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ImageBitmap.cpp
diff --git a/Source/core/frame/ImageBitmap.cpp b/Source/core/frame/ImageBitmap.cpp
index 75c926510c69dae9bffa8306a51ea3e16eb69514..bbd9e0fd5d8bc6335579351bcbfc0ff5502d2c52 100644
--- a/Source/core/frame/ImageBitmap.cpp
+++ b/Source/core/frame/ImageBitmap.cpp
@@ -14,16 +14,14 @@
#include "platform/graphics/ImageBuffer.h"
#include "wtf/RefPtr.h"
-using namespace std;
-
namespace WebCore {
static inline IntRect normalizeRect(const IntRect& rect)
{
- return IntRect(min(rect.x(), rect.maxX()),
- min(rect.y(), rect.maxY()),
- max(rect.width(), -rect.width()),
- max(rect.height(), -rect.height()));
+ return IntRect(std::min(rect.x(), rect.maxX()),
+ std::min(rect.y(), rect.maxY()),
+ std::max(rect.width(), -rect.width()),
+ std::max(rect.height(), -rect.height()));
}
static inline PassRefPtr<Image> cropImage(Image* image, const IntRect& cropRect)
@@ -43,7 +41,7 @@ ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect)
, m_cropRect(cropRect)
{
IntRect srcRect = intersection(cropRect, IntRect(0, 0, image->width(), image->height()));
- m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
m_bitmapOffset = srcRect.location();
if (!srcRect.width() || !srcRect.height())
@@ -76,7 +74,7 @@ ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect)
c->translate(-srcRect.x(), -srcRect.y());
video->paintCurrentFrameInContext(c, videoRect);
m_bitmap = buf->copyImage(DontCopyBackingStore);
- m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
ScriptWrappable::init(this);
}
@@ -91,7 +89,7 @@ ImageBitmap::ImageBitmap(HTMLCanvasElement* canvas, const IntRect& cropRect)
sourceContext->paintRenderingResultsToCanvas();
IntRect srcRect = intersection(cropRect, IntRect(IntPoint(), canvas->size()));
- m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
m_bitmap = cropImage(canvas->buffer()->copyImage(CopyBackingStore).get(), cropRect);
ScriptWrappable::init(this);
@@ -108,10 +106,10 @@ ImageBitmap::ImageBitmap(ImageData* data, const IntRect& cropRect)
if (!buf)
return;
if (srcRect.width() > 0 && srcRect.height() > 0)
- buf->putByteArray(Premultiplied, data->data(), data->size(), srcRect, IntPoint(min(0, -cropRect.x()), min(0, -cropRect.y())));
+ buf->putByteArray(Premultiplied, data->data(), data->size(), srcRect, IntPoint(std::min(0, -cropRect.x()), std::min(0, -cropRect.y())));
m_bitmap = buf->copyImage(DontCopyBackingStore);
- m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
ScriptWrappable::init(this);
}
@@ -124,7 +122,7 @@ ImageBitmap::ImageBitmap(ImageBitmap* bitmap, const IntRect& cropRect)
{
IntRect oldBitmapRect = bitmap->bitmapRect();
IntRect srcRect = intersection(cropRect, oldBitmapRect);
- m_bitmapRect = IntRect(IntPoint(max(0, oldBitmapRect.x() - cropRect.x()), max(0, oldBitmapRect.y() - cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(std::max(0, oldBitmapRect.x() - cropRect.x()), std::max(0, oldBitmapRect.y() - cropRect.y())), srcRect.size());
if (m_imageElement) {
m_imageElement->addClient(this);
@@ -143,7 +141,7 @@ ImageBitmap::ImageBitmap(Image* image, const IntRect& cropRect)
{
IntRect srcRect = intersection(cropRect, IntRect(IntPoint(), image->size()));
m_bitmap = cropImage(image, cropRect);
- m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
ScriptWrappable::init(this);
}
« no previous file with comments | « Source/core/frame/DOMTimer.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698