<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Knockout cairo operator (SOURCE) is lost when nesting transparency groups"
href="https://bugs.freedesktop.org/show_bug.cgi?id=70684">70684</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>poppler-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>Knockout cairo operator (SOURCE) is lost when nesting transparency groups
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Reporter</th>
<td>michael@cadilhac.name
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86 (IA32)
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>cairo backend
</td>
</tr>
<tr>
<th>Product</th>
<td>poppler
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=87884" name="attach_87884" title="The offending PDF">attachment 87884</a> <a href="attachment.cgi?id=87884&action=edit" title="The offending PDF">[details]</a></span>
The offending PDF
IMPORTANT NOTE: for this PDF to be even displayed, one should first fix #70671
(I propose a simple fix therein).
In the attached PDF, the blue line should be displayed when behind the yellow
line. The yellow line is the last element of a knockout transparency group
which includes another group containing the blue line. The transparency of the
yellow line should be based on the original backdrop of the group (i.e., the
empty page).
The problem is caused by the restoration of the graphic state in Gfx::drawForm
(Gfx.cc:4947). It calls CairoOutputDev::restoreState which, instead of letting
cairo restore the current operator, sets it using
CairoOutputDev::updateBlendMode. Hence while the first elements of a knockout
groups are drawn using the right operator, i.e., CAIRO_OPERATOR_SOURCE, after a
nested group appears, the operator is reset (most probably to
CAIRO_OPERATOR_OVER, corresponding to Normal blend mode).
I fixed this in my local repo by moving the call to updateBlendMode from
restoreState to paintTransparencyGroup. I am not sure this is the perfect fix,
but it does work for my test case.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>