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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 | 58 |
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; } | |
69 | |
70 // Clipped primitive subregion in the coordinate space of the target. | 68 // Clipped primitive subregion in the coordinate space of the target. |
71 FloatRect absoluteBounds() const; | 69 FloatRect absoluteBounds() const; |
72 | 70 |
73 virtual sk_sp<SkImageFilter> createImageFilter(); | 71 virtual sk_sp<SkImageFilter> createImageFilter(); |
74 virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation(); | 72 virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation(); |
75 | 73 |
76 // Mapping a rect forwards determines which which destination pixels a | 74 // Mapping a rect forwards determines which which destination pixels a |
77 // given source rect would affect. Mapping a rect backwards determines | 75 // given source rect would affect. Mapping a rect backwards determines |
78 // 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 |
79 // destination rect. Note that these are not necessarily the inverse of | 77 // destination rect. Note that these are not necessarily the inverse of |
(...skipping 19 matching lines...) Expand all Loading... | |
99 | 97 |
100 Filter* getFilter() { return m_filter; } | 98 Filter* getFilter() { return m_filter; } |
101 const Filter* getFilter() const { return m_filter; } | 99 const Filter* getFilter() const { return m_filter; } |
102 | 100 |
103 bool clipsToBounds() const { return m_clipsToBounds; } | 101 bool clipsToBounds() const { return m_clipsToBounds; } |
104 void setClipsToBounds(bool value) { m_clipsToBounds = value; } | 102 void setClipsToBounds(bool value) { m_clipsToBounds = value; } |
105 | 103 |
106 ColorSpace operatingColorSpace() const { return m_operatingColorSpace; } | 104 ColorSpace operatingColorSpace() const { return m_operatingColorSpace; } |
107 virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColo rSpace = colorSpace; } | 105 virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColo rSpace = colorSpace; } |
108 | 106 |
109 virtual FloatRect determineAbsolutePaintRect(const FloatRect& requestedAbsol uteRect); | 107 virtual FloatRect determineAbsolutePaintRect(const FloatRect& requestedAbsol uteRect) const; |
pdr.
2016/09/12 02:46:34
Can you document this with a comment?
fs
2016/09/12 08:55:19
Done.
| |
110 virtual bool affectsTransparentPixels() { return false; } | 108 virtual bool affectsTransparentPixels() const { return false; } |
111 | 109 |
112 // 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 |
113 // alpha in [0,255] and each color component in [0, alpha]. | 111 // alpha in [0,255] and each color component in [0, alpha]. |
114 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; } | 112 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; } |
115 | 113 |
116 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co nst; | 114 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co nst; |
117 void setImageFilter(ColorSpace, bool requiresPMColorValidation, sk_sp<SkImag eFilter>); | 115 void setImageFilter(ColorSpace, bool requiresPMColorValidation, sk_sp<SkImag eFilter>); |
118 | 116 |
119 bool originTainted() const { return m_originTainted; } | 117 bool originTainted() const { return m_originTainted; } |
120 void setOriginTainted() { m_originTainted = true; } | 118 void setOriginTainted() { m_originTainted = true; } |
121 | 119 |
122 bool inputsTaintOrigin() const; | 120 bool inputsTaintOrigin() const; |
123 | 121 |
124 protected: | 122 protected: |
125 FilterEffect(Filter*); | 123 FilterEffect(Filter*); |
126 | 124 |
127 sk_sp<SkImageFilter> createTransparentBlack() const; | 125 sk_sp<SkImageFilter> createTransparentBlack() const; |
128 | 126 |
129 Color adaptColorToOperatingColorSpace(const Color& deviceColor); | 127 Color adaptColorToOperatingColorSpace(const Color& deviceColor); |
130 | 128 |
131 SkImageFilter::CropRect getCropRect() const; | 129 SkImageFilter::CropRect getCropRect() const; |
132 | 130 |
133 void addAbsolutePaintRect(const FloatRect& absolutePaintRect); | |
134 | |
135 private: | 131 private: |
136 FilterEffectVector m_inputEffects; | 132 FilterEffectVector m_inputEffects; |
137 | 133 |
138 IntRect m_absolutePaintRect; | |
139 | |
140 Member<Filter> m_filter; | 134 Member<Filter> m_filter; |
141 | 135 |
142 // The following member variables are SVG specific and will move to LayoutSV GResourceFilterPrimitive. | 136 // The following member variables are SVG specific and will move to LayoutSV GResourceFilterPrimitive. |
143 // See bug https://bugs.webkit.org/show_bug.cgi?id=45614. | 137 // See bug https://bugs.webkit.org/show_bug.cgi?id=45614. |
144 | 138 |
145 // The subregion of a filter primitive according to the SVG Filter specifica tion in local coordinates. | 139 // The subregion of a filter primitive according to the SVG Filter specifica tion in local coordinates. |
146 // This is SVG specific and needs to move to LayoutSVGResourceFilterPrimitiv e. | 140 // This is SVG specific and needs to move to LayoutSVGResourceFilterPrimitiv e. |
147 FloatRect m_filterPrimitiveSubregion; | 141 FloatRect m_filterPrimitiveSubregion; |
148 | 142 |
149 // Should the effect clip to its primitive region, or expand to use the comb ined region of its inputs. | 143 // Should the effect clip to its primitive region, or expand to use the comb ined region of its inputs. |
150 bool m_clipsToBounds; | 144 bool m_clipsToBounds; |
151 | 145 |
152 bool m_originTainted; | 146 bool m_originTainted; |
153 | 147 |
154 ColorSpace m_operatingColorSpace; | 148 ColorSpace m_operatingColorSpace; |
155 | 149 |
156 sk_sp<SkImageFilter> m_imageFilters[4]; | 150 sk_sp<SkImageFilter> m_imageFilters[4]; |
157 }; | 151 }; |
158 | 152 |
159 } // namespace blink | 153 } // namespace blink |
160 | 154 |
161 #endif // FilterEffect_h | 155 #endif // FilterEffect_h |
OLD | NEW |