WebKit Bugzilla
Attachment 349569 Details for
Bug 189532
: Fix color stop blending in conic gradients for stops past 1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189532-20180912125932.patch (text/plain), 6.30 KB, created by
Megan Gardner
on 2018-09-12 12:59:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2018-09-12 12:59:33 PDT
Size:
6.30 KB
patch
obsolete
>Subversion Revision: 235877 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cc605918098d1e4147496792f106cad87316e204..0a329f732ee3eb772b31cac0b47d61dd636e5219 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-09-11 Megan Gardner <megan_gardner@apple.com> >+ >+ Fix color stop blending in conic gradients for stops past 1 >+ https://bugs.webkit.org/show_bug.cgi?id=189532 >+ <rdar://problem/44158221> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: fast/gradients/conic-repeating-last-stop.html >+ >+ Calculation was wrong, fixed it, and wrote a test that failed >+ without the change, and passes with it. >+ >+ * css/CSSGradientValue.cpp: >+ (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange): >+ > 2018-09-10 Megan Gardner <megan_gardner@apple.com> > > Correctly interpret from angle for conic gradients >diff --git a/Source/WebCore/css/CSSGradientValue.cpp b/Source/WebCore/css/CSSGradientValue.cpp >index 700c63daadcac6a0193411f2ba2b65975e4515bf..898b1e2e74ad7ec217775edc6affdbdd62db52db 100644 >--- a/Source/WebCore/css/CSSGradientValue.cpp >+++ b/Source/WebCore/css/CSSGradientValue.cpp >@@ -280,7 +280,7 @@ public: > float prevOffset = stops[lastOneOrLessIndex].offset; > float nextOffset = stops[lastOneOrLessIndex + 1].offset; > >- float interStopProportion = 1 / (nextOffset - prevOffset); >+ float interStopProportion = (1 - prevOffset) / (nextOffset - prevOffset); > // FIXME: when we interpolate gradients using premultiplied colors, this should do premultiplication. > Color blendedColor = blend(stops[lastOneOrLessIndex].color, stops[lastOneOrLessIndex + 1].color, interStopProportion); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 09edb95156b4718b3a8fa1a1366b46ddce46410a..d0a43c4253779ca38cc9e22973660501e33860e9 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2018-09-11 Megan Gardner <megan_gardner@apple.com> >+ >+ Fix color stop blending in conic gradients for stops past 1 >+ https://bugs.webkit.org/show_bug.cgi?id=189532 >+ <rdar://problem/44158221> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tests that last stop in the gradient is correct. >+ >+ * fast/gradients/conic-repeating-last-stop-expected.html: Added. >+ * fast/gradients/conic-repeating-last-stop.html: Added. >+ * platform/ios-12/TestExpectations: >+ * platform/mac/TestExpectations: >+ > 2018-09-10 Truitt Savell <tsavell@apple.com> > > Rebaseline test after https://trac.webkit.org/changeset/235866/webkit. >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index a081bb2e9ce49849389c2751d0c28caa27f93a02..68253cac3f32f9fb6db1c00968dec8baa0aad0d8 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -2243,3 +2243,4 @@ fast/gradients/conic-off-center.html [ Skip ] > fast/gradients/conic-center-outside-box.html [ Skip ] > fast/gradients/conic-extended-stops.html [ Skip ] > fast/gradients/conic-from-angle.html [ Skip ] >+fast/gradients/conic-repeating-last-stop.html [ Skip ] >diff --git a/LayoutTests/fast/gradients/conic-repeating-last-stop-expected.html b/LayoutTests/fast/gradients/conic-repeating-last-stop-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2e8a53cacce4d1f0615975a9ad19efa64b38df90 >--- /dev/null >+++ b/LayoutTests/fast/gradients/conic-repeating-last-stop-expected.html >@@ -0,0 +1,18 @@ >+<html> >+<head> >+ <style> >+ div { >+ width: 200px; >+ height: 200px; >+ } >+ >+ #box1 { >+ background-color: yellow; >+ } >+ >+ </style> >+</head> >+<body> >+ <div id="box1"></div> >+</body> >+</html> >diff --git a/LayoutTests/fast/gradients/conic-repeating-last-stop.html b/LayoutTests/fast/gradients/conic-repeating-last-stop.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d766d24fcbd3e9e87252c83ee8495d9a790f716f >--- /dev/null >+++ b/LayoutTests/fast/gradients/conic-repeating-last-stop.html >@@ -0,0 +1,42 @@ >+<html> >+<head> >+<style> >+svg { >+ width: 800px; >+ display: none; >+} >+ >+.container { >+ width: 200px; >+ height: 200px; >+ overflow: hidden; >+} >+ >+#test { >+ width: 200px; >+ height: 200px; >+ background-image: repeating-conic-gradient(gold, orange 20deg); >+ filter: url(#posterize); >+ transform: scale(20); >+ transform-origin: 45% top; >+} >+</style> >+</head> >+ >+<body> >+<svg viewBox="0 0 700 100"> >+<defs> >+ <filter id="posterize" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox"> >+ <feComponentTransfer> >+ <feFuncR type="discrete" tableValues="0 1"/> >+ <feFuncG type="discrete" tableValues="0 1"/> >+ <feFuncB type="discrete" tableValues="0 1"/> >+ </feComponentTransfer> >+ </filter> >+</defs> >+</svg> >+ >+<div class="container"> >+ <div id="test"></div> >+</div> >+</html> >diff --git a/LayoutTests/platform/ios-12/TestExpectations b/LayoutTests/platform/ios-12/TestExpectations >index 362cd87a06c09f5464d60c84da8b22dd68f374c9..53ffd775d0e3b7c4c3b4f58348ab2aa02d6a1f7e 100644 >--- a/LayoutTests/platform/ios-12/TestExpectations >+++ b/LayoutTests/platform/ios-12/TestExpectations >@@ -32,4 +32,5 @@ fast/gradients/conic.html [ Pass ] > fast/gradients/conic-off-center.html [ Pass ] > fast/gradients/conic-center-outside-box.html [ Pass ] > fast/gradients/conic-extended-stops.html [ Pass ] >-fast/gradients/conic-from-angle.html [ Pass ] >\ No newline at end of file >+fast/gradients/conic-from-angle.html [ Pass ] >+fast/gradients/conic-repeating-last-stop.html [ Pass ] >diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations >index b4d9fc4aa1ad39f8efd1fb1a6cc449ae38ef1c44..65c09cd42403422e232303d010cc32d9636a6876 100644 >--- a/LayoutTests/platform/mac/TestExpectations >+++ b/LayoutTests/platform/mac/TestExpectations >@@ -1764,4 +1764,5 @@ webkit.org/b/187393 imported/w3c/web-platform-tests/2dcontext/imagebitmap/create > [ Mojave+ ] fast/gradients/conic-center-outside-box.html [ Pass ] > [ Mojave+ ] fast/gradients/conic-extended-stops.html [ Pass ] > [ Mojave+ ] fast/gradients/conic-from-angle.html [ Pass ] >+[ Mojave+ ] fast/gradients/conic-repeating-last-stop.html [ Pass ] >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189532
:
349495
|
349503
|
349510
|
349512
|
349516
|
349521
|
349569
|
349577
|
349580
|
349582
|
349605