×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    3

    Smile QPainter: drawing performance

    Hi all,

    i would like to ask you for some hints regarding my little problem. I'm using hildon Qt 4.6 tech preview in Fremantle, my target device is nokia n900.

    I noticed that simple redrawing on the screen full size(800x480) QImage using QPainter (QPainter.drawImage()) is quite slow(n900). I went through all possible image formats from QImage::Format enum. The best performance has ARGB32 format, but it is only 14fps.

    The same task using QPixmap and QPainter.drawPixmap() method gives me up to 60fps.

    I understand that QImage is optimized for manipulating the data, and QPixmap for displaying it on the screen. But anyway, what if someone needs to have access to the pixel data and after some processing display it on the screen? With 14fps redrawing static image after some time spent on pixel data manipulations(and only that) i have about 7fps which is definitely too slow for me.

    In my case would be really great just to put some piece of memory with pixel data on the screen as fast as possible(that memory could be the pointer given by bits() method from QImage or even QByteArray without using QImage at all).

    I'm wondering about possible solutions, what i have in mind is:

    1) OpenGl+QGLWidget: create a texture for every frame from pixel data and display it on the screen, i'm not sure how would it work with such a big texture to create every frame, maybe someone of you already tried smt like that?

    2) QPixmap: convert pixel data to QPixmap and render it using QPainter, the problem is it will require a conversion which is not really fast... because there is no way to "fill up" existing QPixmap with other data (QPixmap::loadFromData can not read from raw pixel data) for now the solution is to create QPixmap and convert pixel data for every frame(with QPixmap::fromImage method)

    3) directFB<->framebuffer: more or less similar to dsa in symbian, known to people that have used QtEmbedded before(unfortunately i have not...), using some examples from the web i was able to display what i wanted in QWidget, anyway there was a problem with hildon desktop background events during (for example) changing battery level indicator screen was flickering, i heard about directfb driver for QtEmbedded that we can use simply by -gfx option, but anyone has already tried it on maemo?

    All comments to above ideas will be really appreciated, new advices will be even more.

    Thanks in advance
    Regards

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QPainter: drawing performance

    It seems that currently available Qt 4.5.3 is built without optimization. Try to rebuild packages with optimization enabled. In order to do that modify debian/rules and replace -debug configure key with -release.

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    3

    Re: QPainter: drawing performance

    Hi,

    thanks divanov, i will try it soon.

    Anyway i found smt really interesting today: http://www.kdedevelopers.org/node/3644 . I created a simple test project as described there and indeed, it is faster! In my case it is about 30%, and that difference can be seen easly.

    Does it mean that qt4.6 is still using 32 bit color depth internally? That is the reason why even RGB16 QImage is drawn so slowly???

  4. #4
    Registered User
    Join Date
    Jul 2008
    Posts
    8

    Re: QPainter: drawing performance

    I had similar problems some time ago, try to run your app with -graphicssystem raster parameter, and you will see the power of qt.

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QPainter: drawing performance

    Quote Originally Posted by paweld View Post
    I had similar problems some time ago, try to run your app with -graphicssystem raster parameter, and you will see the power of qt.
    Yeah, you can also use QApplication::setGraphicsSystem. But OpenGL would be the fastest any way.

  6. #6
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QPainter: drawing performance

    Hi,
    Note that in Qt for Maemo you can't set OpenGL as GraphicsSystem since it doesn't fall back to OpenGL ES2.
    Anyhow you can make QGraphicsView faster settting a QGLWidget as viewport.

    Antonio

Similar Threads

  1. Graphics performance on 5800 (BitBlt)
    By mark_williams in forum Symbian
    Replies: 4
    Last Post: 2008-11-21, 18:36
  2. S60 emulator performance and single IMG file
    By chall3ng3r in forum Tools and SDK Feedback (Closed)
    Replies: 0
    Last Post: 2008-02-18, 23:22
  3. Rendering performance when drawing text
    By xedarius in forum Mobile Java General
    Replies: 4
    Last Post: 2006-01-23, 14:19
  4. Which one is the fastest (in drawing) ?
    By Smori2002 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2003-11-12, 15:36
  5. Offscreen drawing and cursor
    By tolnaisz in forum Symbian
    Replies: 0
    Last Post: 2003-05-12, 17:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •