[iOS] Fix issues drawing subsampled image elements and CSS images
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jul 2014 22:25:50 +0000 (22:25 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jul 2014 22:25:50 +0000 (22:25 +0000)
commita1808e65def04bda0582f0a55c1abb1a754ca4b4
treea9f6c0997ad5ee92a3e507d142d05ea8a59166b4
parent83763911b863591dec83245ce00318d1153672b2
[iOS] Fix issues drawing subsampled image elements and CSS images
https://bugs.webkit.org/show_bug.cgi?id=134944
<rdar://problem/17634095>

Reviewed by Dean Jackson.

After r170675 it is important for BitmapImage::draw() to be given a srcRect computed
using the original size of the image, not the subsampled size.

So fix various code paths that end up in image drawing to use the originalSize(),
which requires giving Image a virtual function that just returns size(), and hence has
a FloatSize return value.

Tested by setting a very low subsampling threshold and browsing various sites.

A better longterm fix will happen via bug 134916.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::originalSize):
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
(WebCore::Image::computeIntrinsicDimensions):
* platform/graphics/Image.h:
(WebCore::Image::originalSize):
* platform/graphics/cg/BitmapImageCG.cpp:
(WebCore::BitmapImage::BitmapImage): Just use m_size for initializing the other members.
(WebCore::BitmapImage::draw):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::Image::drawPattern):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
Source/WebCore/platform/graphics/cg/ImageCG.cpp