Bug 77233

Summary: DrawGradient improvements in OutputDevice
Product: LibreOffice Reporter: Chris Sherlock <chris.sherlock79>
Component: graphics stackAssignee: Chris Sherlock <chris.sherlock79>
Status: RESOLVED FIXED    
Severity: enhancement CC: chris.sherlock79
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard: target:4.3.0
Crash report or crash signature: Regression By:

Description Chris Sherlock 2014-04-09 09:34:12 UTC
DrawGradient has the following issues:

1. There are two functions, one takes a Rectangle parameter, the other a PolyPolygon parameter. Both functions essentially do the same thing, and the code is actually so similar that when I slightly reorganized it the only difference is negligible.

See commit "Starting to bring DrawGradient functions into line with each other" at http://cgit.freedesktop.org/libreoffice/core/commit/vcl?id=954d7ad4ea7ec3746b0f0cd3f850a25e82b39c14

2. When you build a gradient, it detects if a metafile is needed. If the polygon is actually a rectangle, we really should detect this and not bother to encase the polygon in XGRAD_SEQ_(BEGIN|END) comment headers. 

3. ClipAndDrawGradientMetafile has the option of using XOR clipping. This is not really desirable for a number of reasons. We should probably deprecate/remove this from the code. 

4. We have gradient code in other places. Should we move this to the OutputDevice code perhaps?
Comment 1 Chris Sherlock 2014-04-12 04:39:21 UTC
Commit pushed to address point 2 (When you build a gradient, it detects if a metafile is needed. If the polygon is actually a rectangle, we really should detect this and not bother to encase the polygon in XGRAD_SEQ_(BEGIN|END) comment headers.)

http://cgit.freedesktop.org/libreoffice/core/commit/vcl?id=0156a3c3ce5359b19b05248801571a56d320c2a8
Comment 3 Chris Sherlock 2014-04-12 04:44:49 UTC
Point 4 is perhaps an invalid point. Scratch that.
Comment 4 Chris Sherlock 2014-12-02 00:14:56 UTC
This is now largely fixed - and we now have a hook in SalGraphics to allow for native gradients (which is being used by OpenGL now!).