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

Unified Diff: trunk/Source/core/platform/graphics/filters/FEDropShadow.cpp

Issue 14852010: Revert 150342 "Implement filter primitive subregion for referenc..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 7 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: trunk/Source/core/platform/graphics/filters/FEDropShadow.cpp
===================================================================
--- trunk/Source/core/platform/graphics/filters/FEDropShadow.cpp (revision 150368)
+++ trunk/Source/core/platform/graphics/filters/FEDropShadow.cpp (working copy)
@@ -57,7 +57,18 @@
Filter* filter = this->filter();
ASSERT(filter);
- FloatRect absolutePaintRect = mapRect(inputEffect(0)->absolutePaintRect());
+ FloatRect absolutePaintRect = inputEffect(0)->absolutePaintRect();
+ FloatRect absoluteOffsetPaintRect(absolutePaintRect);
+ absoluteOffsetPaintRect.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
+ absolutePaintRect.unite(absoluteOffsetPaintRect);
+
+ unsigned kernelSizeX = 0;
+ unsigned kernelSizeY = 0;
+ FEGaussianBlur::calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
+
+ // We take the half kernel size and multiply it with three, because we run box blur three times.
+ absolutePaintRect.inflateX(3 * kernelSizeX * 0.5f);
+ absolutePaintRect.inflateY(3 * kernelSizeY * 0.5f);
if (clipsToBounds())
absolutePaintRect.intersect(maxEffectRect());
@@ -67,29 +78,6 @@
setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
}
-FloatRect FEDropShadow::mapRect(const FloatRect& rect, bool forward)
-{
- FloatRect result = rect;
- Filter* filter = this->filter();
- ASSERT(filter);
-
- FloatRect offsetRect = rect;
- if (forward)
- offsetRect.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
- else
- offsetRect.move(-filter->applyHorizontalScale(m_dx), -filter->applyVerticalScale(m_dy));
- result.unite(offsetRect);
-
- unsigned kernelSizeX = 0;
- unsigned kernelSizeY = 0;
- FEGaussianBlur::calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
-
- // We take the half kernel size and multiply it with three, because we run box blur three times.
- result.inflateX(3 * kernelSizeX * 0.5f);
- result.inflateY(3 * kernelSizeY * 0.5f);
- return result;
-}
-
void FEDropShadow::applySoftware()
{
FilterEffect* in = inputEffect(0);

Powered by Google App Engine
This is Rietveld 408576698