[Kde-games-devel] Ideas for QML support in libkdegames

Viranch Mehta viranch.mehta at gmail.com
Sat Mar 9 17:26:33 UTC 2013


On 09-Mar-2013, at 8:16 PM, Albert Astals Cid wrote:

> El Dissabte, 9 de març de 2013, a les 08:52:08, Ian Wadham va escriure:
>> On 08/03/2013, at 6:51 PM, Viranch Mehta wrote:
>>> but the images become gray for fraction of second as they're rendered.
>> 
>> I think these problems have been with us for about 7 years, ever since we
>> started porting to KDE 4 and required games to be themeable and resizable.
>> It seems to me that the best one can do is settle for the least ugly
>> alternative.
>> 
>> Using an unobtrusive background color (to appear before the background pic
>> is rendered) can at least avoid some flashing white rectangles.
> 
> To be honest the only solution i can think of is something similar. Put a 
> default background until all items are generated.

There are two problems with this:

1. The area of the image to be rendered is painted with gray until the time rendering
is finished, so even if we put a default background, it will be over-ridden by the gray
area. one possible solution is to have "opacity: status==Image.Ready ? 1 : 0" in the
items. this way it will stay transparent until its finished rendering. but this opacity
transformation on every resize may be computationally expensive.

> The question here is, can you know all items have been generated?

2. Exactly. we have no way of knowing when *all* of the requested images have
finished rendering. (we could of course maintain an internal counter of requests vs
replies but this sounds like a dirty hack).

Viranch



More information about the kde-games-devel mailing list