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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp

Issue 1367193003: NOT FOR LANDING Allocate SVGImageForContainer on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some NeedsRebaseline and revived some LayoutListMarker code that turned out to be important Created 5 years, 2 months 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
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
index 823f99d6bd660a641f067e130cf43d43f034dc25..2b0d8164702dca311babe4d7af6e1d5c0cab480c 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
@@ -79,27 +79,6 @@ FloatSize LayoutSVGImage::computeImageViewportSize(ImageResource& cachedImage) c
return intrinsicRatio;
}
-static bool containerSizeIsSetForLayoutObject(ImageResource& cachedImage, const LayoutObject* layoutObject)
-{
- const Image* image = cachedImage.image();
- // If a container size has been specified for this layoutObject, then
- // imageForLayoutObject() will return the SVGImageForContainer while image()
- // will return the underlying SVGImage.
- return !image->isSVGImage() || image != cachedImage.imageForLayoutObject(layoutObject);
-}
-
-void LayoutSVGImage::updateImageContainerSize()
-{
- ImageResource* cachedImage = m_imageResource->cachedImage();
- if (!cachedImage || !cachedImage->usesImageContainerSize())
- return;
- FloatSize imageViewportSize = computeImageViewportSize(*cachedImage);
- if (LayoutSize(imageViewportSize) != m_imageResource->imageSize(styleRef().effectiveZoom())
- || !containerSizeIsSetForLayoutObject(*cachedImage, this)) {
- m_imageResource->setContainerSizeForLayoutObject(roundedIntSize(imageViewportSize));
- }
-}
-
void LayoutSVGImage::updateBoundingBox()
{
FloatRect oldBoundaries = m_objectBoundingBox;
@@ -119,7 +98,6 @@ void LayoutSVGImage::layout()
LayoutAnalyzer::Scope analyzer(*this);
updateBoundingBox();
- updateImageContainerSize();
bool transformOrBoundariesUpdate = m_needsTransformUpdate || m_needsBoundariesUpdate;
if (m_needsTransformUpdate) {
@@ -185,10 +163,6 @@ void LayoutSVGImage::imageChanged(WrappedImagePtr, const IntRect*)
// representation of this image/layout object.
LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(this, false);
- // Update the SVGImageCache sizeAndScales entry in case image loading finished after layout.
- // (https://bugs.webkit.org/show_bug.cgi?id=99489)
- updateImageContainerSize();
-
m_bufferedForeground.clear();
setShouldDoFullPaintInvalidation();
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.h ('k') | third_party/WebKit/Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698