Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88876

Support rendering to QImage via QQuickRenderControl without having to use private APIs

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.0.0 Beta5
    • Fix Version/s: None
    • Component/s: Qt RHI, Quick: SceneGraph
    • Labels:
      None

      Description

      Currently to render offscreen using QQuickRenderControl, you need to QQuickWindow::setRenderTarget - and all available {{QQuickRenderTarget}}s are native, so you need 4 different native implementations.

      Qt should expose a cross-platform QQuickRenderTarget so that I can render to this then read back the results as a QImage. This is for e.g. rendering QML offscreen as image frames into a video.

      The test tst_RenderControl::renderAndReadBackWithRhi() in https://github.com/qt/qtdeclarative/blob/v6.0.0-beta5/tests/auto/quick/qquickrendercontrol/tst_qquickrendercontrol.cpp#L137 does exactly what I want. And the comment in that test is exactly what this bug is about - why do application developers have to do 4 separate native implementations to make this work?

      // What comes now is technically cheating - as long as QRhi is not a public
      // API this is not something applications can follow doing. However, it  
      // allows us to test out the pipeline without having to write 4 different
      // native (Vulkan, Metal, D3D11, OpenGL) implementations of all what's below.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              qt.team.graphics.and.multimedia Qt Graphics Team
              Reporter:
              rectalogic Andrew Wason
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes