OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> | 2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> |
3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 FilterEffectVector& inputEffects() { return m_inputEffects; } | 59 FilterEffectVector& inputEffects() { return m_inputEffects; } |
60 FilterEffect* inputEffect(unsigned) const; | 60 FilterEffect* inputEffect(unsigned) const; |
61 unsigned numberOfEffectInputs() const { return m_inputEffects.size(); } | 61 unsigned numberOfEffectInputs() const { return m_inputEffects.size(); } |
62 | 62 |
63 inline bool hasImageFilter() const | 63 inline bool hasImageFilter() const |
64 { | 64 { |
65 return m_imageFilters[0] || m_imageFilters[1] || m_imageFilters[2] || m_ imageFilters[3]; | 65 return m_imageFilters[0] || m_imageFilters[1] || m_imageFilters[2] || m_ imageFilters[3]; |
66 } | 66 } |
67 | 67 |
68 IntRect absolutePaintRect() const { return m_absolutePaintRect; } | 68 IntRect absolutePaintRect() const { return m_absolutePaintRect; } |
69 | 69 FloatRect absoluteBounds() const; |
pdr.
2016/09/08 20:46:12
Can you add a comment here? Maybe something about
fs
2016/09/08 21:08:12
Done.
| |
70 FloatRect maxEffectRect() const { return m_maxEffectRect; } | |
71 | 70 |
72 virtual sk_sp<SkImageFilter> createImageFilter(); | 71 virtual sk_sp<SkImageFilter> createImageFilter(); |
73 virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation(); | 72 virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation(); |
74 | 73 |
75 // Mapping a rect forwards determines which which destination pixels a | 74 // Mapping a rect forwards determines which which destination pixels a |
76 // given source rect would affect. Mapping a rect backwards determines | 75 // given source rect would affect. Mapping a rect backwards determines |
77 // which pixels from the source rect would be required to fill a given | 76 // which pixels from the source rect would be required to fill a given |
78 // destination rect. Note that these are not necessarily the inverse of | 77 // destination rect. Note that these are not necessarily the inverse of |
79 // each other. For example, for FEGaussianBlur, they are the same | 78 // each other. For example, for FEGaussianBlur, they are the same |
80 // transformation. | 79 // transformation. |
(...skipping 17 matching lines...) Expand all Loading... | |
98 | 97 |
99 Filter* getFilter() { return m_filter; } | 98 Filter* getFilter() { return m_filter; } |
100 const Filter* getFilter() const { return m_filter; } | 99 const Filter* getFilter() const { return m_filter; } |
101 | 100 |
102 bool clipsToBounds() const { return m_clipsToBounds; } | 101 bool clipsToBounds() const { return m_clipsToBounds; } |
103 void setClipsToBounds(bool value) { m_clipsToBounds = value; } | 102 void setClipsToBounds(bool value) { m_clipsToBounds = value; } |
104 | 103 |
105 ColorSpace operatingColorSpace() const { return m_operatingColorSpace; } | 104 ColorSpace operatingColorSpace() const { return m_operatingColorSpace; } |
106 virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColo rSpace = colorSpace; } | 105 virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColo rSpace = colorSpace; } |
107 | 106 |
108 FloatRect determineMaximumEffectRect(); | |
109 | |
110 virtual FloatRect determineAbsolutePaintRect(const FloatRect& requestedAbsol uteRect); | 107 virtual FloatRect determineAbsolutePaintRect(const FloatRect& requestedAbsol uteRect); |
111 virtual bool affectsTransparentPixels() { return false; } | 108 virtual bool affectsTransparentPixels() { return false; } |
112 | 109 |
113 // Return false if the filter will only operate correctly on valid RGBA valu es, with | 110 // Return false if the filter will only operate correctly on valid RGBA valu es, with |
114 // alpha in [0,255] and each color component in [0, alpha]. | 111 // alpha in [0,255] and each color component in [0, alpha]. |
115 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; } | 112 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; } |
116 | 113 |
117 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co nst; | 114 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co nst; |
118 void setImageFilter(ColorSpace, bool requiresPMColorValidation, sk_sp<SkImag eFilter>); | 115 void setImageFilter(ColorSpace, bool requiresPMColorValidation, sk_sp<SkImag eFilter>); |
119 | 116 |
(...skipping 11 matching lines...) Expand all Loading... | |
131 | 128 |
132 SkImageFilter::CropRect getCropRect() const; | 129 SkImageFilter::CropRect getCropRect() const; |
133 | 130 |
134 void addAbsolutePaintRect(const FloatRect& absolutePaintRect); | 131 void addAbsolutePaintRect(const FloatRect& absolutePaintRect); |
135 | 132 |
136 private: | 133 private: |
137 FilterEffectVector m_inputEffects; | 134 FilterEffectVector m_inputEffects; |
138 | 135 |
139 IntRect m_absolutePaintRect; | 136 IntRect m_absolutePaintRect; |
140 | 137 |
141 // The maximum size of a filter primitive. In SVG this is the primitive subr egion in absolute coordinate space. | |
142 // The absolute paint rect should never be bigger than m_maxEffectRect. | |
143 FloatRect m_maxEffectRect; | |
144 Member<Filter> m_filter; | 138 Member<Filter> m_filter; |
145 | 139 |
146 // The following member variables are SVG specific and will move to LayoutSV GResourceFilterPrimitive. | 140 // The following member variables are SVG specific and will move to LayoutSV GResourceFilterPrimitive. |
147 // See bug https://bugs.webkit.org/show_bug.cgi?id=45614. | 141 // See bug https://bugs.webkit.org/show_bug.cgi?id=45614. |
148 | 142 |
149 // The subregion of a filter primitive according to the SVG Filter specifica tion in local coordinates. | 143 // The subregion of a filter primitive according to the SVG Filter specifica tion in local coordinates. |
150 // This is SVG specific and needs to move to LayoutSVGResourceFilterPrimitiv e. | 144 // This is SVG specific and needs to move to LayoutSVGResourceFilterPrimitiv e. |
151 FloatRect m_filterPrimitiveSubregion; | 145 FloatRect m_filterPrimitiveSubregion; |
152 | 146 |
153 // Should the effect clip to its primitive region, or expand to use the comb ined region of its inputs. | 147 // Should the effect clip to its primitive region, or expand to use the comb ined region of its inputs. |
154 bool m_clipsToBounds; | 148 bool m_clipsToBounds; |
155 | 149 |
156 bool m_originTainted; | 150 bool m_originTainted; |
157 | 151 |
158 ColorSpace m_operatingColorSpace; | 152 ColorSpace m_operatingColorSpace; |
159 | 153 |
160 sk_sp<SkImageFilter> m_imageFilters[4]; | 154 sk_sp<SkImageFilter> m_imageFilters[4]; |
161 }; | 155 }; |
162 | 156 |
163 } // namespace blink | 157 } // namespace blink |
164 | 158 |
165 #endif // FilterEffect_h | 159 #endif // FilterEffect_h |
OLD | NEW |