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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 1667053002: Inline SVGImage::setContainerSize() and remove extra resize call (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 4b62e1beaedd400362bd7a44573819073debdaff..e3bf7c3ad16e719e0622c7a55aa1df1f25cb2418 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -135,21 +135,6 @@ static SVGSVGElement* svgRootElement(Page* page)
return frame->document()->accessSVGExtensions().rootElement();
}
-void SVGImage::setContainerSize(const IntSize& size)
-{
- SVGSVGElement* rootElement = svgRootElement(m_page.get());
- if (!rootElement)
- return;
-
- FrameView* view = frameView();
- view->resize(this->containerSize());
-
- LayoutSVGRoot* layoutObject = toLayoutSVGRoot(rootElement->layoutObject());
- if (!layoutObject)
- return;
- layoutObject->setContainerSize(size);
-}
-
IntSize SVGImage::containerSize() const
{
SVGSVGElement* rootElement = svgRootElement(m_page.get());
@@ -203,7 +188,11 @@ void SVGImage::drawForContainer(SkCanvas* canvas, const SkPaint& paint, const Fl
ImageObserverDisabler imageObserverDisabler(this);
IntSize roundedContainerSize = roundedIntSize(containerSize);
- setContainerSize(roundedContainerSize);
+
+ if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) {
+ if (LayoutSVGRoot* layoutObject = toLayoutSVGRoot(rootElement->layoutObject()))
+ layoutObject->setContainerSize(roundedContainerSize);
+ }
FloatRect scaledSrc = srcRect;
scaledSrc.scale(1 / zoom);
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698