summaryrefslogtreecommitdiffstats
path: root/WebCore/svg/graphics/filters/SVGFEOffset.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-12-15 10:12:09 +0000
committerSteve Block <steveblock@google.com>2009-12-17 17:41:10 +0000
commit643ca7872b450ea4efacab6188849e5aac2ba161 (patch)
tree6982576c228bcd1a7efe98afed544d840751094c /WebCore/svg/graphics/filters/SVGFEOffset.cpp
parentd026980fde6eb3b01c1fe49441174e89cd1be298 (diff)
downloadexternal_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.zip
external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.gz
external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.bz2
Merge webkit.org at r51976 : Initial merge by git.
Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
Diffstat (limited to 'WebCore/svg/graphics/filters/SVGFEOffset.cpp')
-rw-r--r--WebCore/svg/graphics/filters/SVGFEOffset.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
index ce9ee3d..9fd50ed 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
@@ -74,17 +74,22 @@ void FEOffset::apply(Filter* filter)
if (!filterContext)
return;
+ FloatRect sourceImageRect = filter->sourceImageRect();
+ sourceImageRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
+
if (filter->effectBoundingBoxMode()) {
- setDx(dx() * filter->sourceImageRect().width());
- setDy(dy() * filter->sourceImageRect().height());
+ m_dx *= sourceImageRect.width();
+ m_dy *= sourceImageRect.height();
}
+ m_dx *= filter->filterResolution().width();
+ m_dy *= filter->filterResolution().height();
- FloatRect dstRect = FloatRect(dx() + m_in->subRegion().x() - subRegion().x(),
- dy() + m_in->subRegion().y() - subRegion().y(),
- m_in->subRegion().width(),
- m_in->subRegion().height());
+ FloatRect dstRect = FloatRect(m_dx + m_in->scaledSubRegion().x() - scaledSubRegion().x(),
+ m_dy + m_in->scaledSubRegion().y() - scaledSubRegion().y(),
+ m_in->scaledSubRegion().width(),
+ m_in->scaledSubRegion().height());
- filterContext->drawImage(m_in->resultImage()->image(), dstRect);
+ filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, dstRect);
}
void FEOffset::dump()