Index: third_party/WebKit/Source/core/fetch/ImageResource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
index 93853b0271992d367300e8e9b9334bc069ff02a5..65d4b6c90d16c78407b8130034ceaa4d13fc93b7 100644 |
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
@@ -215,34 +215,34 @@ bool ImageResource::imageHasRelativeHeight() const |
return false; |
} |
-LayoutSize ImageResource::imageSizeForLayoutObject(const LayoutObject* layoutObject, float multiplier, SizeType sizeType) |
+LayoutSize ImageResource::imageSize(RespectImageOrientationEnum shouldRespectImageOrientation, float multiplier, SizeType sizeType) |
{ |
ASSERT(!isPurgeable()); |
if (!m_image) |
return LayoutSize(); |
- LayoutSize imageSize; |
+ LayoutSize size; |
- if (m_image->isBitmapImage() && (layoutObject && layoutObject->shouldRespectImageOrientation() == RespectImageOrientation)) |
- imageSize = LayoutSize(toBitmapImage(m_image.get())->sizeRespectingOrientation()); |
+ if (m_image->isBitmapImage() && shouldRespectImageOrientation == RespectImageOrientation) |
+ size = LayoutSize(toBitmapImage(m_image.get())->sizeRespectingOrientation()); |
else |
- imageSize = LayoutSize(m_image->size()); |
+ size = LayoutSize(m_image->size()); |
if (sizeType == IntrinsicCorrectedToDPR && m_hasDevicePixelRatioHeaderValue && m_devicePixelRatioHeaderValue > 0) |
multiplier = 1.0 / m_devicePixelRatioHeaderValue; |
if (multiplier == 1.0f) |
- return imageSize; |
+ return size; |
// Don't let images that have a width/height >= 1 shrink below 1 when zoomed. |
float widthScale = m_image->hasRelativeWidth() ? 1.0f : multiplier; |
float heightScale = m_image->hasRelativeHeight() ? 1.0f : multiplier; |
- LayoutSize minimumSize(imageSize.width() > 0 ? 1 : 0, imageSize.height() > 0 ? 1 : 0); |
- imageSize.scale(widthScale, heightScale); |
- imageSize.clampToMinimumSize(minimumSize); |
- ASSERT(multiplier != 1.0f || (imageSize.width().fraction() == 0.0f && imageSize.height().fraction() == 0.0f)); |
- return imageSize; |
+ LayoutSize minimumSize(size.width() > 0 ? 1 : 0, size.height() > 0 ? 1 : 0); |
+ size.scale(widthScale, heightScale); |
+ size.clampToMinimumSize(minimumSize); |
+ ASSERT(multiplier != 1.0f || (size.width().fraction() == 0.0f && size.height().fraction() == 0.0f)); |
+ return size; |
} |
void ImageResource::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) |