Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-20080 Qt 5 refactor
  3. QTBUG-20083

QGuiGLContext needs to be made into a QObject, and have functionality enabling proper resource management

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • P1: Critical
    • 5.0.0
    • Other
    • None
    • aaa4a26f82f99fa8724841eba91bad029306e0ce 6e28e8441b698c3397c2c78125c877f2e9867cb1 1056d02ee07ab9bba3a4dd9f5fd483d45773e665 19a0048d1755d127607f66266ab4868191647b3c

    Description

      The QGLContextGroup, QGLContextResource, and QGLSharedResourceGuard need to be based on QGuiGLContext instead of QGLContext, and possible be made public. QGuiGLContext should have thread affinity as well, which it gets by being a QObject sub-class.

      Thus, when a QImage that is also cached as a GL texture is destroyed, we can check if a QGuiGLContext from the same group is owned by the current thread. If it is, we can make that context temporarily current in this thread, and destroy the GL texture resource. Otherwise, we need to send an event to a thread that does have a GL context from the same group, telling it to clean up the GL texture resource. This might require some thought to get right.

      Potentially some signals like aboutToBeDestroyed() are needed too.

      Attachments

        For Gerrit Dashboard: QTBUG-20083
        # Subject Branch Project Status CR V

        Activity

          People

            rodal Samuel Rødal
            rodal Samuel Rødal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes