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

Unified Diff: third_party/WebKit/Source/core/paint/ImagePainter.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/paint/ImagePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/ImagePainter.cpp b/third_party/WebKit/Source/core/paint/ImagePainter.cpp
index 8a94b3c108c128b85f556f2745cfddacba8a92be..2febc6cd9c59f7fff11452e5cc5c3c1c0e5c1228 100644
--- a/third_party/WebKit/Source/core/paint/ImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ImagePainter.cpp
@@ -11,6 +11,7 @@
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLAreaElement.h"
#include "core/html/HTMLImageElement.h"
+#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutImage.h"
#include "core/layout/LayoutReplaced.h"
#include "core/layout/TextRunConstructor.h"
@@ -21,6 +22,7 @@
#include "platform/geometry/LayoutPoint.h"
#include "platform/graphics/Path.h"
#include "platform/graphics/paint/ClipRecorder.h"
+#include "platform/weborigin/KURL.h"
namespace blink {
@@ -128,7 +130,15 @@ void ImagePainter::paintIntoRect(GraphicsContext* context, const LayoutRect& rec
if (alignedRect.width() <= 0 || alignedRect.height() <= 0)
return;
- RefPtr<Image> image = m_layoutImage.imageResource()->image(alignedRect.width(), alignedRect.height());
+ KURL url;
+ Node* node = m_layoutImage.node();
+ if (node && node->isElementNode()) {
+ AtomicString urlString = toElement(node)->imageSourceURL();
+ if (!urlString.isEmpty())
+ url = node->document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlString));
+ }
+
+ RefPtr<Image> image = m_layoutImage.imageResource()->image(alignedRect.size(), m_layoutImage.style()->effectiveZoom(), url);
if (!image || image->isNull())
return;
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxPainter.cpp ('k') | third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698