| 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);
|
| }
|
|
|