haikuwebkit/LayoutTests/fast/gradients/conic-extended-stops-expect...

32 lines
591 B
HTML
Raw Permalink Normal View History

Add Support for Conic Gradients https://bugs.webkit.org/show_bug.cgi?id=189329 <rdar://problem/21444701> Reviewed by Simon Fraser. Source/WebCore: Add support for rendering CSS conic gradients. The parsing work was already done, this just hooks up the data we have with the CG functionality for conic gradients. Add the needed plumbing to allow for this additional type and fill in the creation of a conic gradient. Tests: fast/gradients/conic-repeating.html fast/gradients/conic.html * css/CSSGradientValue.cpp: (WebCore::createGradient): (WebCore::LinearGradientAdapter::gradientLength const): (WebCore::RadialGradientAdapter::gradientLength const): (WebCore::ConicGradientAdapter::ConicGradientAdapter): (WebCore::ConicGradientAdapter::gradientLength const): (WebCore::ConicGradientAdapter::maxExtent const): (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange): Compute what the color stops should be if they extend past 0-1 (WebCore::CSSGradientValue::computeStops): (WebCore::CSSConicGradientValue::createGradient): (WebCore::LinearGradientAdapter::startPoint const): Deleted. (WebCore::LinearGradientAdapter::endPoint const): Deleted. (WebCore::RadialGradientAdapter::startPoint const): Deleted. (WebCore::RadialGradientAdapter::endPoint const): Deleted. Start and End points weren't very universal. All we really need from these gradientAdapters is their length, so just ask for that instead. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): * platform/graphics/Gradient.cpp: (WebCore::Gradient::create): (WebCore::Gradient::Gradient): (WebCore::Gradient::type const): (WebCore::Gradient::adjustParametersForTiledDrawing): (WebCore::Gradient::isZeroSize const): (WebCore::Gradient::hash const): * platform/graphics/Gradient.h: * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): Source/WebCore/PAL: Define the CG functionality for conic gradients. * pal/spi/cg/CoreGraphicsSPI.h: Source/WebKit: Connect up web preferences to allow conic gradients to be turned on in the experimental features menu. * Shared/WebPreferences.yaml: LayoutTests: Simple tests to see if conic gradients are rendered properly. * fast/gradients/conic-expected.html: Added. * fast/gradients/conic-repeating-expected.html: Added. * fast/gradients/conic-repeating.html: Added. * fast/gradients/conic.html: Added. Canonical link: https://commits.webkit.org/204375@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-07 01:36:36 +00:00
<html>
<head>
<style>
div {
float: left;
}
#box1 {
height: 25px;
width: 50px;
float: left;
background-color: blue;
}
#box2 {
height: 25px;
width: 25px;
clear: left;
background-color: magenta;
Add Support for Conic Gradients https://bugs.webkit.org/show_bug.cgi?id=189329 <rdar://problem/21444701> Reviewed by Simon Fraser. Source/WebCore: Add support for rendering CSS conic gradients. The parsing work was already done, this just hooks up the data we have with the CG functionality for conic gradients. Add the needed plumbing to allow for this additional type and fill in the creation of a conic gradient. Tests: fast/gradients/conic-repeating.html fast/gradients/conic.html * css/CSSGradientValue.cpp: (WebCore::createGradient): (WebCore::LinearGradientAdapter::gradientLength const): (WebCore::RadialGradientAdapter::gradientLength const): (WebCore::ConicGradientAdapter::ConicGradientAdapter): (WebCore::ConicGradientAdapter::gradientLength const): (WebCore::ConicGradientAdapter::maxExtent const): (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange): Compute what the color stops should be if they extend past 0-1 (WebCore::CSSGradientValue::computeStops): (WebCore::CSSConicGradientValue::createGradient): (WebCore::LinearGradientAdapter::startPoint const): Deleted. (WebCore::LinearGradientAdapter::endPoint const): Deleted. (WebCore::RadialGradientAdapter::startPoint const): Deleted. (WebCore::RadialGradientAdapter::endPoint const): Deleted. Start and End points weren't very universal. All we really need from these gradientAdapters is their length, so just ask for that instead. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): * platform/graphics/Gradient.cpp: (WebCore::Gradient::create): (WebCore::Gradient::Gradient): (WebCore::Gradient::type const): (WebCore::Gradient::adjustParametersForTiledDrawing): (WebCore::Gradient::isZeroSize const): (WebCore::Gradient::hash const): * platform/graphics/Gradient.h: * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): Source/WebCore/PAL: Define the CG functionality for conic gradients. * pal/spi/cg/CoreGraphicsSPI.h: Source/WebKit: Connect up web preferences to allow conic gradients to be turned on in the experimental features menu. * Shared/WebPreferences.yaml: LayoutTests: Simple tests to see if conic gradients are rendered properly. * fast/gradients/conic-expected.html: Added. * fast/gradients/conic-repeating-expected.html: Added. * fast/gradients/conic-repeating.html: Added. * fast/gradients/conic.html: Added. Canonical link: https://commits.webkit.org/204375@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-07 01:36:36 +00:00
}
#box3 {
height: 25px;
width: 25px;
background-color: orange;
}
</style>
</head>
<body>
<div id="box1"></div>
<div id="box2"></div>
<div id="box3"></div>
</body>
</html>