Issue 7629 - Flicker in rendering gradient filled polygons (patch)
Summary: Flicker in rendering gradient filled polygons (patch)
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: marc.neumann
QA Contact: issues@gsl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-10 11:45 UTC by mmeeks
Modified: 2003-01-14 13:25 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
the patch. (2.12 KB, patch)
2002-09-10 11:45 UTC, mmeeks
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2002-09-10 11:45:17 UTC
The attached patch fixes the flicker for me; at the cost of a new visual.
Comment 1 mmeeks 2002-09-10 11:45:55 UTC
Created attachment 2787 [details]
the patch.
Comment 2 thb 2002-09-10 12:17:18 UTC
Thanks
Comment 3 thb 2002-09-10 13:21:08 UTC
Accepted as a performance problem
Comment 4 thb 2002-09-26 13:56:58 UTC
Okay, slowly but surely getting to the reasons why this was implemented the way it is. 
The problem with using clip regions or the attached fix is, that depending on OS, 
graphic hardware, zoom level and object complexity, you will wait quite some seconds 
before _anything_ of the gradient filled object is drawn. The old approach, on the 
other hand, was at least "doing something" (although that something was really 
ugly).

So, the way it is, I don't think it's wise to take the fix right away. 
Currently trying to figure out if the painting of the gradient itself (which is the 
bottleneck for the problem described above) can be sped up.
Comment 5 thb 2002-09-30 09:59:55 UTC
Reverted to painting the gradient with a set clip region. That gives immediate visual 
feedback to the user, but the painting occurs only within the polygon 
area.

Sadly, that revealed a bug in our clip region implementation, which I was 
not able to fix up to now (actually, I don't know if it is fixable without major 
overhaul).
Comment 6 mmeeks 2002-09-30 12:11:21 UTC
Not convinced totally by the explanation.

Ultimately, the slow part of rendering this, I imagine - has to be
rendering the gradient polygon - which is rendered off screen and then
blitted onto the display [ AFAIR ], so ... the umpteen polygon renders
of the gradient [ vs. the most likely faster polygon render ] will
happen off-screen [ AFAIR ].
Comment 7 thb 2002-09-30 14:22:49 UTC
The status quo is painting the up to 255 coloured polygons for the gradient, clipped to 
the bounding rectangle of the polygon-to-be-filled. Your fix moves all painting 
offscreen, which can lead to a several second long lag during repaint. My try was to set 
the fill polygon as a clip region, and render the coloured polygons into that clip. 
Gives immediate visual feedback, but is buggy for several special cases of polygons: 
try this at the known place:

{
    Rectangle aBoundRect( 
rPolyPoly.GetBoundRect() );

    Push( PUSH_CLIPREGION );
    
IntersectClipRegion( rPolyPoly );
    DrawGradient( aBoundRect, aGradient );
    
Pop();
}

Just for laughs, I attached a document containing a polygon that looks 
kinda funny with that fix...
Comment 8 mmeeks 2002-09-30 14:33:32 UTC
Most interesting; my co-worker; federico@ximian.com is re-implementing
the gpc intersector using libart due to licensing issue; and I'm sure
would be most interested in this.
Comment 9 thb 2002-10-14 11:07:45 UTC
Okay, okay, although not completely convinced, we'll do it as you proposed: painting 
completely within a VDev now. What finally made me reverting to this solution was the 
fact that we cannot guarantee pixel-by-pixel match with any home-brewn clipping or 
scanline-conversion, _if_ we subsequently paint the border of a polygon with 
Windows/X11/whatever system routines. 

Find the fix in 
vcl/source/gdi/outdev4.cxx rev. 1.12
Comment 10 thb 2002-12-05 17:37:30 UTC
Reopened, has to be verified.
Comment 11 thb 2002-12-05 17:39:46 UTC
Marc, please verify and close if okay.
Comment 12 marc.neumann 2003-01-14 13:25:27 UTC
fixed
Comment 13 marc.neumann 2003-01-14 13:25:38 UTC
closed