haikuwebkit/LayoutTests/css3/filters/effect-invert-square.html

21 lines
346 B
HTML
Raw Permalink Normal View History

CoreImage Implementation of CSS Filters invert(), opacity(), brightness(), contrast() https://bugs.webkit.org/show_bug.cgi?id=215956 Patch by Frank Yang <guowei_yang@apple.com> on 2020-09-08 Reviewed by Darin Adler. Source/WebCore: Adding CoreImage support for 4 more CSS filters, invert, opacity, brightness, contrast, which all uses FEComponentTransfer and the linear transfer function. Partially implemented FEComponentTransfer to support linear function type so that the 4 CSS filters work properly Tests: css3/filters/effect-brightness-square.html css3/filters/effect-contrast-square.html css3/filters/effect-invert-square.html css3/filters/effect-opacity-square.html * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: (WebCore::FilterEffectRendererCoreImage::isNullOrLinearComponentTransferFunction): currently CoreImage can only render FEComponentTransfer filters if the transfer funtion is only linear. A FEComponentTransfer filter using only linear function would have it's red, green, blue, alpha functions types either be linear or null. (WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering): currently CoreImage can only render FEComponentTransfer filters if the transfer funtion is only linear. (WebCore::FilterEffectRendererCoreImage::connectCIFilters): now returns image for FEComponentTransfer (WebCore::FilterEffectRendererCoreImage::imageForFEComponentTransfer): function that uses CIFilters to render FEComponentTransfer. * platform/graphics/filters/FEComponentTransfer.h: (isType): added SPECIALIZE_TYPE_TRAITS so that we can downcast to FEComponentTransfer LayoutTests: * css3/filters/effect-brightness-square-expected.html: Added. * css3/filters/effect-brightness-square.html: Added. * css3/filters/effect-contrast-square-expected.html: Added. * css3/filters/effect-contrast-square.html: Added. * css3/filters/effect-invert-square-expected.html: Added. * css3/filters/effect-invert-square.html: Added. * css3/filters/effect-opacity-square-expected.html: Added. * css3/filters/effect-opacity-square.html: Added. Canonical link: https://commits.webkit.org/229105@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-08 19:25:13 +00:00
<!DOCTYPE html>
<html>
<head>
<title>CSS Filter Test: Test for Saturate short hand</title>
<style type="text/css">
div {
width: 500px;
height: 500px;
background: red;
filter: invert(100%);
}
</style>
</head>
<body>
<p>You should see a cyan rectangle.</p>
<div></div>
</body>
</html>