mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 539165. Fix single and multi-stop solid gradients by multiplying by the alpha component. r=roc
This cairo commit that caused the problem: 2d790daa957471670f4ae0d3b22da89e4ee7111f. It was merged into mozilla-central with 1effb72d30cf
This commit is contained in:
parent
d2247e1c10
commit
5562b46b91
@ -64,6 +64,8 @@ quartz-first-stop.patch: return the first stop for negative positions on the gra
|
|||||||
|
|
||||||
quartz-glyph-extents.patch: bug 534260; work around incorrect glyph extents returned by quartz for anomalous empty glyphs
|
quartz-glyph-extents.patch: bug 534260; work around incorrect glyph extents returned by quartz for anomalous empty glyphs
|
||||||
|
|
||||||
|
premultiply-alpha-solid-gradients.patch: bug 539165; multiply the solid color by the alpha component before using it for a solid surface
|
||||||
|
|
||||||
==== pixman patches ====
|
==== pixman patches ====
|
||||||
|
|
||||||
pixman-neon.patch: add ARM NEON optimized compositing functions
|
pixman-neon.patch: add ARM NEON optimized compositing functions
|
||||||
|
@ -2262,8 +2262,17 @@ _cairo_pattern_acquire_surface (const cairo_pattern_t *pattern,
|
|||||||
|
|
||||||
if (src->n_stops)
|
if (src->n_stops)
|
||||||
{
|
{
|
||||||
|
cairo_color_t color;
|
||||||
|
|
||||||
|
/* multiply by alpha */
|
||||||
|
_cairo_color_init_rgba (&color,
|
||||||
|
src->stops->color.red,
|
||||||
|
src->stops->color.green,
|
||||||
|
src->stops->color.blue,
|
||||||
|
src->stops->color.alpha);
|
||||||
|
|
||||||
_cairo_pattern_init_solid (&solid,
|
_cairo_pattern_init_solid (&solid,
|
||||||
&src->stops->color,
|
&color,
|
||||||
CAIRO_CONTENT_COLOR_ALPHA);
|
CAIRO_CONTENT_COLOR_ALPHA);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2295,9 +2304,17 @@ _cairo_pattern_acquire_surface (const cairo_pattern_t *pattern,
|
|||||||
}
|
}
|
||||||
if (i == src->n_stops) {
|
if (i == src->n_stops) {
|
||||||
cairo_solid_pattern_t solid;
|
cairo_solid_pattern_t solid;
|
||||||
|
cairo_color_t color;
|
||||||
|
|
||||||
|
/* multiply by alpha */
|
||||||
|
_cairo_color_init_rgba (&color,
|
||||||
|
src->stops->color.red,
|
||||||
|
src->stops->color.green,
|
||||||
|
src->stops->color.blue,
|
||||||
|
src->stops->color.alpha);
|
||||||
|
|
||||||
_cairo_pattern_init_solid (&solid,
|
_cairo_pattern_init_solid (&solid,
|
||||||
&src->stops->color,
|
&color,
|
||||||
CAIRO_CONTENT_COLOR_ALPHA);
|
CAIRO_CONTENT_COLOR_ALPHA);
|
||||||
|
|
||||||
status =
|
status =
|
||||||
|
46
gfx/cairo/premultiply-alpha-solid-gradients.patch
Normal file
46
gfx/cairo/premultiply-alpha-solid-gradients.patch
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
Fix single and multi-stop solid gradients by multiplying by the alpha component. r=roc
|
||||||
|
|
||||||
|
This cairo commit that caused the problem: 2d790daa957471670f4ae0d3b22da89e4ee7111f.
|
||||||
|
It was merged into mozilla-central with 1effb72d30cf
|
||||||
|
|
||||||
|
diff --git a/gfx/cairo/cairo/src/cairo-pattern.c b/gfx/cairo/cairo/src/cairo-pattern.c
|
||||||
|
--- a/gfx/cairo/cairo/src/cairo-pattern.c
|
||||||
|
+++ b/gfx/cairo/cairo/src/cairo-pattern.c
|
||||||
|
@@ -2262,8 +2262,17 @@ _cairo_pattern_acquire_surface (const ca
|
||||||
|
|
||||||
|
if (src->n_stops)
|
||||||
|
{
|
||||||
|
+ cairo_color_t color;
|
||||||
|
+
|
||||||
|
+ /* multiply by alpha */
|
||||||
|
+ _cairo_color_init_rgba (&color,
|
||||||
|
+ src->stops->color.red,
|
||||||
|
+ src->stops->color.green,
|
||||||
|
+ src->stops->color.blue,
|
||||||
|
+ src->stops->color.alpha);
|
||||||
|
+
|
||||||
|
_cairo_pattern_init_solid (&solid,
|
||||||
|
- &src->stops->color,
|
||||||
|
+ &color,
|
||||||
|
CAIRO_CONTENT_COLOR_ALPHA);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
@@ -2295,9 +2304,17 @@ _cairo_pattern_acquire_surface (const ca
|
||||||
|
}
|
||||||
|
if (i == src->n_stops) {
|
||||||
|
cairo_solid_pattern_t solid;
|
||||||
|
+ cairo_color_t color;
|
||||||
|
+
|
||||||
|
+ /* multiply by alpha */
|
||||||
|
+ _cairo_color_init_rgba (&color,
|
||||||
|
+ src->stops->color.red,
|
||||||
|
+ src->stops->color.green,
|
||||||
|
+ src->stops->color.blue,
|
||||||
|
+ src->stops->color.alpha);
|
||||||
|
|
||||||
|
_cairo_pattern_init_solid (&solid,
|
||||||
|
- &src->stops->color,
|
||||||
|
+ &color,
|
||||||
|
CAIRO_CONTENT_COLOR_ALPHA);
|
||||||
|
|
||||||
|
status =
|
42
layout/reftests/svg/opacity-and-gradient-02-ref.svg
Normal file
42
layout/reftests/svg/opacity-and-gradient-02-ref.svg
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<!--
|
||||||
|
Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/licenses/publicdomain/
|
||||||
|
-->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||||
|
|
||||||
|
<title>Testcase for opacity on elements referencing a gradient</title>
|
||||||
|
|
||||||
|
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=539165 -->
|
||||||
|
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="lime" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="lime"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="red" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="red"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="red2" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="red" offset="0%"/>
|
||||||
|
<stop stop-color="red" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="redgreen" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="red" offset="0%"/>
|
||||||
|
<stop stop-color="lime" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<rect width="100%" height="100%" fill="url(#lime)"/>
|
||||||
|
|
||||||
|
<!-- test 'opacity' -->
|
||||||
|
<rect width="25%" height="100%" fill="url(#red)" opacity="0.5"/>
|
||||||
|
|
||||||
|
<!-- test 'fill-opacity' -->
|
||||||
|
<rect x="25%" width="25%" height="100%" fill="url(#red)" fill-opacity="0.5"/>
|
||||||
|
|
||||||
|
<!-- test 'fill-opacity' -->
|
||||||
|
<rect x="50%" width="25%" height="100%" fill="url(#red2)" fill-opacity="0.5"/>
|
||||||
|
|
||||||
|
<!-- test 'fill-opacity' -->
|
||||||
|
<rect x="75%" width="25%" height="100%" fill="url(#redgreen)" fill-opacity="0"/>
|
||||||
|
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
28
layout/reftests/svg/opacity-and-gradient-02.svg
Normal file
28
layout/reftests/svg/opacity-and-gradient-02.svg
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<!--
|
||||||
|
Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/licenses/publicdomain/
|
||||||
|
-->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||||
|
|
||||||
|
<title>Testcase for opacity on elements referencing a gradient</title>
|
||||||
|
|
||||||
|
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=539165 -->
|
||||||
|
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="lime" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="lime"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<rect width="100%" height="100%" fill="url(#lime)"/>
|
||||||
|
|
||||||
|
<!-- test 'opacity' -->
|
||||||
|
<rect width="25%" height="100%" fill="red" opacity="0.5"/>
|
||||||
|
|
||||||
|
<!-- test 'fill-opacity' -->
|
||||||
|
<rect x="25%" width="25%" height="100%" fill="red" fill-opacity="0.5"/>
|
||||||
|
|
||||||
|
<!-- test 'fill-opacity' -->
|
||||||
|
<rect x="50%" width="25%" height="100%" fill="red" fill-opacity="0.5"/>
|
||||||
|
|
||||||
|
</svg>
|
After Width: | Height: | Size: 818 B |
@ -101,6 +101,7 @@ fails == inline-in-xul-basic-01.xul pass.svg
|
|||||||
== objectBoundingBox-and-pattern-01b.svg objectBoundingBox-and-pattern-01-ref.svg
|
== objectBoundingBox-and-pattern-01b.svg objectBoundingBox-and-pattern-01-ref.svg
|
||||||
== objectBoundingBox-and-pattern-01c.svg objectBoundingBox-and-pattern-01-ref.svg
|
== objectBoundingBox-and-pattern-01c.svg objectBoundingBox-and-pattern-01-ref.svg
|
||||||
fails-if(http.oscpu.match(/Mac\x20OS\x20X\x2010\.4$/)) == opacity-and-gradient-01.svg pass.svg # fails on OS X 10.4 (bug 379610)
|
fails-if(http.oscpu.match(/Mac\x20OS\x20X\x2010\.4$/)) == opacity-and-gradient-01.svg pass.svg # fails on OS X 10.4 (bug 379610)
|
||||||
|
== opacity-and-gradient-02.svg opacity-and-gradient-02-ref.svg
|
||||||
== opacity-and-pattern-01.svg pass.svg
|
== opacity-and-pattern-01.svg pass.svg
|
||||||
== path-01.svg path-01-ref.svg
|
== path-01.svg path-01-ref.svg
|
||||||
== pattern-live-01a.svg pattern-live-01-ref.svg
|
== pattern-live-01a.svg pattern-live-01-ref.svg
|
||||||
|
Loading…
Reference in New Issue
Block a user