[Kde-games-devel] Canvas updates

Maurizio Monge maurizio.monge at gmail.com
Wed Sep 27 01:18:48 CEST 2006


Hi, unluckily i never received the mail you are answering, where was it sent?
For the bug, i'm quite sure that Pixmap::setPixmap will not update the
entire group,
does your patch really improves performance?
And BTW, that patch breaks the case of a group being moved, because in this
case all the items have to be updated.
I you want to debug the canvas updates, i recommend you to set the
DEBUG_CANVAS_PAINTS define in canvas.cpp to 1, so you will have some
visual feedback (if you are somewhat masochist put also
DEBUG_DONT_MERGE_UPDATES to 1, this way you will see independently all
the operations that modify the canvas)
I also have a very small update in the kboard svn (in
playground/kboard/src/canvas)
that unifies the changedInternal  and changed functions (just a cleanup, they do
the same thing anyway).
Have fun! :)

On 9/26/06, mauricio at tabuleiro.com <mauricio at tabuleiro.com> wrote:
> > Maurizio, if you have time, could you use the technique above and check if
> > Pixmap->setPixmap() is not triggering a full redraw of the canvas, and not
> > only the lastrect and the new one, just to be sure? I will investigate it
> > myself as well later when I am more rested.
>
> OK! Found it, finally! The problem is that if your tile is in a group,
> then changed() will invoke Group::changedInternal() (In KGoldrunner this
> is KGrGameCanvasGroup). Look at the implementation and this will mark as
> members of the groups as changed, which in the case of KGoldRunner means
> that marking one tile as changed will dirty the whole field.
>
> A quick fix is in in KGrGameCanvas.h, if you want to use it in KBoard to
> test just change the inline implementation of changed to something like
>
> void changed() { KGrGameCanvasItem::changedInternal(); }
>
> Or maybe we should instead change in all item classes
>
> if(visible() && canvas() )
>     changed();
>
> to
>
> if(visible() && canvas() )
>     KGrGameCanvasItem::changed();
>
> Let me know what you think is the best solution, Maurizio. I am a bit
> tired right now, need to take a nap!
>
> Regards,
> Mauricio Piacentini
>
> BTW, I was seeing the same in QGV, so maybe it uses a similar design, and
> has the same issue? Will investigate it.
>
>
>
>
>
> _______________________________________________
> kde-games-devel mailing list
> kde-games-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-games-devel
>


-- 
Ciao
Maurizio

"Well we all shine on
Like the moon and the stars and the sun" (John Lennon)


More information about the kde-games-devel mailing list