Skip to content

Commit e664737

Browse files
committed
Use CGStyle-based filters for saturate() and hue-rotate() - dropped frames on fakecake.org
https://bugs.webkit.org/show_bug.cgi?id=293212 rdar://148338705 Reviewed by Sam Weinig. The code in `FEColorMatrix::supportedFilterRenderingModes()` caused fallback to `FilterRenderingMode::Software` for `hue-rotate()` and `saturate()` filters, because we didn't have code that converted these to a color matrix. However, that code exists in ColorMatrix, so we can use it. I attempted to have GraphicsColorMatrix own a ColorMatrix<5, 4>, but that isn't easily IPC-encodable. Instead, add a `ColorMatrix` constructors that takes a span, and make the variadic constructor limited to numeric types. * LayoutTests/css3/filters/effect-blur-hw.html: * LayoutTests/css3/filters/effect-brightness-hw.html: * LayoutTests/css3/filters/effect-combined.html: * LayoutTests/css3/filters/effect-grayscale-hw.html: * LayoutTests/css3/filters/effect-hue-rotate-hw.html: * LayoutTests/css3/filters/effect-hue-rotate.html: * LayoutTests/css3/filters/effect-invert-hw.html: * LayoutTests/css3/filters/effect-opacity-hw.html: * LayoutTests/css3/filters/effect-saturate.html: * LayoutTests/css3/filters/effect-sepia-hw.html: * LayoutTests/css3/filters/invalid-reference-filter-in-chain.html: * LayoutTests/css3/filters/resources/filter-helpers.css: Use image-rendering: crisp-edges to reduce noise on iOS where images get scaled. * LayoutTests/fast/filter-image/filter-image.html: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/platform/graphics/ColorMatrix.h: (WebCore::ColorMatrix::ColorMatrix): (WebCore::ColorMatrix::data const): (WebCore::to5x4Matrix): * Source/WebCore/platform/graphics/GraphicsStyle.h: * Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp: (WebCore::FEColorMatrix::supportedFilterRenderingModes const): (WebCore::FEColorMatrix::createGraphicsStyle const): * Source/WebCore/platform/graphics/filters/FilterRenderingMode.cpp: Copied from Source/WebCore/platform/graphics/filters/FilterRenderingMode.h. (WebCore::operator<<): Make FilterRenderingMode streamable. * Source/WebCore/platform/graphics/filters/FilterRenderingMode.h: * Source/WebCore/rendering/CSSFilter.cpp: (WebCore::CSSFilter::create): Log the rendering mode. Canonical link: https://commits.webkit.org/295269@main
1 parent d61ab0d commit e664737

23 files changed

+110
-20
lines changed

LayoutTests/css3/filters/effect-blur-hw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-54; totalPixels=0-61800">
4+
<meta name="fuzzy" content="maxDifference=0-99; totalPixels=0-61800">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<style>
77
img {

LayoutTests/css3/filters/effect-brightness-hw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-100; totalPixels=0-41000">
4+
<meta name="fuzzy" content="maxDifference=0-186; totalPixels=0-41100">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<style>
77
img {

LayoutTests/css3/filters/effect-combined.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-20; totalPixels=0-600" />
4+
<meta name="fuzzy" content="maxDifference=0-20; totalPixels=0-26400" />
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<script src="resources/filter-helpers.js"></script>
77
</head>

LayoutTests/css3/filters/effect-grayscale-hw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-54; totalPixels=0-33000">
4+
<meta name="fuzzy" content="maxDifference=0-99; totalPixels=0-33050">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<style>
77
img {

LayoutTests/css3/filters/effect-hue-rotate-hw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-68; totalPixels=0-22400">
4+
<meta name="fuzzy" content="maxDifference=0-123; totalPixels=0-22400">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<style>
77
img {

LayoutTests/css3/filters/effect-hue-rotate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-48; totalPixels=0-2500">
4+
<meta name="fuzzy" content="maxDifference=0-48; totalPixels=0-55700">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<script src="resources/filter-helpers.js"></script>
77
</head>

LayoutTests/css3/filters/effect-invert-hw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-54; totalPixels=0-40300" />
4+
<meta name="fuzzy" content="maxDifference=0-99; totalPixels=0-40410" />
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<style>
77
img {

LayoutTests/css3/filters/effect-opacity-hw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-54; totalPixels=0-29200">
4+
<meta name="fuzzy" content="maxDifference=0-99; totalPixels=0-29200">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<style>
77
img {

LayoutTests/css3/filters/effect-saturate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-48; totalPixels=0-2500">
4+
<meta name="fuzzy" content="maxDifference=0-48; totalPixels=0-33200">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<script src="resources/filter-helpers.js"></script>
77
</head>

LayoutTests/css3/filters/effect-sepia-hw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta name="fuzzy" content="maxDifference=0-54; totalPixels=0-36800">
4+
<meta name="fuzzy" content="maxDifference=0-99; totalPixels=0-36800">
55
<link rel="stylesheet" href="resources/filter-helpers.css">
66
<style>
77
img {

0 commit comments

Comments
 (0)