Bug 73038 - recording surface with paint with alpha and clipping loses alpha
Summary: recording surface with paint with alpha and clipping loses alpha
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
: 89533 (view as bug list)
Depends on:
Blocks: cairo-1.14
  Show dependency treegraph
 
Reported: 2013-12-26 07:31 UTC by Adrian Johnson
Modified: 2015-07-27 18:11 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Copy source and mask to the recording surface (1.22 KB, patch)
2015-06-26 02:02 UTC, Bryce Harrington
Details | Splinter Review

Description Adrian Johnson 2013-12-26 07:31:19 UTC
The test case paint-with-alpha-group-clip has been extracted from the bug report at https://bugs.launchpad.net/inkscape/+bug/1258265

The rectangle is gray on the image surface output and black on the paginated backends.

Up until 8020e0bc this was working. After that commit the output is blank. Sometime later the output started appearing again but the alpha has been lost.
Comment 1 Massimo 2015-01-14 11:42:53 UTC
The commit mentioned above 
 
http://cgit.freedesktop.org/cairo/commit/src/cairo-recording-surface.c?id=8020e0bc8cbd3e5ac188eb305b74ae1c1f362a31 
 
introduced an explicit copy of the command array and you can easily 
spot that in '_cairo_recording_surface_copy__mask' the pattern 
'src->mask.source.base' is copied both to the 'command->source.base' 
and to 'command->mask.base'. 
 
Copying 'src->mask.mask.base' to 'command->mask.base' seems to fix the issue 
here and that reported at:  
 
https://bugs.freedesktop.org/show_bug.cgi?id=73901 
 
and few other test suite failures.
Comment 2 Vladimir Rapatskiy 2015-03-11 18:42:40 UTC
*** Bug 89533 has been marked as a duplicate of this bug. ***
Comment 3 Bryce Harrington 2015-06-26 02:02:16 UTC
Created attachment 116725 [details] [review]
Copy source and mask to the recording surface

This implements the fix Massimo suggests.
Comment 4 Bryce Harrington 2015-07-27 18:11:20 UTC
commit 1bcce4362927952b25cb916f862dde6fd35f8125
Author:     Bryce Harrington <bryce@osg.samsung.com>
AuthorDate: Thu Jun 25 18:54:23 2015 -0700
Commit:     Bryce Harrington <bryce@osg.samsung.com>
CommitDate: Thu Jun 25 18:54:23 2015 -0700

    cairo-recording-surface: Fix loss of alpha when clipping

    Commit 8020e0bc introduced a regression due to a typo when copying a
    mask for a cairo recording surface.  It should copy the source and mask
    members from the command source to the recording surface, but instead it
    copies the source twice.

    Fix suggested by Massimo.

    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73038
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73901


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.