Results 1 to 19 of 19

Thread: How to speed up a transparent QGraphicsTextItem in Opengl?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to speed up a transparent QGraphicsTextItem in Opengl?

    Quote Originally Posted by JohannesMunk View Post
    Is this achieved by alphablending the pixmap/texture?
    Yep, something like that.

    Caching a pixmap is not what I had in mind when I spoke of an OpenGL-Displaylist. I sort of hoped to compile the actual vertex ops etc..
    The text is most likely rasterized first so you'd get four vertices and a texture. You get the same for a pixmap.

    Yes, so far that's clear. But if I would want to render the TextItem once outside a paintevent to compile a displaylist myself, I need to pass a valid style option. How do I get that?
    You need to fill one properly but then there is a question what would you fill in there. I assure you - you won't do better than what Qt already does in this field. You can't do better than blitting a texture into the buffer.

    Probably my problem with the cachemodes is that for nearly each repaint (camera position changed) I'm changing the projection of all items.
    You should be able to use ItemCoordinateCache with this approach. As long as you modify the transformations of items and not their internals, this should work.

    Where in the Qt sources do I find the caching modes implementation for the opengl painter?
    Either in src/gui/graphicsview/qgraphicsitem* or in src/opengl/qpaintengine_opengl* and src/opengl/qpixmapdata_gl*. I assume the bare caching code is the same regardless of the backend - it just stores an appropriate pixmap. The magic is how the pixmap works.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. The following user says thank you to wysota for this useful post:

    JohannesMunk (27th October 2009)

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. Does OpenGL speed up the loading image?
    By learning_qt in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2008, 09:26
  3. QMatrix rotate on QGraphicsTextItem speed on render..
    By patrik08 in forum Qt Programming
    Replies: 2
    Last Post: 22nd December 2007, 19:46
  4. OpenGL app at full speed? Can you do it?
    By mattropolis in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2007, 10:54
  5. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.