Hello,
Sorry for late reply, i was too busy last week :(
On Fri, Oct 21, 2011 at 10:37 PM, Oliver Eichler <[email protected]>wrote:
> Ok, let's get back to this one. I branched the code and made quick rough
> hack to use QPixmap instead of QImage. Sadly that broke the DEM overlay.
> It looks like QPixmap does not like the alpha channel right now. But
> anyway, this is just a small test to compare both solutions. The branch
> can be found here:
>
>
> https://qlandkartegt.svn.sourceforge.net/svnroot/qlandkartegt/QLandkarteGT/branches/qpixmap/
>
> Thus everyone can compile it and compare to the trunk. In fact it's a
> bit faster, but I am still not sure if I want to drop thread safeness
> for it.
>
>
I've made video of QLGT from trunk and qpixmap branches.
trunk - http://www.youtube.com/watch?v=BWOTTiT2_sU (
http://guryanov.org/stuff/Video38.mp4)
qpixmap - http://www.youtube.com/watch?v=-CoF7U-fA6M (
http://guryanov.org/stuff/Video39.mp4)
Quality is low, but update rate is 100fps, so you can see the difference.
> I had a little offline discussion with Marc last weekend. He wanted to
> play a bit with rendering to QImage in a background thread while moving
> the buffer in foreground. Maybe he can explain it on his own.
>
>
As i understand, QPixmap stores pixels in the same format as videocard uses,
so drawing QPixmap is a simple copying a chunk of memory from main memory to
videocard's one. For drawing QImage you have to convert pixels to
videoadapter's format first - and this operation takes several times more
time, than copying. So for fast rendering large qimages must not be used at
all in paintEvent() method.
I've written a simple test program -
http://guryanov.org/stuff/testimage.tar.gz. Run it with path to large image
file as argument and it will draw image in a loop, method of draw can be
changed by pressing any key on the keyboard. Check draw time and CPU load -
it much smaller when drawing with pixmaps.
> I like to ask everyone who compiles QLGT on his own to compare both
> versions and to give feedback.
>
>
> Oliver
>
>
>
> > Hi Dmitry,
> >
> > I applied your patch and recorded frame rates quite the same as yours.
> Surely it's not as fast as a browser application that simply moves a static
> picture. Keep in mind that QLGT immediately starts to update the screen
> while moving the map. Most applications wait until you finish the move and
> update the map later. Thus with every screen update the map is rendered from
> scratch.
>
> >
> > But anyway, I am nosy how QLGT would perform if I do not use QImage at
> all. Maybe it's worth dropping the thread safeness and use a special thread
> save draw() for the cases it's needed. As I am a bit busy the next days this
> might take a bit.
> >
> >
> > Oliver
> >
>
>
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users