REGRESSION (r154375): Image is oriented incorrectly
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2013 03:55:30 +0000 (03:55 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2013 03:55:30 +0000 (03:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123831

Reviewed by Antonio Gomes.

r154375 made that shouldRespectImageOrientation() isn't used by drawImage().
It causes an image isn't oriented correctly. This patch sets shouldRespectImageOrientation()
value by default.

* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderImage.cpp

index a1b0de3..9089c78 100644 (file)
@@ -1,3 +1,18 @@
+2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        REGRESSION (r154375): Image is oriented incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=123831
+
+        Reviewed by Antonio Gomes.
+
+        r154375 made that shouldRespectImageOrientation() isn't used by drawImage().
+        It causes an image isn't oriented correctly. This patch sets shouldRespectImageOrientation()
+        value by default.
+
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintReplaced):
+        (WebCore::RenderImage::paintIntoRect):
+
 2013-11-07  Hans Muller  <hmuller@adobe.com>
 
         [CSS Shapes] Image shape-outside with vertical gaps is handled incorrectly
index dc086b3..de8925f 100644 (file)
@@ -391,10 +391,9 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
                     centerY = 0;
                 imageOffset = LayoutSize(leftBorder + leftPad + centerX + borderWidth, topBorder + topPad + centerY + borderWidth);
 
-                ImageOrientationDescription orientationDescription;
+                ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
 #if ENABLE(CSS_IMAGE_ORIENTATION)
                 orientationDescription.setImageOrientationEnum(style().imageOrientation());
-                orientationDescription.setRespectImageOrientation(shouldRespectImageOrientation());
 #endif
                 context->drawImage(image.get(), style().colorSpace(), pixelSnappedIntRect(LayoutRect(paintOffset + imageOffset, imageSize)), CompositeSourceOver, orientationDescription);
                 errorPictureDrawn = true;
@@ -523,10 +522,9 @@ void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
     CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
     Image* image = m_imageResource->image().get();
     bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
-    ImageOrientationDescription orientationDescription;
+    ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
 #if ENABLE(CSS_IMAGE_ORIENTATION)
     orientationDescription.setImageOrientationEnum(style().imageOrientation());
-    orientationDescription.setRespectImageOrientation(shouldRespectImageOrientation());
 #endif
     context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.height()).get(), style().colorSpace(), alignedRect, compositeOperator, orientationDescription, useLowQualityScaling);
 }