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

Unified Diff: Source/platform/graphics/filters/SourceGraphic.cpp

Issue 1338753003: Specify the source rect on the SourceGraphic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Doh 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/filters/SourceGraphic.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/filters/SourceGraphic.cpp
diff --git a/Source/platform/graphics/filters/SourceGraphic.cpp b/Source/platform/graphics/filters/SourceGraphic.cpp
index 12aa4bd79848436aef336fc1118b70250cb904a2..7a71d90a850006ccea21edd3cc3ddec62ea2ca48 100644
--- a/Source/platform/graphics/filters/SourceGraphic.cpp
+++ b/Source/platform/graphics/filters/SourceGraphic.cpp
@@ -52,8 +52,7 @@ const AtomicString& SourceGraphic::effectName()
FloatRect SourceGraphic::determineAbsolutePaintRect(const FloatRect& requestedRect)
{
- FloatRect srcRect = filter()->sourceImageRect();
- srcRect.intersect(requestedRect);
+ FloatRect srcRect = intersection(m_sourceRect, requestedRect);
addAbsolutePaintRect(srcRect);
return srcRect;
}
@@ -63,6 +62,11 @@ void SourceGraphic::setPicture(PassRefPtr<const SkPicture> picture)
m_picture = picture;
}
+void SourceGraphic::setSourceRect(const IntRect& sourceRect)
+{
+ m_sourceRect = sourceRect;
+}
+
PassRefPtr<SkImageFilter> SourceGraphic::createImageFilter(SkiaImageFilterBuilder*)
{
if (!m_picture)
« no previous file with comments | « Source/platform/graphics/filters/SourceGraphic.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698