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

Unified Diff: third_party/WebKit/Source/core/style/StyleFetchedImage.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/style/StyleFetchedImage.cpp
diff --git a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
index 63fc68a53f2b7c46ff50f331cf6e6665aa678b8e..f1958cee1ff2f4a640e26364cf782f78ba8b8016 100644
--- a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
@@ -28,12 +28,14 @@
#include "core/fetch/ImageResource.h"
#include "core/layout/LayoutObject.h"
#include "core/svg/graphics/SVGImage.h"
+#include "core/svg/graphics/SVGImageForContainer.h"
namespace blink {
-StyleFetchedImage::StyleFetchedImage(ImageResource* image, Document* document)
+StyleFetchedImage::StyleFetchedImage(ImageResource* image, Document* document, const KURL& urlWithFragment)
: m_image(image)
, m_document(document)
+ , m_urlWithFragment(urlWithFragment)
{
m_isImageResource = true;
m_image->addClient(this);
@@ -104,11 +106,6 @@ bool StyleFetchedImage::usesImageContainerSize() const
return m_image->usesImageContainerSize();
}
-void StyleFetchedImage::setContainerSizeForLayoutObject(const LayoutObject* layoutObject, const IntSize& imageContainerSize, float imageContainerZoomFactor)
-{
- m_image->setContainerSizeForLayoutObject(layoutObject, imageContainerSize, imageContainerZoomFactor);
-}
-
void StyleFetchedImage::addClient(LayoutObject* layoutObject)
{
m_image->addClient(layoutObject);
@@ -127,9 +124,12 @@ void StyleFetchedImage::notifyFinished(Resource* resource)
m_document.clear();
}
-PassRefPtr<Image> StyleFetchedImage::image(const LayoutObject* layoutObject, const IntSize&) const
+PassRefPtr<Image> StyleFetchedImage::image(const LayoutObject*, const IntSize& containerSize, float zoom, const KURL& url) const
{
- return m_image->imageForLayoutObject(layoutObject);
+ RefPtr<Image> image = m_image->image();
+ if (image->isSVGImage())
+ return SVGImageForContainer::create(toSVGImage(image.get()), containerSize, zoom, url);
+ return image;
}
bool StyleFetchedImage::knownToBeOpaque(const LayoutObject* layoutObject) const
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleFetchedImage.h ('k') | third_party/WebKit/Source/core/style/StyleFetchedImageSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698