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

Unified Diff: Source/WebCore/svg/graphics/SVGImageCache.cpp

Issue 12314169: Merge 143541 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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 | « Source/WebCore/svg/graphics/SVGImage.cpp ('k') | Source/WebCore/svg/graphics/SVGImageForContainer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/svg/graphics/SVGImageCache.cpp
===================================================================
--- Source/WebCore/svg/graphics/SVGImageCache.cpp (revision 144238)
+++ Source/WebCore/svg/graphics/SVGImageCache.cpp (working copy)
@@ -56,18 +56,12 @@
{
ASSERT(client);
ASSERT(!containerSize.isEmpty());
+ ASSERT(containerZoom);
FloatSize containerSizeWithoutZoom(containerSize);
containerSizeWithoutZoom.scale(1 / containerZoom);
- ImageForContainerMap::iterator imageIt = m_imageForContainerMap.find(client);
- if (imageIt == m_imageForContainerMap.end()) {
- RefPtr<SVGImageForContainer> image = SVGImageForContainer::create(m_svgImage, containerSizeWithoutZoom, 1, containerZoom);
- m_imageForContainerMap.set(client, image);
- } else {
- imageIt->value->setSize(containerSizeWithoutZoom);
- imageIt->value->setZoom(containerZoom);
- }
+ m_imageForContainerMap.set(client, SVGImageForContainer::create(m_svgImage, containerSizeWithoutZoom, containerZoom));
}
IntSize SVGImageCache::imageSizeForRenderer(const RenderObject* renderer) const
@@ -81,14 +75,8 @@
return imageSize;
RefPtr<SVGImageForContainer> image = it->value;
- FloatSize size = image->containerSize();
- if (!size.isEmpty()) {
- size.scale(image->zoom());
- imageSize.setWidth(size.width());
- imageSize.setHeight(size.height());
- }
-
- return imageSize;
+ ASSERT(!image->size().isEmpty());
+ return image->size();
}
// FIXME: This doesn't take into account the animation timeline so animations will not
@@ -98,18 +86,12 @@
if (!renderer)
return Image::nullImage();
- // The cache needs to know the size of the renderer before querying an image for it.
ImageForContainerMap::iterator it = m_imageForContainerMap.find(renderer);
if (it == m_imageForContainerMap.end())
return Image::nullImage();
RefPtr<SVGImageForContainer> image = it->value;
- ASSERT(!image->containerSize().isEmpty());
-
- // FIXME: Set the page scale in setContainerSizeForRenderer instead of looking it up here.
- Page* page = renderer->document()->page();
- image->setPageScale(page->deviceScaleFactor() * page->pageScaleFactor());
-
+ ASSERT(!image->size().isEmpty());
return image.get();
}
« no previous file with comments | « Source/WebCore/svg/graphics/SVGImage.cpp ('k') | Source/WebCore/svg/graphics/SVGImageForContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698