Changeset 287982 in webkit
- Timestamp:
- Jan 13, 2022 10:58:47 AM (6 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/css3/filters/reference-filter-color-space-expected.html (added)
-
LayoutTests/css3/filters/reference-filter-color-space.html (added)
-
LayoutTests/css3/filters/reference-filter-set-filter-regions.html (modified) (1 diff)
-
LayoutTests/fast/gradients/conic-gradient-alpha-unpremultiplied.html (modified) (1 diff)
-
LayoutTests/fast/gradients/conic-gradient-extended-stops.html (modified) (1 diff)
-
LayoutTests/fast/gradients/conic-gradient.html (modified) (1 diff)
-
LayoutTests/fast/gradients/conic-repeating-last-stop.html (modified) (1 diff)
-
LayoutTests/fast/hidpi/filters-turbulence.html (modified) (1 diff)
-
LayoutTests/platform/win/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/filters/Filter.h (modified) (1 diff)
-
Source/WebCore/rendering/CSSFilter.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/CSSFilter.h (modified) (1 diff)
-
Source/WebCore/svg/graphics/filters/SVGFilter.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287981 r287982 1 2022-01-13 Said Abou-Hallawa <said@apple.com> 2 3 Referenced SVG filter uses always sRGB color space for its result 4 https://bugs.webkit.org/show_bug.cgi?id=235159 5 6 Reviewed by Simon Fraser. 7 8 The new test defines a <feComponentTransfer> effect with linear component 9 functions. The values of these functions make the lookup tables have zeros 10 in the first 65 elements. The test applies the filter to a <div> with green 11 background. 12 13 -- With sRGB color-space, the green channel value is 0x80. So the value 14 in the lookup table is not zero. So the result filter image in this 15 case is a some green square. 16 17 -- With linearRGB color-space , the green channel value is 0x37. So the 18 value in the lookup table is zero. So the result filter image in this 19 case is a black square. 20 21 Because the color-space will be linearRGB, the expected test case should 22 have black squares. 23 24 * css3/filters/reference-filter-color-space-expected.html: Added. 25 * css3/filters/reference-filter-color-space.html: Added. 26 27 * css3/filters/reference-filter-set-filter-regions.html: 28 * fast/gradients/conic-gradient-alpha-unpremultiplied.html: 29 * fast/gradients/conic-gradient-extended-stops.html: 30 * fast/gradients/conic-gradient.html: 31 * fast/gradients/conic-repeating-last-stop.html: 32 * fast/hidpi/filters-turbulence.html: 33 Add color-interpolation-filters="sRGB" to get the old result so they match 34 the expected pages. 35 36 * platform/win/TestExpectations: 37 LinearSRGB color space is not supported on Windows. 38 1 39 2022-01-13 Alan Bujtas <zalan@apple.com> 2 40 -
trunk/LayoutTests/css3/filters/reference-filter-set-filter-regions.html
r235644 r287982 19 19 <feTurbulence type="turbulence" baseFrequency="0.01" numOctaves="1" seed="5" stitchTiles="stitch"/> 20 20 <feColorMatrix type="saturate" values="0"/> 21 <feComponentTransfer >21 <feComponentTransfer color-interpolation-filters="sRGB"> 22 22 <feFuncR type="linear" slope="0" intercept="0"/> 23 23 <feFuncG type="linear" slope="0" intercept="0.5"/> -
trunk/LayoutTests/fast/gradients/conic-gradient-alpha-unpremultiplied.html
r287310 r287982 39 39 <defs> 40 40 <filter id="posterize" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox"> 41 <feComponentTransfer >41 <feComponentTransfer color-interpolation-filters="sRGB"> 42 42 <feFuncR type="discrete" tableValues="0 0.125 0.25 0.375 0.5 0.625 0.75 0.875"/> 43 43 <feFuncG type="discrete" tableValues="0 0.125 0.25 0.375 0.5 0.625 0.75 0.875"/> -
trunk/LayoutTests/fast/gradients/conic-gradient-extended-stops.html
r245250 r287982 39 39 <defs> 40 40 <filter id="posterize" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox"> 41 <feComponentTransfer >41 <feComponentTransfer color-interpolation-filters="sRGB"> 42 42 <feFuncR type="discrete" tableValues="0 0.0625 0.125 0.1875 0.25 0.3125 0.375 0.4375 0.5 0.5625 0.625 0.6875 0.75 0.8125 0.875 0.9375"/> 43 43 <feFuncG type="discrete" tableValues="0 0.0625 0.125 0.1875 0.25 0.3125 0.375 0.4375 0.5 0.5625 0.625 0.6875 0.75 0.8125 0.875 0.9375"/> -
trunk/LayoutTests/fast/gradients/conic-gradient.html
r245250 r287982 39 39 <defs> 40 40 <filter id="posterize" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox"> 41 <feComponentTransfer >41 <feComponentTransfer color-interpolation-filters="sRGB"> 42 42 <feFuncR type="discrete" tableValues="0 0.125 0.25 0.375 0.5 0.625 0.75 0.875"/> 43 43 <feFuncG type="discrete" tableValues="0 0.125 0.25 0.375 0.5 0.625 0.75 0.875"/> -
trunk/LayoutTests/fast/gradients/conic-repeating-last-stop.html
r235999 r287982 28 28 <defs> 29 29 <filter id="posterize" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox"> 30 <feComponentTransfer >30 <feComponentTransfer color-interpolation-filters="sRGB"> 31 31 <feFuncR type="discrete" tableValues="0 1"/> 32 32 <feFuncG type="discrete" tableValues="0 1"/> -
trunk/LayoutTests/fast/hidpi/filters-turbulence.html
r231485 r287982 12 12 <svg> 13 13 <filter id="filter" x="0" y="0" width="100%" height="100%"> 14 <feTurbulence type="fractalNoise" numOctaves="0" />14 <feTurbulence type="fractalNoise" numOctaves="0" color-interpolation-filters="sRGB" /> 15 15 </filter> 16 16 </svg> -
trunk/LayoutTests/platform/win/TestExpectations
r287942 r287982 4793 4793 4794 4794 webkit.org/b/235126 webanimations/accelerated-animation-after-forward-filling-animation.html [ ImageOnlyFailure ] 4795 4796 # LinearSRGB color space is not supported on Windows. 4797 css3/filters/reference-filter-color-space.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r287981 r287982 1 2022-01-13 Said Abou-Hallawa <said@apple.com> 2 3 Referenced SVG filter uses always sRGB color space for its result 4 https://bugs.webkit.org/show_bug.cgi?id=235159 5 6 Reviewed by Simon Fraser. 7 8 Do not setOperatingColorSpace() of the lastEffect() of the referenced 9 SVGFilter to DestinationColorSpace::SRGB(). This will have the pixels 10 of the result FilterImage of the lastEffect() in the color space which 11 is defined by the color-interpolation style of the effect SVGElement. 12 13 Test: css3/filters/reference-filter-color-space.html 14 15 * platform/graphics/filters/Filter.h: 16 * rendering/CSSFilter.cpp: 17 (WebCore::CSSFilter::create): 18 Move checking the CoreImage support to this function. 19 20 (WebCore::CSSFilter::buildFilterFunctions): 21 Remove resetting m_functions and m_outsets from this function since it 22 is now called only once from CSSFilter::create(). 23 24 (WebCore::CSSFilter::lastEffect const): Deleted. 25 * rendering/CSSFilter.h: 26 * svg/graphics/filters/SVGFilter.h: 27 1 28 2022-01-13 Alan Bujtas <zalan@apple.com> 2 29 -
trunk/Source/WebCore/platform/graphics/filters/Filter.h
r287782 r287982 62 62 FloatRect clipToMaxEffectRect(const FloatRect& imageRect, const FloatRect& primitiveSubregion) const; 63 63 64 virtual RefPtr<FilterEffect> lastEffect() const = 0;65 64 virtual FilterEffectVector effectsOfType(FilterFunction::Type) const = 0; 66 65 -
trunk/Source/WebCore/rendering/CSSFilter.cpp
r287892 r287982 55 55 return nullptr; 56 56 57 #if USE(CORE_IMAGE) 58 if (!filter->supportsCoreImageRendering()) 59 filter->setRenderingMode(RenderingMode::Unaccelerated); 60 #endif 57 61 return filter; 58 62 } … … 238 242 bool CSSFilter::buildFilterFunctions(RenderElement& renderer, const FilterOperations& operations, const FloatRect& targetBoundingBox) 239 243 { 240 m_functions.clear(); 241 m_outsets = { }; 242 244 RefPtr<FilterEffect> effect; 243 245 RefPtr<SVGFilter> filter; 244 246 245 247 for (auto& operation : operations.operations()) { 246 RefPtr<FilterEffect> effect;247 248 248 switch (operation->type()) { 249 249 case FilterOperation::APPLE_INVERT_LIGHTNESS: … … 293 293 case FilterOperation::REFERENCE: 294 294 filter = createSVGFilter(*this, downcast<ReferenceFilterOperation>(*operation), renderer, targetBoundingBox); 295 effect = nullptr;296 295 break; 297 296 … … 300 299 } 301 300 302 if ((filter || effect) && m_functions.isEmpty()) 301 if (!filter && !effect) 302 continue; 303 304 if (m_functions.isEmpty()) 303 305 m_functions.append(SourceGraphic::create()); 304 305 if (filter) { 306 effect = filter->lastEffect(); 307 effect->setOperatingColorSpace(DestinationColorSpace::SRGB()); 306 307 if (filter) 308 308 m_functions.append(filter.releaseNonNull()); 309 continue; 310 } 311 312 if (effect) { 313 effect->setOperatingColorSpace(DestinationColorSpace::SRGB()); 309 else 314 310 m_functions.append(effect.releaseNonNull()); 315 }316 311 } 317 312 … … 321 316 322 317 m_functions.shrinkToFit(); 323 324 #if USE(CORE_IMAGE)325 if (!supportsCoreImageRendering())326 setRenderingMode(RenderingMode::Unaccelerated);327 #endif328 329 318 return true; 330 }331 332 RefPtr<FilterEffect> CSSFilter::lastEffect() const333 {334 if (m_functions.isEmpty())335 return nullptr;336 337 auto& function = m_functions.last();338 if (function->isSVGFilter())339 return downcast<SVGFilter>(function.ptr())->lastEffect();340 341 return downcast<FilterEffect>(function.ptr());342 319 } 343 320 -
trunk/Source/WebCore/rendering/CSSFilter.h
r287782 r287982 51 51 bool hasFilterThatShouldBeRestrictedBySecurityOrigin() const { return m_hasFilterThatShouldBeRestrictedBySecurityOrigin; } 52 52 53 RefPtr<FilterEffect> lastEffect() const final;54 53 FilterEffectVector effectsOfType(FilterFunction::Type) const final; 55 54 -
trunk/Source/WebCore/svg/graphics/filters/SVGFilter.h
r287892 r287982 45 45 const SVGFilterExpression& expression() const { return m_expression; } 46 46 47 RefPtr<FilterEffect> lastEffect() const final;48 47 FilterEffectVector effectsOfType(FilterFunction::Type) const final; 49 48 … … 57 56 58 57 void setExpression(SVGFilterExpression&& expression) { m_expression = WTFMove(expression); } 58 59 RefPtr<FilterEffect> lastEffect() const; 59 60 60 61 #if USE(CORE_IMAGE)
Note: See TracChangeset
for help on using the changeset viewer.