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

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

Issue 150973004: Fixes the rendering of a SVG filter (e.g. feFlood) by testing against total (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added rebaseline test. Created 6 years, 10 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/FilterEffect.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/FilterEffect.cpp
diff --git a/Source/platform/graphics/filters/FilterEffect.cpp b/Source/platform/graphics/filters/FilterEffect.cpp
index ce8f23f723481bd38b66d3446078b5c987ae6b66..f98698fcce391d3dae1619c1e9963f8effc4005e 100644
--- a/Source/platform/graphics/filters/FilterEffect.cpp
+++ b/Source/platform/graphics/filters/FilterEffect.cpp
@@ -36,6 +36,8 @@
namespace WebCore {
+static const float kMaxFilterArea = 4096 * 4096;
+
FilterEffect::FilterEffect(Filter* filter)
: m_alphaImage(false)
, m_filter(filter)
@@ -54,14 +56,26 @@ FilterEffect::~FilterEffect()
{
}
-inline bool isFilterSizeValid(IntRect rect)
+float FilterEffect::maxFilterArea()
{
- if (rect.width() < 0 || rect.width() > kMaxFilterSize
- || rect.height() < 0 || rect.height() > kMaxFilterSize)
+ return kMaxFilterArea;
+}
+
+bool FilterEffect::isFilterSizeValid(const FloatRect& rect)
+{
+ if (rect.width() < 0 || rect.height() < 0
+ || (rect.height() * rect.width() > kMaxFilterArea))
return false;
+
return true;
}
+
+bool FilterEffect::isFilterSizeValid(const IntRect& rect)
+{
+ return isFilterSizeValid(FloatRect(rect));
+}
+
FloatRect FilterEffect::determineAbsolutePaintRect(const FloatRect& originalRequestedRect)
{
FloatRect requestedRect = originalRequestedRect;
« no previous file with comments | « Source/platform/graphics/filters/FilterEffect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698