Index: third_party/WebKit/Source/core/page/DragController.cpp |
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp |
index bef7db43ba5cda0f96b52880e5c9b909ed8e44ac..7af497c58fac283d112be44bac1876aebd41a6ac 100644 |
--- a/third_party/WebKit/Source/core/page/DragController.cpp |
+++ b/third_party/WebKit/Source/core/page/DragController.cpp |
@@ -71,6 +71,7 @@ |
#include "core/layout/LayoutImage.h" |
#include "platform/DragImage.h" |
#include "platform/geometry/IntRect.h" |
+#include "platform/graphics/BitmapImage.h" |
#include "platform/graphics/Image.h" |
#include "platform/graphics/ImageOrientation.h" |
#include "platform/network/ResourceRequest.h" |
@@ -799,11 +800,16 @@ static PassOwnPtr<DragImage> dragImageForImage(Element* element, Image* image, c |
IntPoint origin; |
InterpolationQuality interpolationQuality = element->ensureComputedStyle()->imageRendering() == ImageRenderingPixelated ? InterpolationNone : InterpolationHigh; |
+ RespectImageOrientationEnum shouldRespectImageOrientation = element->layoutObject() ? element->layoutObject()->shouldRespectImageOrientation() : DoNotRespectImageOrientation; |
+ ImageOrientation orientation; |
Noel Gordon
2015/09/25 00:12:19
nit: add a space before this line.
|
+ if (shouldRespectImageOrientation == RespectImageOrientation && image->isBitmapImage()) { |
+ BitmapImage* bitmapImage = toBitmapImage(image); |
Noel Gordon
2015/09/25 00:12:19
Remove the {} on this if clause and instead write
|
+ orientation = bitmapImage->currentFrameOrientation(); |
+ } |
if (image->size().height() * image->size().width() <= MaxOriginalImageArea |
Noel Gordon
2015/09/25 00:12:19
Add a space before this if clause: this is not a l
|
- && (dragImage = DragImage::create(image, |
- element->layoutObject() ? element->layoutObject()->shouldRespectImageOrientation() : DoNotRespectImageOrientation, |
+ && (dragImage = DragImage::create(image, shouldRespectImageOrientation, |
1 /* deviceScaleFactor */, interpolationQuality, DragImageAlpha, |
- DragImage::clampedImageScale(*image, imageRect.size(), maxDragImageSize())))) { |
+ DragImage::clampedImageScale(orientation.usesWidthAsHeight() ? image->size().transposedSize() : image->size(), imageRect.size(), maxDragImageSize())))) { |
IntSize originalSize = imageRect.size(); |
origin = imageRect.location(); |