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

Unified Diff: Source/platform/graphics/filters/Filter.h

Issue 1348973004: Merge SVGFilter into Filter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Nits. 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/core/svg/graphics/filters/SVGFilter.cpp ('k') | Source/platform/graphics/filters/Filter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/filters/Filter.h
diff --git a/Source/platform/graphics/filters/Filter.h b/Source/platform/graphics/filters/Filter.h
index cb22be7ad40f9eb45bfecb2c892db10ba8111c8b..ab961de09df4bd0fe51cba524c2266a237069203 100644
--- a/Source/platform/graphics/filters/Filter.h
+++ b/Source/platform/graphics/filters/Filter.h
@@ -33,29 +33,27 @@ namespace blink {
class SourceGraphic;
class FilterEffect;
-class PLATFORM_EXPORT Filter : public RefCountedWillBeGarbageCollectedFinalized<Filter> {
+class PLATFORM_EXPORT Filter final : public RefCountedWillBeGarbageCollectedFinalized<Filter> {
public:
- static PassRefPtrWillBeRawPtr<Filter> create(const FloatRect& referenceBox, const FloatRect& filterRegion, float scale)
- {
- return adoptRefWillBeNoop(new Filter(referenceBox, filterRegion, scale));
- }
+ enum UnitScaling {
+ UserSpace,
+ BoundingBox
+ };
- static PassRefPtrWillBeRawPtr<Filter> create(float scale)
- {
- return adoptRefWillBeNoop(new Filter(FloatRect(), FloatRect(), scale));
- }
+ static PassRefPtrWillBeRawPtr<Filter> create(const FloatRect& referenceBox, const FloatRect& filterRegion, float scale, UnitScaling = UserSpace);
+ static PassRefPtrWillBeRawPtr<Filter> create(float scale);
- virtual ~Filter();
- DECLARE_VIRTUAL_TRACE();
+ ~Filter();
+ DECLARE_TRACE();
float scale() const { return m_scale; }
FloatRect mapLocalRectToAbsoluteRect(const FloatRect&) const;
FloatRect mapAbsoluteRectToLocalRect(const FloatRect&) const;
- virtual float applyHorizontalScale(float value) const { return m_scale * value; }
- virtual float applyVerticalScale(float value) const { return m_scale * value; }
+ float applyHorizontalScale(float value) const;
+ float applyVerticalScale(float value) const;
- virtual FloatPoint3D resolve3dPoint(const FloatPoint3D& point) const { return point; }
+ FloatPoint3D resolve3dPoint(const FloatPoint3D&) const;
FloatRect absoluteFilterRegion() const { return mapLocalRectToAbsoluteRect(m_filterRegion); }
@@ -67,13 +65,13 @@ public:
SourceGraphic* sourceGraphic() const { return m_sourceGraphic.get(); }
-protected:
- Filter(const FloatRect& referenceBox, const FloatRect& filterRegion, float scale);
-
private:
+ Filter(const FloatRect& referenceBox, const FloatRect& filterRegion, float scale, UnitScaling);
+
FloatRect m_referenceBox;
FloatRect m_filterRegion;
float m_scale;
+ UnitScaling m_unitScaling;
RefPtrWillBeMember<SourceGraphic> m_sourceGraphic;
RefPtrWillBeMember<FilterEffect> m_lastEffect;
« no previous file with comments | « Source/core/svg/graphics/filters/SVGFilter.cpp ('k') | Source/platform/graphics/filters/Filter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698