[Gnome-print] Re: Another thing.



On 23 May 2000, Miguel de Icaza wrote:

> 
> > - Gdk canvas - doable, although headache. Maybe not needed at all, as Gdk
> > canvas cannot do many other thigs also.
> 
> What is the complexity here?  I agree, it might not be worth doing.

Current canvas clipping framework is designed for libart - i.e. clips are
defined as SVP-s. For Gdk based clipping it would me more meaningful to
have clipping bitmaps.

Best method I can imagine is following:

Convert clipsvp to list of Gdk point arrays (subpaths)
Create empty clip bitmap
XOR subpaths to clip

For fills:

Convert closed subpaths of bpath to list GdkPoint arrays
Create another empty bitmap (shape bitmap)
XOR subpaths to bitmap, using clip bitmap as mask
Draw rectangle, using shape bitmap as mask

For outlines:

Convert all subpaths of bpath to list of GdkPoint arrays
Draw outlined polygon to rectangle, using clip bitmap as mask

So, for every path drawed, there will be much overhead, creating and
preserving bitmaps and pointlists. I believe the result will be usually
slower than libart variant.
Current version caches shape clipmasks (only 1 mask per canvas) and can
draw unclipped Gdk paths. Unfortunately I cannot commit it at moment,
because cvs.gnome.org does not like me for unknown reason.

Best wishes,
Lauris







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]