OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 24 matching lines...) Expand all Loading... |
35 class FilterEffect; | 35 class FilterEffect; |
36 | 36 |
37 class PLATFORM_EXPORT Filter final : public GarbageCollectedFinalized<Filter> { | 37 class PLATFORM_EXPORT Filter final : public GarbageCollectedFinalized<Filter> { |
38 WTF_MAKE_NONCOPYABLE(Filter); | 38 WTF_MAKE_NONCOPYABLE(Filter); |
39 public: | 39 public: |
40 enum UnitScaling { | 40 enum UnitScaling { |
41 UserSpace, | 41 UserSpace, |
42 BoundingBox | 42 BoundingBox |
43 }; | 43 }; |
44 | 44 |
45 static RawPtr<Filter> create(const FloatRect& referenceBox, const FloatRect&
filterRegion, float scale, UnitScaling); | 45 static Filter* create(const FloatRect& referenceBox, const FloatRect& filter
Region, float scale, UnitScaling); |
46 static RawPtr<Filter> create(float scale); | 46 static Filter* create(float scale); |
47 | 47 |
48 ~Filter(); | 48 ~Filter(); |
49 DECLARE_TRACE(); | 49 DECLARE_TRACE(); |
50 | 50 |
51 float scale() const { return m_scale; } | 51 float scale() const { return m_scale; } |
52 FloatRect mapLocalRectToAbsoluteRect(const FloatRect&) const; | 52 FloatRect mapLocalRectToAbsoluteRect(const FloatRect&) const; |
53 FloatRect mapAbsoluteRectToLocalRect(const FloatRect&) const; | 53 FloatRect mapAbsoluteRectToLocalRect(const FloatRect&) const; |
54 | 54 |
55 float applyHorizontalScale(float value) const; | 55 float applyHorizontalScale(float value) const; |
56 float applyVerticalScale(float value) const; | 56 float applyVerticalScale(float value) const; |
57 | 57 |
58 FloatPoint3D resolve3dPoint(const FloatPoint3D&) const; | 58 FloatPoint3D resolve3dPoint(const FloatPoint3D&) const; |
59 | 59 |
60 FloatRect absoluteFilterRegion() const { return mapLocalRectToAbsoluteRect(m
_filterRegion); } | 60 FloatRect absoluteFilterRegion() const { return mapLocalRectToAbsoluteRect(m
_filterRegion); } |
61 | 61 |
62 const FloatRect& filterRegion() const { return m_filterRegion; } | 62 const FloatRect& filterRegion() const { return m_filterRegion; } |
63 const FloatRect& referenceBox() const { return m_referenceBox; } | 63 const FloatRect& referenceBox() const { return m_referenceBox; } |
64 | 64 |
65 void setLastEffect(RawPtr<FilterEffect>); | 65 void setLastEffect(FilterEffect*); |
66 FilterEffect* lastEffect() const { return m_lastEffect.get(); } | 66 FilterEffect* lastEffect() const { return m_lastEffect.get(); } |
67 | 67 |
68 SourceGraphic* getSourceGraphic() const { return m_sourceGraphic.get(); } | 68 SourceGraphic* getSourceGraphic() const { return m_sourceGraphic.get(); } |
69 | 69 |
70 private: | 70 private: |
71 Filter(const FloatRect& referenceBox, const FloatRect& filterRegion, float s
cale, UnitScaling); | 71 Filter(const FloatRect& referenceBox, const FloatRect& filterRegion, float s
cale, UnitScaling); |
72 | 72 |
73 FloatRect m_referenceBox; | 73 FloatRect m_referenceBox; |
74 FloatRect m_filterRegion; | 74 FloatRect m_filterRegion; |
75 float m_scale; | 75 float m_scale; |
76 UnitScaling m_unitScaling; | 76 UnitScaling m_unitScaling; |
77 | 77 |
78 Member<SourceGraphic> m_sourceGraphic; | 78 Member<SourceGraphic> m_sourceGraphic; |
79 Member<FilterEffect> m_lastEffect; | 79 Member<FilterEffect> m_lastEffect; |
80 }; | 80 }; |
81 | 81 |
82 } // namespace blink | 82 } // namespace blink |
83 | 83 |
84 #endif // Filter_h | 84 #endif // Filter_h |
OLD | NEW |