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

Unified Diff: third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h

Issue 1855303002: Replace filter outsets with bounds mapping in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: additional unit tests for FilterOperations::mapRect Created 4 years, 8 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: third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h b/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h
index 7a9cdffb2a7af4d83044ff06b50dde28e8c6db71..cb429d2ed765cfc7aa5190b7228f158836ba38e6 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h
+++ b/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h
@@ -100,6 +100,12 @@ public:
// True if the the value of one pixel can affect the value of another pixel under this operation, such as blur.
virtual bool movesPixels() const { return false; }
+ // Can map "forward" to determine which pixels in a destination rect are
+ // affected by pixels in the source rect, or "backward" to determine which
+ // pixels in the source rect are required for a destination rect.
+ // See also FilterEffect::mapRect.
+ virtual FloatRect mapRect(const FloatRect& rect, bool forward) const { return rect; }
+
protected:
FilterOperation(OperationType type)
: m_type(type)
@@ -124,6 +130,7 @@ public:
bool affectsOpacity() const override { return true; }
bool movesPixels() const override { return true; }
+ FloatRect mapRect(const FloatRect&, bool forward) const override;
const String& url() const { return m_url; }
const AtomicString& fragment() const { return m_fragment; }
@@ -252,7 +259,7 @@ public:
bool affectsOpacity() const override { return true; }
bool movesPixels() const override { return true; }
-
+ FloatRect mapRect(const FloatRect&, bool forward) const override;
private:
FilterOperation* blend(const FilterOperation* from, double progress) const override;
@@ -290,7 +297,7 @@ public:
bool affectsOpacity() const override { return true; }
bool movesPixels() const override { return true; }
-
+ FloatRect mapRect(const FloatRect&, bool forward) const override;
private:
FilterOperation* blend(const FilterOperation* from, double progress) const override;
@@ -329,6 +336,7 @@ public:
bool affectsOpacity() const override { return true; }
bool movesPixels() const override { return true; }
+ FloatRect mapRect(const FloatRect&, bool forward) const override;
private:
FilterOperation* blend(const FilterOperation* from, double progress) const override;

Powered by Google App Engine
This is Rietveld 408576698