Top layer, Blend mode is multipy, Pattern disappear

Bug #850992 reported by pRototype on 2011-09-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Krzysztof Kosinski

Bug Description

OS: Both XP and W7 affected
Inkscape 0.48+devel r10627

Steps to reproduce:
* New document
* Make two layers, Layer1 and Layer2 where Layer2 is the upper one.
* Set Layer2 blend mode to "multiply".
* Draw an object (or add picture) in Layer2
* Convert that object into pattern.

The pattern will now disappear. It should stay visible, and to get it visible, I found two ways to achieve that:
* Select the invisible object/pattern and move it
* Change Layer2 blend mode to something else.

su_v (suv-lp) on 2011-09-15
tags: added: filters-svg layers pattern
su_v (suv-lp) wrote :

Not reproduced with Inkscape 0.48.2
Reproduced with r9598 (cairo-rendering branch) and 0.48+devel r10634

Objects converted to pattern inside filtered groups (or layers) are initially not rendered on-canvas.

tags: added: groups regression renderer-cairo
removed: layers
Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
su_v (suv-lp) wrote :

To confirm a regression with the new renderer:
Not reproduced with Inkscape 0.48+devel r10325 (last revision before the merge of the cairo-rendering branch).

(All tests done on Mac OS X 10.5.8 (i386))

su_v (suv-lp) wrote :

Does not depend on specific filter effect, test attached sample with the same Gaussian blur effect applied to a
a) path
b) group

If the path inside the blurred group is convert to a pattern, it initially disappears from the canvas.

jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape trunk revision 11649.

Changed in inkscape:
status: Confirmed → Triaged
su_v (suv-lp) on 2012-09-24
Changed in inkscape:
milestone: none → 0.49
ScislaC (scislac) on 2012-11-20
tags: added: blocker
Martin Owens (doctormo) wrote :

There's a quicker way to get this bug to rear. Just try and group some objects in a multiplied layer.

Changed in inkscape:
assignee: nobody → Martin Owens (doctormo)
status: Triaged → In Progress
Martin Owens (doctormo) wrote :

This bug is beating me. I wonder if we can get some of the feBlend experts to have a look. For now I'm resetting stats.

Changed in inkscape:
assignee: Martin Owens (doctormo) → nobody
status: In Progress → Confirmed
Krzysztof Kosinski (tweenk) wrote :

This bug is caused by an interaction between finding the bounding box and updating the group that exposes bugs in shape implementations.

When a new group is created, its SPGroup::update() method chains up to SPItem::update() before updating the children. If the group is filtered, SPItem::update() needs to find the group's bounding box to compute the filter region, and so calls visualBounds(). This in turn calls the children's SPItem::bbox() virtual function. SPShape::bbox() uses _curve to compute the bounding box. Unfortunately, most shape implementations only set _curve from their parameters when update() is called on them, and do not reimplement SPItem::bbox(). As a result, the group receives an empty bounding box and sets that as the filter region, which causes the group to disappear until updateDisplay() is called again.

This bug can be fixed in 3 ways:
1) Update _curve in shape implementations in response to the set() virtual method.
2) Provide implementations fo bbox() that do not rely on _curve.
3) Last resort hack: chain up twice in SPGroup::update(), once at the beginning and once at the end. This might break various other things.

Krzysztof Kosinski (tweenk) wrote :

PS: it might also be possible to fix the breakage which happens when the chain-up in SPGroup::update() is moved to the bottom of the function (filter region of the group does not update when the group is moved). This would be the ideal solution.

Krzysztof Kosinski (tweenk) wrote :

Should be fixed in r12643.

Changed in inkscape:
assignee: nobody → Krzysztof Kosinski (tweenk)
status: Confirmed → Fix Committed
su_v (suv-lp) on 2013-10-01
tags: removed: blocker
Bryce Harrington (bryce) on 2015-02-21
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers