Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGLFrameBufferObject QPaint in separate thread with two contexts?
Forum Updated to NodeBB v4.3 + New Features

QGLFrameBufferObject QPaint in separate thread with two contexts?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 612 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    drwho
    wrote on last edited by
    #1

    I'm drawing text using QPainter with a QGLFrameBufferObject as the paint device. The QGLFrameBufferObject texture is drawn in a QGLWidget. When panning (translating) I limit drawing to 12mS between draws. Once I get aprox half way panned, I redraw all the text now and then. There is a lot of calls to drawText so this can take +100mS which causes a noticable distrubance in the panning.

    Ideally I would like to have two QGLFrameBufferObjects, draw from one, QPaint to the other in a separate thread so the panning can keep using the old QGLFrameBufferObject / texture until all the text is redrawn. The issue is as I understand it, only one thread can acess the gl context at a time....the QPainter can't bind at the same time as the QGLWidget's draw/paint event needs to bind. so my question is, can I get a second gl context to put a second QGLFrameBufferObject in? and can the texture in the second context be shared with the first (QGLWidget's) context?

    Update
    I experimented changing the paint device to a QPixmap and no longer using the QGLFrameBufferObject. I can now draw the text in a seperate thread and QPixmap becomes a texture in the QGLWidget's draw/paint event with a call to bindTexture(); The problem is that the draw event is now bogged down with bindTexture() for large pixelmaps. Results below...

    Time it takes for bindTexture() to return for different QPixmap sizes
    Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller
    1000x600 5mS 120,000 pix/mS
    2372x1076 20mS 127,614 pix/mS
    3132x1566 35mS 140,135 pix/mS
    3436x1778 44mS 138,846 pix/mS

    Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 2)
    1000x600 12mS 50,000 pix/mS
    1500x892 29mS 46,138 pix/mS
    1698x1036 41mS 42,906 pix/mS

    Android Nexus 4
    1472x1910 109mS 25,794 pix/mS
    2328x1078 106mS 23,675 pix/mS

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved