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

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

Issue 1334703002: NOT FOR LANDING Pass URL to Image::draw (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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.h ('k') | Source/core/svg/graphics/SVGImageForContainer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index ca2cc3f6bb3804707b77e8066bb8aa936231ba70..1b9c01b1dea9d241ea7eed75326785e8511dc738 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -193,7 +193,7 @@ IntSize SVGImage::containerSize() const
}
void SVGImage::drawForContainer(SkCanvas* canvas, const SkPaint& paint, const FloatSize containerSize, float zoom, const FloatRect& dstRect,
- const FloatRect& srcRect)
+ const FloatRect& srcRect, const KURL& url)
{
if (!m_page)
return;
@@ -212,7 +212,7 @@ void SVGImage::drawForContainer(SkCanvas* canvas, const SkPaint& paint, const Fl
adjustedSrcSize.scale(roundedContainerSize.width() / containerSize.width(), roundedContainerSize.height() / containerSize.height());
scaledSrc.setSize(adjustedSrcSize);
- draw(canvas, paint, dstRect, scaledSrc, DoNotRespectImageOrientation, ClampImageToSourceRect);
+ draw(canvas, paint, dstRect, scaledSrc, DoNotRespectImageOrientation, ClampImageToSourceRect, url);
}
PassRefPtr<SkImage> SVGImage::imageForCurrentFrame()
@@ -222,7 +222,7 @@ PassRefPtr<SkImage> SVGImage::imageForCurrentFrame()
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(width(), height());
- drawForContainer(canvas, SkPaint(), size(), 1, rect(), rect());
+ drawForContainer(canvas, SkPaint(), size(), 1, rect(), rect(), KURL()); // TODO(davve): empty url
RefPtr<SkPicture> picture = adoptRef(recorder.endRecording());
return adoptRef(
@@ -232,7 +232,7 @@ PassRefPtr<SkImage> SVGImage::imageForCurrentFrame()
void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize containerSize,
float zoom, const FloatRect& srcRect, const FloatSize& tileScale, const FloatPoint& phase,
SkXfermode::Mode compositeOp, const FloatRect& dstRect,
- const IntSize& repeatSpacing)
+ const IntSize& repeatSpacing, const KURL& url)
{
// Tile adjusted for scaling/stretch.
FloatRect tile(srcRect);
@@ -249,7 +249,7 @@ void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize
if (tile != spacedTile)
patternPicture.context().clip(tile);
SkPaint paint;
- drawForContainer(patternPicture.context().canvas(), paint, containerSize, zoom, tile, srcRect);
+ drawForContainer(patternPicture.context().canvas(), paint, containerSize, zoom, tile, srcRect, url);
}
RefPtr<const SkPicture> tilePicture = patternPicture.endRecording();
@@ -280,7 +280,8 @@ static bool drawNeedsLayer(const SkPaint& paint)
return false;
}
-void SVGImage::draw(SkCanvas* canvas, const SkPaint& paint, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode)
+void SVGImage::draw(SkCanvas* canvas, const SkPaint& paint, const FloatRect& dstRect, const FloatRect& srcRect,
+ RespectImageOrientationEnum shouldRespectImageOrientation, ImageClampingMode clampMode, const KURL& url)
{
if (!m_page)
return;
@@ -290,7 +291,7 @@ void SVGImage::draw(SkCanvas* canvas, const SkPaint& paint, const FloatRect& dst
// Always call processUrlFragment, even if the url is empty, because
// there may have been a previous url/fragment that needs to be reset.
- view->processUrlFragment(m_url);
+ view->processUrlFragment(url);
SkPictureBuilder imagePicture(dstRect);
{
« no previous file with comments | « Source/core/svg/graphics/SVGImage.h ('k') | Source/core/svg/graphics/SVGImageForContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698