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

Unified Diff: Source/core/svg/graphics/SVGImageForContainer.h

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/svg/graphics/SVGImage.cpp ('k') | Source/core/svg/graphics/SVGImageForContainer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImageForContainer.h
diff --git a/Source/core/svg/graphics/SVGImageForContainer.h b/Source/core/svg/graphics/SVGImageForContainer.h
index 23bbf308d726ab68fe812dae57bee36b69759d85..6d337f45ce137957e0d15c6f2472df28e12c02f0 100644
--- a/Source/core/svg/graphics/SVGImageForContainer.h
+++ b/Source/core/svg/graphics/SVGImageForContainer.h
@@ -36,15 +36,16 @@ namespace blink {
class SVGImageForContainer final : public Image {
public:
- static PassRefPtr<SVGImageForContainer> create(SVGImage* image, const FloatSize& containerSize, float zoom)
+ static PassRefPtr<SVGImageForContainer> create(SVGImage* image, const FloatSize& containerSize, float zoom, const KURL& urlWithFragment)
{
- return adoptRef(new SVGImageForContainer(image, containerSize, zoom));
+ FloatSize containerSizeWithoutZoom(containerSize);
+ containerSizeWithoutZoom.scale(1 / zoom);
+ return adoptRef(new SVGImageForContainer(image, containerSizeWithoutZoom, zoom, urlWithFragment));
}
bool isSVGImage() const override { return true; }
IntSize size() const override;
- void setURL(const KURL& url) { m_image->setURL(url); }
bool usesContainerSize() const override { return m_image->usesContainerSize(); }
bool hasRelativeWidth() const override { return m_image->hasRelativeWidth(); }
@@ -64,10 +65,11 @@ public:
PassRefPtr<SkImage> imageForCurrentFrame() override;
private:
- SVGImageForContainer(SVGImage* image, const FloatSize& containerSize, float zoom)
+ SVGImageForContainer(SVGImage* image, const FloatSize& containerSize, float zoom, const KURL& urlWithFragment)
: m_image(image)
, m_containerSize(containerSize)
, m_zoom(zoom)
+ , m_urlWithFragment(urlWithFragment)
{
}
@@ -76,7 +78,9 @@ private:
SVGImage* m_image;
const FloatSize m_containerSize;
const float m_zoom;
+ KURL m_urlWithFragment; // Just keep the fragment?
};
+
}
#endif // SVGImageForContainer_h
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/core/svg/graphics/SVGImageForContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698