Clean up RenderImage and a RenderImageResource function
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Mar 2017 01:45:39 +0000 (01:45 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Mar 2017 01:45:39 +0000 (01:45 +0000)
commit8a537424d2c9014a441a60c9d4d9cfad9ac4339f
treed99008ad3a99ed06b47876c5490e334cf92c3a3a
parent280d436caf9ce416d49bf8cdb393cbb803a09f46
Clean up RenderImage and a RenderImageResource function
https://bugs.webkit.org/show_bug.cgi?id=169153

Reviewed by Zalan Bujtas.

Change all calls to imageResource().cachedImage() in RenderImage to use the inline
cachedImage() function.

In RenderImage::paintReplaced(), early return after the broken image block (and no need
to test imageResource().hasImage() again in the second condition). Convert height/width to size,
which also forces us to be explicit about using flooredIntSize() when fetching the image
(perhaps this should be a roundedIntSize, but I didn't want to change behavior).

Change RenderImageResource::image() to take an IntSize, rather than int height and width.

No behavior change.

* rendering/RenderImage.cpp:
(WebCore::RenderImage::styleDidChange):
(WebCore::RenderImage::imageChanged):
(WebCore::RenderImage::notifyFinished):
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
(WebCore::RenderImage::embeddedContentBox):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::image):
* rendering/RenderImageResource.h:
(WebCore::RenderImageResource::image):
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::image):
* rendering/RenderImageResourceStyleImage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImageResource.cpp
Source/WebCore/rendering/RenderImageResource.h
Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
Source/WebCore/rendering/RenderImageResourceStyleImage.h