gfx/cairo/premultiply-alpha-solid-gradients.patch

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 Fix single and multi-stop solid gradients by multiplying by the alpha component. r=roc
michael@0 2
michael@0 3 This cairo commit that caused the problem: 2d790daa957471670f4ae0d3b22da89e4ee7111f.
michael@0 4 It was merged into mozilla-central with 1effb72d30cf
michael@0 5
michael@0 6 diff --git a/gfx/cairo/cairo/src/cairo-pattern.c b/gfx/cairo/cairo/src/cairo-pattern.c
michael@0 7 --- a/gfx/cairo/cairo/src/cairo-pattern.c
michael@0 8 +++ b/gfx/cairo/cairo/src/cairo-pattern.c
michael@0 9 @@ -2262,8 +2262,17 @@ _cairo_pattern_acquire_surface (const ca
michael@0 10
michael@0 11 if (src->n_stops)
michael@0 12 {
michael@0 13 + cairo_color_t color;
michael@0 14 +
michael@0 15 + /* multiply by alpha */
michael@0 16 + _cairo_color_init_rgba (&color,
michael@0 17 + src->stops->color.red,
michael@0 18 + src->stops->color.green,
michael@0 19 + src->stops->color.blue,
michael@0 20 + src->stops->color.alpha);
michael@0 21 +
michael@0 22 _cairo_pattern_init_solid (&solid,
michael@0 23 - &src->stops->color,
michael@0 24 + &color,
michael@0 25 CAIRO_CONTENT_COLOR_ALPHA);
michael@0 26 }
michael@0 27 else
michael@0 28 @@ -2295,9 +2304,17 @@ _cairo_pattern_acquire_surface (const ca
michael@0 29 }
michael@0 30 if (i == src->n_stops) {
michael@0 31 cairo_solid_pattern_t solid;
michael@0 32 + cairo_color_t color;
michael@0 33 +
michael@0 34 + /* multiply by alpha */
michael@0 35 + _cairo_color_init_rgba (&color,
michael@0 36 + src->stops->color.red,
michael@0 37 + src->stops->color.green,
michael@0 38 + src->stops->color.blue,
michael@0 39 + src->stops->color.alpha);
michael@0 40
michael@0 41 _cairo_pattern_init_solid (&solid,
michael@0 42 - &src->stops->color,
michael@0 43 + &color,
michael@0 44 CAIRO_CONTENT_COLOR_ALPHA);
michael@0 45
michael@0 46 status =

mercurial