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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/filters/FilterEffect.h

Issue 2319293004: Replace FilterEffect::maxEffectRect() with absoluteBounds() (Closed)
Patch Set: Add comment Created 4 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 unified diff | Download patch
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
70 FloatRect maxEffectRect() const { return m_maxEffectRect; } 70 // Clipped primitive subregion in the coordinate space of the target.
71 FloatRect absoluteBounds() const;
71 72
72 virtual sk_sp<SkImageFilter> createImageFilter(); 73 virtual sk_sp<SkImageFilter> createImageFilter();
73 virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation(); 74 virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation();
74 75
75 // Mapping a rect forwards determines which which destination pixels a 76 // Mapping a rect forwards determines which which destination pixels a
76 // given source rect would affect. Mapping a rect backwards determines 77 // given source rect would affect. Mapping a rect backwards determines
77 // which pixels from the source rect would be required to fill a given 78 // 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 79 // destination rect. Note that these are not necessarily the inverse of
79 // each other. For example, for FEGaussianBlur, they are the same 80 // each other. For example, for FEGaussianBlur, they are the same
80 // transformation. 81 // transformation.
(...skipping 17 matching lines...) Expand all
98 99
99 Filter* getFilter() { return m_filter; } 100 Filter* getFilter() { return m_filter; }
100 const Filter* getFilter() const { return m_filter; } 101 const Filter* getFilter() const { return m_filter; }
101 102
102 bool clipsToBounds() const { return m_clipsToBounds; } 103 bool clipsToBounds() const { return m_clipsToBounds; }
103 void setClipsToBounds(bool value) { m_clipsToBounds = value; } 104 void setClipsToBounds(bool value) { m_clipsToBounds = value; }
104 105
105 ColorSpace operatingColorSpace() const { return m_operatingColorSpace; } 106 ColorSpace operatingColorSpace() const { return m_operatingColorSpace; }
106 virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColo rSpace = colorSpace; } 107 virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColo rSpace = colorSpace; }
107 108
108 FloatRect determineMaximumEffectRect();
109
110 virtual FloatRect determineAbsolutePaintRect(const FloatRect& requestedAbsol uteRect); 109 virtual FloatRect determineAbsolutePaintRect(const FloatRect& requestedAbsol uteRect);
111 virtual bool affectsTransparentPixels() { return false; } 110 virtual bool affectsTransparentPixels() { return false; }
112 111
113 // Return false if the filter will only operate correctly on valid RGBA valu es, with 112 // 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]. 113 // alpha in [0,255] and each color component in [0, alpha].
115 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; } 114 virtual bool mayProduceInvalidPreMultipliedPixels() { return false; }
116 115
117 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co nst; 116 SkImageFilter* getImageFilter(ColorSpace, bool requiresPMColorValidation) co nst;
118 void setImageFilter(ColorSpace, bool requiresPMColorValidation, sk_sp<SkImag eFilter>); 117 void setImageFilter(ColorSpace, bool requiresPMColorValidation, sk_sp<SkImag eFilter>);
119 118
(...skipping 11 matching lines...) Expand all
131 130
132 SkImageFilter::CropRect getCropRect() const; 131 SkImageFilter::CropRect getCropRect() const;
133 132
134 void addAbsolutePaintRect(const FloatRect& absolutePaintRect); 133 void addAbsolutePaintRect(const FloatRect& absolutePaintRect);
135 134
136 private: 135 private:
137 FilterEffectVector m_inputEffects; 136 FilterEffectVector m_inputEffects;
138 137
139 IntRect m_absolutePaintRect; 138 IntRect m_absolutePaintRect;
140 139
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; 140 Member<Filter> m_filter;
145 141
146 // The following member variables are SVG specific and will move to LayoutSV GResourceFilterPrimitive. 142 // 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. 143 // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
148 144
149 // The subregion of a filter primitive according to the SVG Filter specifica tion in local coordinates. 145 // 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. 146 // This is SVG specific and needs to move to LayoutSVGResourceFilterPrimitiv e.
151 FloatRect m_filterPrimitiveSubregion; 147 FloatRect m_filterPrimitiveSubregion;
152 148
153 // Should the effect clip to its primitive region, or expand to use the comb ined region of its inputs. 149 // Should the effect clip to its primitive region, or expand to use the comb ined region of its inputs.
154 bool m_clipsToBounds; 150 bool m_clipsToBounds;
155 151
156 bool m_originTainted; 152 bool m_originTainted;
157 153
158 ColorSpace m_operatingColorSpace; 154 ColorSpace m_operatingColorSpace;
159 155
160 sk_sp<SkImageFilter> m_imageFilters[4]; 156 sk_sp<SkImageFilter> m_imageFilters[4];
161 }; 157 };
162 158
163 } // namespace blink 159 } // namespace blink
164 160
165 #endif // FilterEffect_h 161 #endif // FilterEffect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698