Index: Source/core/rendering/RenderImageResource.cpp |
diff --git a/Source/core/rendering/RenderImageResource.cpp b/Source/core/rendering/RenderImageResource.cpp |
index 61301870230f8eafc483f877c34cafa9eec661b2..ffd1dc3f53bf1797b846b43ea17b286e76d90308 100644 |
--- a/Source/core/rendering/RenderImageResource.cpp |
+++ b/Source/core/rendering/RenderImageResource.cpp |
@@ -30,6 +30,7 @@ |
#include "core/fetch/ImageResource.h" |
#include "core/platform/graphics/Image.h" |
+#include "core/rendering/RenderImage.h" |
#include "core/rendering/RenderObject.h" |
namespace WebCore { |
@@ -103,4 +104,14 @@ Image* RenderImageResource::nullImage() |
return Image::nullImage(); |
} |
+LayoutSize RenderImageResource::getImageSize(float multiplier, ImageResource::SizeType type) const |
+{ |
+ if (!m_cachedImage) |
+ return LayoutSize(); |
+ LayoutSize size = m_cachedImage->imageSizeForRenderer(m_renderer, multiplier, type); |
+ if (m_renderer && m_renderer->isRenderImage()) |
+ size.scale(toRenderImage(m_renderer)->imageDevicePixelRatio()); |
+ return size; |
+} |
+ |
} // namespace WebCore |