Fall out of simple image layer optimization if the image has EXIF rotation
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2013 19:52:37 +0000 (19:52 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2013 19:52:37 +0000 (19:52 +0000)
commit70333b38b4a18ca29b8302aba4ef8830989a829c
treea5c4a485fee1fd4273b8c9777506c4be2377ebd0
parent005d5e45f3896c9116e3c877bfbce8cfa1b7a2bd
Fall out of simple image layer optimization if the image has EXIF rotation
https://bugs.webkit.org/show_bug.cgi?id=119535
<rdar://problem/14071174>

Reviewed by Simon Fraser.

Test: fast/images/exif-orientation-composited.html

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameOrientationAtIndex):
Ensure that the frame is cached if we're requesting the orientation,
so we can acquire orientation information at any given time.

* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage):
* platform/graphics/BitmapImage.h:
Rename currentFrameOrientation to frameOrientationForCurrentFrame to match
the similarly-behaving nativeImageForCurrentFrame.

* platform/graphics/Image.h:
(WebCore::Image::orientationForCurrentFrame): Added. Virtual, overriden by BitmapImage.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isDirectlyCompositedImage):
If the given image has a non-default image orientation, don't use direct compositing.

Add a test that ensures that composited images with EXIF orientation paint correctly.

* fast/images/exif-orientation-composited-expected.txt: Added.
* fast/images/exif-orientation-composited.html: Added.
* platform/mac/fast/images/exif-orientation-composited-expected.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/images/exif-orientation-composited-expected.txt [new file with mode: 0644]
LayoutTests/fast/images/exif-orientation-composited.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/images/exif-orientation-composited-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/rendering/RenderLayerBacking.cpp