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

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

Issue 1339183003: NOT FOR LANDING Experiment with allocating SVGImageForContainer on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 3 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
« no previous file with comments | « Source/core/layout/svg/LayoutSVGImage.h ('k') | Source/core/paint/BackgroundImageGeometry.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGImage.cpp
diff --git a/Source/core/layout/svg/LayoutSVGImage.cpp b/Source/core/layout/svg/LayoutSVGImage.cpp
index 9bbb4d5212afe9f251da752609c6f9de440cd20f..cba229a0479a4d1616199eb085031c3fa07fc3af 100644
--- a/Source/core/layout/svg/LayoutSVGImage.cpp
+++ b/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 | « Source/core/layout/svg/LayoutSVGImage.h ('k') | Source/core/paint/BackgroundImageGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698