Changeset 85926 in webkit
- Timestamp:
- May 6, 2011 12:33:18 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85925 r85926 1 2011-05-06 Cris Neckar <cdn@chromium.org> 2 3 Reviewed by Dirk Schulze. 4 5 Change maxEffectRect to a FloatRect. 6 https://bugs.webkit.org/show_bug.cgi?id=59551 7 8 * svg/filters/filter-after-transform-crash-expected.txt: Added. 9 * svg/filters/filter-after-transform-crash.svg: Added. 10 1 11 2011-05-04 Philippe Normand <pnormand@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r85923 r85926 1 2011-05-06 Cris Neckar <cdn@chromium.org> 2 3 Reviewed by Dirk Schulze. 4 5 Tests for crash when a transform is applied to certain filters. 6 https://bugs.webkit.org/show_bug.cgi?id=59551 7 8 Test: svg/filters/filter-after-transform-crash.svg 9 10 * platform/graphics/filters/FEComposite.cpp: 11 (WebCore::FEComposite::determineAbsolutePaintRect): 12 * platform/graphics/filters/FEConvolveMatrix.h: 13 (WebCore::FEConvolveMatrix::determineAbsolutePaintRect): 14 * platform/graphics/filters/FEDisplacementMap.h: 15 (WebCore::FEDisplacementMap::determineAbsolutePaintRect): 16 * platform/graphics/filters/FEFlood.h: 17 (WebCore::FEFlood::determineAbsolutePaintRect): 18 * platform/graphics/filters/FELighting.h: 19 (WebCore::FELighting::determineAbsolutePaintRect): 20 * platform/graphics/filters/FETile.h: 21 (WebCore::FETile::determineAbsolutePaintRect): 22 * platform/graphics/filters/FETurbulence.h: 23 (WebCore::FETurbulence::determineAbsolutePaintRect): 24 * platform/graphics/filters/FilterEffect.cpp: 25 (WebCore::isFilterSizeValid): 26 (WebCore::FilterEffect::determineAbsolutePaintRect): 27 (WebCore::FilterEffect::asUnmultipliedImage): 28 (WebCore::FilterEffect::asPremultipliedImage): 29 (WebCore::FilterEffect::copyUnmultipliedImage): 30 (WebCore::FilterEffect::copyPremultipliedImage): 31 (WebCore::FilterEffect::createUnmultipliedImageResult): 32 (WebCore::FilterEffect::createPremultipliedImageResult): 33 * platform/graphics/filters/FilterEffect.h: 34 (WebCore::FilterEffect::maxEffectRect): 35 (WebCore::FilterEffect::setMaxEffectRect): 36 * rendering/svg/RenderSVGResourceFilter.cpp: 37 * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: 38 (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): 39 1 40 2011-05-06 Luke Macpherson <macpherson@chromium.org> 2 41 -
trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp
r84504 r85926 188 188 // Arithmetic may influnce the compele filter primitive region. So we can't 189 189 // optimize the paint region here. 190 setAbsolutePaintRect( maxEffectRect());190 setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); 191 191 return; 192 192 default: -
trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h
r79866 r85926 76 76 virtual void dump(); 77 77 78 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect( maxEffectRect()); }78 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 79 79 80 80 virtual TextStream& externalRepresentation(TextStream&, int indention) const; -
trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h
r80022 r85926 54 54 virtual void dump(); 55 55 56 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect( maxEffectRect()); }56 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 57 57 58 58 virtual TextStream& externalRepresentation(TextStream&, int indention) const; -
trunk/Source/WebCore/platform/graphics/filters/FEFlood.h
r83821 r85926 43 43 virtual void dump(); 44 44 45 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect( maxEffectRect()); }45 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 46 46 47 47 virtual TextStream& externalRepresentation(TextStream&, int indention) const; -
trunk/Source/WebCore/platform/graphics/filters/FELighting.h
r85180 r85926 46 46 virtual void apply(); 47 47 48 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect( maxEffectRect()); }48 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 49 49 50 50 protected: -
trunk/Source/WebCore/platform/graphics/filters/FETile.h
r72474 r85926 36 36 virtual void dump(); 37 37 38 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect( maxEffectRect()); }38 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 39 39 40 40 virtual FilterEffectType filterEffectType() const { return FilterEffectTypeTile; } -
trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h
r84911 r85926 66 66 virtual void dump(); 67 67 68 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect( maxEffectRect()); }68 virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 69 69 70 70 virtual TextStream& externalRepresentation(TextStream&, int indention) const; -
trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
r84422 r85926 47 47 } 48 48 49 inline bool isFilterSizeValid(IntRect rect) 50 { 51 if (rect.width() < 0 || rect.width() > kMaxFilterSize 52 || rect.height() < 0 || rect.height() > kMaxFilterSize) 53 return false; 54 return true; 55 } 56 49 57 void FilterEffect::determineAbsolutePaintRect() 50 58 { … … 55 63 56 64 // SVG specification wants us to clip to primitive subregion. 57 m_absolutePaintRect.intersect( m_maxEffectRect);65 m_absolutePaintRect.intersect(enclosingIntRect(m_maxEffectRect)); 58 66 } 59 67 … … 105 113 PassRefPtr<ByteArray> FilterEffect::asUnmultipliedImage(const IntRect& rect) 106 114 { 115 ASSERT(isFilterSizeValid(rect)); 107 116 RefPtr<ByteArray> imageData = ByteArray::create(rect.width() * rect.height() * 4); 108 117 copyUnmultipliedImage(imageData.get(), rect); … … 112 121 PassRefPtr<ByteArray> FilterEffect::asPremultipliedImage(const IntRect& rect) 113 122 { 123 ASSERT(isFilterSizeValid(rect)); 114 124 RefPtr<ByteArray> imageData = ByteArray::create(rect.width() * rect.height() * 4); 115 125 copyPremultipliedImage(imageData.get(), rect); … … 170 180 m_unmultipliedImageResult = m_imageBufferResult->getUnmultipliedImageData(IntRect(IntPoint(), m_absolutePaintRect.size())); 171 181 else { 182 ASSERT(isFilterSizeValid(m_absolutePaintRect)); 172 183 m_unmultipliedImageResult = ByteArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4); 173 184 unsigned char* sourceComponent = m_premultipliedImageResult->data(); … … 203 214 m_premultipliedImageResult = m_imageBufferResult->getPremultipliedImageData(IntRect(IntPoint(), m_absolutePaintRect.size())); 204 215 else { 216 ASSERT(isFilterSizeValid(m_absolutePaintRect)); 205 217 m_premultipliedImageResult = ByteArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4); 206 218 unsigned char* sourceComponent = m_unmultipliedImageResult->data(); … … 239 251 // Only one result type is allowed. 240 252 ASSERT(!hasResult()); 253 ASSERT(isFilterSizeValid(m_absolutePaintRect)); 254 241 255 determineAbsolutePaintRect(); 242 256 if (m_absolutePaintRect.isEmpty()) … … 250 264 // Only one result type is allowed. 251 265 ASSERT(!hasResult()); 266 ASSERT(isFilterSizeValid(m_absolutePaintRect)); 267 252 268 determineAbsolutePaintRect(); 253 269 if (m_absolutePaintRect.isEmpty()) -
trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h
r76590 r85926 32 32 #include <wtf/RefPtr.h> 33 33 #include <wtf/Vector.h> 34 35 static const float kMaxFilterSize = 5000.0f; 34 36 35 37 namespace WebCore { … … 75 77 void setAbsolutePaintRect(const IntRect& absolutePaintRect) { m_absolutePaintRect = absolutePaintRect; } 76 78 77 IntRect maxEffectRect() const { return m_maxEffectRect; }78 void setMaxEffectRect(const IntRect& maxEffectRect) { m_maxEffectRect = maxEffectRect; }79 FloatRect maxEffectRect() const { return m_maxEffectRect; } 80 void setMaxEffectRect(const FloatRect& maxEffectRect) { m_maxEffectRect = maxEffectRect; } 79 81 80 82 virtual void apply() = 0; … … 129 131 // The maximum size of a filter primitive. In SVG this is the primitive subregion in absolute coordinate space. 130 132 // The absolute paint rect should never be bigger than m_maxEffectRect. 131 IntRect m_maxEffectRect;133 FloatRect m_maxEffectRect; 132 134 Filter* m_filter; 133 135 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
r85406 r85926 28 28 29 29 #include "AffineTransform.h" 30 #include "FilterEffect.h" 30 31 #include "FloatPoint.h" 31 32 #include "FloatRect.h" … … 49 50 #include <wtf/Vector.h> 50 51 51 static const float kMaxFilterSize = 5000.0f;52 53 52 using namespace std; 54 53 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
r83821 r85926 129 129 absoluteSubregion.intersect(absoluteScaledFilterRegion); 130 130 131 effect->setMaxEffectRect( enclosingIntRect(absoluteSubregion));131 effect->setMaxEffectRect(absoluteSubregion); 132 132 return subregion; 133 133 }
Note: See TracChangeset
for help on using the changeset viewer.