WebKit Bugzilla
Attachment 349495 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-20180911171325.patch (text/plain), 4.40 KB, created by
Megan Gardner
on 2018-09-11 17:13:26 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2018-09-11 17:13:26 PDT
Size:
4.40 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..9dc9450c370898b8b9e0729afed7ef897c150d4c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+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. >+ > 2018-09-10 Truitt Savell <tsavell@apple.com> > > Rebaseline test after https://trac.webkit.org/changeset/235866/webkit. >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>
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