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

Unified Diff: Source/platform/graphics/Image.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/platform/graphics/Image.h ('k') | Source/platform/graphics/ImageBufferSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Image.cpp
diff --git a/Source/platform/graphics/Image.cpp b/Source/platform/graphics/Image.cpp
index 2d274af5828b2d4a593edc3a43222a21668acfa5..5d2d29e15a81bbe023a1bdb1ffa44ff67edc8327 100644
--- a/Source/platform/graphics/Image.cpp
+++ b/Source/platform/graphics/Image.cpp
@@ -39,6 +39,7 @@
#include "platform/graphics/BitmapImage.h"
#include "platform/graphics/DeferredImageDecoder.h"
#include "platform/graphics/GraphicsContext.h"
+#include "platform/weborigin/KURL.h"
#include "public/platform/Platform.h"
#include "public/platform/WebData.h"
#include "third_party/skia/include/core/SkCanvas.h"
@@ -96,7 +97,8 @@ bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
return dataChanged(allDataReceived);
}
-void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, SkXfermode::Mode op, const IntSize& repeatSpacing)
+void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize,
+ const KURL& url, SkXfermode::Mode op, const IntSize& repeatSpacing)
{
FloatSize intrinsicTileSize = size();
if (hasRelativeWidth())
@@ -120,19 +122,19 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl
visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
visibleSrcRect.setWidth(destRect.width() / scale.width());
visibleSrcRect.setHeight(destRect.height() / scale.height());
- ctxt->drawImage(this, destRect, visibleSrcRect, op, DoNotRespectImageOrientation);
+ ctxt->drawImage(this, destRect, visibleSrcRect, url, op, DoNotRespectImageOrientation);
return;
}
FloatRect tileRect(FloatPoint(), intrinsicTileSize);
- drawPattern(ctxt, tileRect, scale, oneTileRect.location(), op, destRect, repeatSpacing);
+ drawPattern(ctxt, tileRect, scale, oneTileRect.location(), url, op, destRect, repeatSpacing);
startAnimation();
}
// FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.
void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect,
- const FloatSize& providedTileScaleFactor, TileRule hRule, TileRule vRule, SkXfermode::Mode op)
+ const FloatSize& providedTileScaleFactor, const KURL& url, TileRule hRule, TileRule vRule, SkXfermode::Mode op)
{
// FIXME: We do not support 'space' yet. For now just map it to 'repeat'.
if (hRule == SpaceTile)
@@ -175,10 +177,10 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const Flo
if (useLowInterpolationQuality) {
InterpolationQuality previousInterpolationQuality = ctxt->imageInterpolationQuality();
ctxt->setImageInterpolationQuality(InterpolationLow);
- drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, op, dstRect);
+ drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, KURL(), op, dstRect); // TODO(davve): empty url
ctxt->setImageInterpolationQuality(previousInterpolationQuality);
} else {
- drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, op, dstRect);
+ drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, KURL(), op, dstRect); // TODO(davve): empty url
}
startAnimation();
@@ -210,7 +212,7 @@ PassRefPtr<SkShader> createPatternShader(const SkImage* image, const SkMatrix& s
} // anonymous namespace
void Image::drawPattern(GraphicsContext* context, const FloatRect& floatSrcRect, const FloatSize& scale,
- const FloatPoint& phase, SkXfermode::Mode compositeOp, const FloatRect& destRect, const IntSize& repeatSpacing)
+ const FloatPoint& phase, const KURL& url, SkXfermode::Mode compositeOp, const FloatRect& destRect, const IntSize& repeatSpacing)
{
TRACE_EVENT0("skia", "Image::drawPattern");
« no previous file with comments | « Source/platform/graphics/Image.h ('k') | Source/platform/graphics/ImageBufferSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698