Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] GTK2 Tree: build, patch, and one smoking shot

snickell@xxxxxxxxxxxx writes: 
> So an option would be to provide the option of getting the pixbuf OR the
> pixmap, but rather than directly referencing them provide methods such
> as getPixmap() and getPixbuf() that either return the structure (if its
> up to date) or lazily render it from the other (if its not). In the
> normal (a) and (b) cases this would mean that no conversions would be
> done (since we would naturally create pixbufs when loading from a file,
> but pixmaps if starting from scratch).
> 
> In the cases where an Image is, say, drawn to (which would use pixmap)
> and then set to a control (which would use pixbuf) it would be drawn to
> as a pixmap, and the pixbuf version marked as "dirty", and then
> re-rendered as a pixbuf when getPixbuf was called. Similarly if you load
> a file (which would use a pixbuf), and then do getPixmap. Looking at the
> current code I don't think this ever happens, but of course its a case
> that would have to work (even if rare).

This is a pretty good idea IMO.

Havoc


Back to the top