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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 inline bool hasImageFilter() const | 74 inline bool hasImageFilter() const |
75 { | 75 { |
76 return m_imageFilters[0] || m_imageFilters[1] || m_imageFilters[2] || m_
imageFilters[3]; | 76 return m_imageFilters[0] || m_imageFilters[1] || m_imageFilters[2] || m_
imageFilters[3]; |
77 } | 77 } |
78 | 78 |
79 IntRect absolutePaintRect() const { return m_absolutePaintRect; } | 79 IntRect absolutePaintRect() const { return m_absolutePaintRect; } |
80 | 80 |
81 FloatRect maxEffectRect() const { return m_maxEffectRect; } | 81 FloatRect maxEffectRect() const { return m_maxEffectRect; } |
82 void setMaxEffectRect(const FloatRect& maxEffectRect) { m_maxEffectRect = ma
xEffectRect; } | 82 void setMaxEffectRect(const FloatRect& maxEffectRect) { m_maxEffectRect = ma
xEffectRect; } |
83 | 83 |
84 virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*)
; | 84 virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&)
; |
85 virtual PassRefPtr<SkImageFilter> createImageFilterWithoutValidation(SkiaIma
geFilterBuilder*); | 85 virtual PassRefPtr<SkImageFilter> createImageFilterWithoutValidation(SkiaIma
geFilterBuilder&); |
86 | 86 |
87 // Mapping a rect forwards determines which which destination pixels a | 87 // Mapping a rect forwards determines which which destination pixels a |
88 // given source rect would affect. Mapping a rect backwards determines | 88 // given source rect would affect. Mapping a rect backwards determines |
89 // which pixels from the source rect would be required to fill a given | 89 // which pixels from the source rect would be required to fill a given |
90 // destination rect. Note that these are not necessarily the inverse of | 90 // destination rect. Note that these are not necessarily the inverse of |
91 // each other. For example, for FEGaussianBlur, they are the same | 91 // each other. For example, for FEGaussianBlur, they are the same |
92 // transformation. | 92 // transformation. |
93 virtual FloatRect mapRect(const FloatRect& rect, bool forward = true) { retu
rn rect; } | 93 virtual FloatRect mapRect(const FloatRect& rect, bool forward = true) { retu
rn rect; } |
94 // A version of the above that is used for calculating paint rects. We can't | 94 // A version of the above that is used for calculating paint rects. We can't |
95 // use mapRect above for that, because that is also used for calculating eff
ect | 95 // use mapRect above for that, because that is also used for calculating eff
ect |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Return false if the filter will only operate correctly on valid RGBA valu
es, with | 142 // Return false if the filter will only operate correctly on valid RGBA valu
es, with |
143 // alpha in [0,255] and each color component in [0, alpha]. | 143 // alpha in [0,255] and each color component in [0, alpha]. |
144 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; } | 144 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; } |
145 | 145 |
146 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co
nst; | 146 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co
nst; |
147 void setImageFilter(ColorSpace, bool requiresPMColorValidation, PassRefPtr<S
kImageFilter>); | 147 void setImageFilter(ColorSpace, bool requiresPMColorValidation, PassRefPtr<S
kImageFilter>); |
148 | 148 |
149 protected: | 149 protected: |
150 FilterEffect(Filter*); | 150 FilterEffect(Filter*); |
151 | 151 |
152 PassRefPtr<SkImageFilter> createTransparentBlack(SkiaImageFilterBuilder*) co
nst; | 152 PassRefPtr<SkImageFilter> createTransparentBlack(SkiaImageFilterBuilder&) co
nst; |
153 | 153 |
154 Color adaptColorToOperatingColorSpace(const Color& deviceColor); | 154 Color adaptColorToOperatingColorSpace(const Color& deviceColor); |
155 | 155 |
156 SkImageFilter::CropRect getCropRect(const FloatSize& cropOffset) const; | 156 SkImageFilter::CropRect getCropRect(const FloatSize& cropOffset) const; |
157 | 157 |
158 void addAbsolutePaintRect(const FloatRect& absolutePaintRect); | 158 void addAbsolutePaintRect(const FloatRect& absolutePaintRect); |
159 | 159 |
160 private: | 160 private: |
161 bool hasConnectedInput() const; | 161 bool hasConnectedInput() const; |
162 | 162 |
(...skipping 25 matching lines...) Expand all Loading... |
188 bool m_clipsToBounds; | 188 bool m_clipsToBounds; |
189 | 189 |
190 ColorSpace m_operatingColorSpace; | 190 ColorSpace m_operatingColorSpace; |
191 | 191 |
192 RefPtr<SkImageFilter> m_imageFilters[4]; | 192 RefPtr<SkImageFilter> m_imageFilters[4]; |
193 }; | 193 }; |
194 | 194 |
195 } // namespace blink | 195 } // namespace blink |
196 | 196 |
197 #endif // FilterEffect_h | 197 #endif // FilterEffect_h |
OLD | NEW |