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

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

Issue 330933002: Revert of 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 bbd9e0fd5d8bc6335579351bcbfc0ff5502d2c52..75c926510c69dae9bffa8306a51ea3e16eb69514 100644
--- a/Source/core/frame/ImageBitmap.cpp
+++ b/Source/core/frame/ImageBitmap.cpp
@@ -14,14 +14,16 @@
#include "platform/graphics/ImageBuffer.h"
#include "wtf/RefPtr.h"
+using namespace std;
+
namespace WebCore {
static inline IntRect normalizeRect(const IntRect& rect)
{
- 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()));
+ return IntRect(min(rect.x(), rect.maxX()),
+ min(rect.y(), rect.maxY()),
+ max(rect.width(), -rect.width()),
+ max(rect.height(), -rect.height()));
}
static inline PassRefPtr<Image> cropImage(Image* image, const IntRect& cropRect)
@@ -41,7 +43,7 @@
, m_cropRect(cropRect)
{
IntRect srcRect = intersection(cropRect, IntRect(0, 0, image->width(), image->height()));
- m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
m_bitmapOffset = srcRect.location();
if (!srcRect.width() || !srcRect.height())
@@ -74,7 +76,7 @@
c->translate(-srcRect.x(), -srcRect.y());
video->paintCurrentFrameInContext(c, videoRect);
m_bitmap = buf->copyImage(DontCopyBackingStore);
- m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
ScriptWrappable::init(this);
}
@@ -89,7 +91,7 @@
sourceContext->paintRenderingResultsToCanvas();
IntRect srcRect = intersection(cropRect, IntRect(IntPoint(), canvas->size()));
- m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
m_bitmap = cropImage(canvas->buffer()->copyImage(CopyBackingStore).get(), cropRect);
ScriptWrappable::init(this);
@@ -106,10 +108,10 @@
if (!buf)
return;
if (srcRect.width() > 0 && srcRect.height() > 0)
- buf->putByteArray(Premultiplied, data->data(), data->size(), srcRect, IntPoint(std::min(0, -cropRect.x()), std::min(0, -cropRect.y())));
+ buf->putByteArray(Premultiplied, data->data(), data->size(), srcRect, IntPoint(min(0, -cropRect.x()), min(0, -cropRect.y())));
m_bitmap = buf->copyImage(DontCopyBackingStore);
- m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), max(0, -cropRect.y())), srcRect.size());
ScriptWrappable::init(this);
}
@@ -122,7 +124,7 @@
{
IntRect oldBitmapRect = bitmap->bitmapRect();
IntRect srcRect = intersection(cropRect, oldBitmapRect);
- m_bitmapRect = IntRect(IntPoint(std::max(0, oldBitmapRect.x() - cropRect.x()), std::max(0, oldBitmapRect.y() - cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(max(0, oldBitmapRect.x() - cropRect.x()), max(0, oldBitmapRect.y() - cropRect.y())), srcRect.size());
if (m_imageElement) {
m_imageElement->addClient(this);
@@ -141,7 +143,7 @@
{
IntRect srcRect = intersection(cropRect, IntRect(IntPoint(), image->size()));
m_bitmap = cropImage(image, cropRect);
- m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
+ m_bitmapRect = IntRect(IntPoint(max(0, -cropRect.x()), 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