Bug 35680 - FORMATTING: Gradient rendered wrongly in presentation mode when grouped
Summary: FORMATTING: Gradient rendered wrongly in presentation mode when grouped
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
3.3.1 release
Hardware: All All
: medium normal
Assignee: Radek Doulik
URL:
Whiteboard: target:4.0.0.0.beta0 target:4.1.0
Keywords:
: 46735 (view as bug list)
Depends on:
Blocks: Impress-Gradient
  Show dependency treegraph
 
Reported: 2011-03-25 17:00 UTC by Fabian
Modified: 2012-12-13 11:41 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Presentation mode of 6 rectangles with gradient. The 3 on the right are grouped and render incorrectly. The 3 on the left are not grouped. (11.51 KB, image/png)
2011-03-25 17:00 UTC, Fabian
Details
The odp file to the given screenshot. To reproduce, open and press F5. (55.47 KB, application/vnd.oasis.opendocument.presentation)
2011-03-25 17:12 UTC, Fabian
Details
form filled with a gradient and grouped with text will not render correctly during slideshow (10.79 KB, application/vnd.oasis.opendocument.presentation)
2012-04-03 05:45 UTC, Oliver
Details
hack that fixes it. (1.06 KB, patch)
2012-12-06 10:40 UTC, Michael Meeks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian 2011-03-25 17:00:38 UTC
Created attachment 44865 [details]
Presentation mode of 6 rectangles with gradient. The 3 on the right are grouped and render incorrectly. The 3 on the left are not grouped.

Grouped objects with gradients are sometimes rendered wrongly in "presentation" mode. In editing mode they are rendered ok.
Comment 1 Fabian 2011-03-25 17:12:06 UTC
Created attachment 44866 [details]
The odp file to the given screenshot. To reproduce, open and press F5.
Comment 2 Fabian 2011-03-25 17:12:40 UTC
Steps to reproduce (as on the screenshot):
==========================================
1) Create three rectangles and fill them with a vertical linear gradient. 
2) Distribute them so they have a different vertical position
3) They will look good in editing mode AND presentation mode (F5).
4) Group them together
5) They will still look good in editing mode but NOT in presentation mode. Here, the topmost rectangle is rendered ok and the others have partial gradients.

Possible cause:
===============
I assume, the behavior is caused by a wrong calculation of the position of the outer borders of the object that has the gradient on it: 
When ungrouped, every object takes its own outer borders as reference. When in a group, the groups outer borders are taken as reference for /all/ objects.
Comment 3 Rainer Bielefeld Retired 2011-03-26 01:49:10 UTC
[Reproducible] with reporter's sample document and self created presentations with "LibreOffice 3.3.2  – WIN7  Home Premium  (64bit) German UI [OOO330m19 (Build:202 / tag 3.3.2.2)]".

Same problem with OOo-dev 3.4, but not with 3.1.1
Comment 4 Rainer Bielefeld Retired 2011-04-05 22:50:06 UTC
@Radek:
One for you?
BTW, I found that LibO also suffers from OOo bug "Wrong display of grouped shapes with gradients in slideshow"
<http://openoffice.org/bugzilla/show_bug.cgi?id=111307>
Related to this one?
Comment 5 Fabian 2011-04-06 13:40:13 UTC
The referenced OOo-Bug looks the same to me.

http://openoffice.org/bugzilla/show_bug.cgi?id=111307
Comment 6 Fabian 2011-12-16 10:55:16 UTC
Still happens in current 3.5 beta:

LOdev 3.5.0 
Build-ID: 7362ca8-b5a8e65-af86909-d471f98-61464c4
Comment 7 Rainer Bielefeld Retired 2012-02-28 21:56:43 UTC
*** Bug 46735 has been marked as a duplicate of this bug. ***
Comment 8 Oliver 2012-04-03 05:44:15 UTC
I have still the problem in version 3.5.1.2 : 

here , when I group a form filled with a gradient with text, then during the slideshow the form is rendered with one unique colour (one of the gradient), but not with the gradient (see attached file).
Comment 9 Oliver 2012-04-03 05:45:23 UTC
Created attachment 59419 [details]
form filled with a gradient and grouped with text will not render correctly during slideshow
Comment 10 kitaets 2012-07-06 15:42:38 UTC
I've seen the same issue in 3.5.5rc3 and 3.6.0.0.beta3. 
Very annoying because when you have plenty objects in your slide you usually group them. But this bug makes you choose between gradients and grouping.
Comment 11 kitaets 2012-07-13 16:43:34 UTC
Have tried 3.5.5 release - this bug is alive.
Comment 12 Florian Reisinger 2012-09-07 13:58:32 UTC
Confirmed with Version 3.6.1.2 on Win 7 x64
Comment 13 Michael Meeks 2012-12-05 19:53:33 UTC
confirmed with 4.0beta1 - I assume this is something to do with the meta-file replaying that is done to re-render the scene; it even happens using a vcl canvas [ hardware acceleration turned off ].
Comment 14 Michael Meeks 2012-12-06 10:07:47 UTC
The problem appears to be the rendering in:

cppcanvas/source/mtfrenderer/implrenderer.cxx (createGradientAction)

the test uses the GradientStyle_LINEAR, and for the problem cases the aBounds MinX, MinY reflects the position inside the group instead of ~0,0 for the shapes causing issues.
Comment 15 Michael Meeks 2012-12-06 10:26:08 UTC
bug pre-dates LibreOffice, is present in AOO (it appears). Digging through the log, I begin to suspect:

commit 1837a267a2cf82b0152631e416d8be66c2adef25
Author: thb <thb@openoffice.org>
Date:   Fri Oct 16 00:43:16 2009 +0200

    #i105937# Much improved gradient support for canvas/basegfx/drawinglayer.
    
    See http://blog.thebehrens.net/2009/07/28/hackweek-iv-canvas-convwatch/ for more background information

seems like the last big tweak to this code - but that's quite a while back !
Comment 16 Michael Meeks 2012-12-06 10:39:22 UTC
I have a prototype patch; Thorsten can you review it ? :-)
Comment 17 Michael Meeks 2012-12-06 10:40:56 UTC
Created attachment 71080 [details]
hack that fixes it.

Not sure the code-path is well tested that is here; I'm tempted to excise it, comment as well. It's also curious (to me) that we fiddle with maTextureTransform without re-setting maBackTextureTransform all around the place (why duplicate that state?).
Comment 18 Michael Meeks 2012-12-11 11:00:42 UTC
pushed to master and (shortly) -4-0 with Thorsten's sign-off from IRC - thanks for the report :-)
Comment 19 Not Assigned 2012-12-11 11:07:27 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6ca5bb7683af39997a267952f053d7c08a1516e8&g=libreoffice-4-0

fdo#35680 - fix wrong gradient rendering when grouped.


It will be available in LibreOffice 4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 20 Not Assigned 2012-12-11 11:07:53 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b8511cef9a452adc90b8dccc23ee1b29c1da63fc

fdo#35680 - fix wrong gradient rendering when grouped.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 21 kitaets 2012-12-13 11:14:02 UTC
Thank you Michael very much!
Comment 22 Michael Meeks 2012-12-13 11:41:16 UTC
my pleasure ! thanks for reporting - all QA (and particularly bug triage) around LibreOffice 4.0 is much appreciated :-)