Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: sky/engine/core/rendering/style/StyleGeneratedImage.cpp

Issue 711203002: Remove zoom() and effectiveZoom(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/style/StyleGeneratedImage.h ('k') | sky/engine/core/rendering/style/StyleImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/style/StyleGeneratedImage.cpp
diff --git a/sky/engine/core/rendering/style/StyleGeneratedImage.cpp b/sky/engine/core/rendering/style/StyleGeneratedImage.cpp
index a43acfec2387189faa6c41009c9663a812fbc0e1..e3419a7ee3dd716f02505e80dfb111e3af2be9db 100644
--- a/sky/engine/core/rendering/style/StyleGeneratedImage.cpp
+++ b/sky/engine/core/rendering/style/StyleGeneratedImage.cpp
@@ -42,33 +42,17 @@ PassRefPtr<CSSValue> StyleGeneratedImage::cssValue() const
return m_imageGeneratorValue.get();
}
-LayoutSize StyleGeneratedImage::imageSize(const RenderObject* renderer, float multiplier) const
+LayoutSize StyleGeneratedImage::imageSize(const RenderObject* renderer) const
{
- if (m_fixedSize) {
- IntSize fixedSize = m_imageGeneratorValue->fixedSize(renderer);
- if (multiplier == 1.0f)
- return fixedSize;
-
- LayoutUnit width = fixedSize.width() * multiplier;
- LayoutUnit height = fixedSize.height() * multiplier;
-
- // Don't let images that have a width/height >= 1 shrink below 1 when zoomed.
- if (fixedSize.width() > 0)
- width = max<LayoutUnit>(1, width);
-
- if (fixedSize.height() > 0)
- height = max<LayoutUnit>(1, height);
-
- return LayoutSize(width, height);
- }
-
+ if (m_fixedSize)
+ return m_imageGeneratorValue->fixedSize(renderer);
return m_containerSize;
}
void StyleGeneratedImage::computeIntrinsicDimensions(const RenderObject* renderer, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
{
// At a zoom level of 1 the image is guaranteed to have an integer size.
- IntSize size = flooredIntSize(imageSize(renderer, 1));
+ IntSize size = flooredIntSize(imageSize(renderer));
intrinsicWidth = Length(size.width(), Fixed);
intrinsicHeight = Length(size.height(), Fixed);
intrinsicRatio = size;
« no previous file with comments | « sky/engine/core/rendering/style/StyleGeneratedImage.h ('k') | sky/engine/core/rendering/style/StyleImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698