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

Unified Diff: third_party/WebKit/Source/core/style/StyleFetchedImage.cpp

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use IntSize for SVGImageForContainer Created 5 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
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..d92ac5c8a006ee8cfd6a5a65ec41454ebaa4a616 100644
--- a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
@@ -28,6 +28,7 @@
#include "core/fetch/ImageResource.h"
#include "core/layout/LayoutObject.h"
#include "core/svg/graphics/SVGImage.h"
+#include "core/svg/graphics/SVGImageForContainer.h"
namespace blink {
@@ -104,11 +105,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 +123,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
{
- return m_image->imageForLayoutObject(layoutObject);
+ RefPtr<Image> image = m_image->image();
+ if (image->isSVGImage())
+ return SVGImageForContainer::create(toSVGImage(image.get()), containerSize, zoom);
+ 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