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

Support text rendering in non-GUI thread in Symbian

    XMLWordPrintable

Details

    • 0c62e02b80570bf8b92eff7acceb9018df61c89e

    Description

      It is not currently possible to render text in a secondary thread with Qt on Symbian. However, this is needed in many applications in order to make better user experience. Applications want to render in non-GUI thread to prepare the graphics while updating the UI on another thread. For example, a slide show applications want to prepare graphics for next page beforehand.

      The reason why this has not been supported in Qt is that the underlying Symbian APIs CFbsFont and CFbsBitmap are not thread-safe. However, it is possible to do text rendering in a worker thread in a native Symbian application so with changes in Qt implementation this should also be possible for Qt applications in Symbian.

      Generally a native Symbian application can achieve this by doing following in the second thread:
      1) Call RFbsSession::Connect() at the start and Disconnect() at the end of the thread lifetime.
      2) Create its own CFbsBitmap then call Duplicate() using the handle from the CFbsBitmap in the primary thread to access the shared bitmap data.
      3) Create its own CFbsFont by calling CFontStore::GetNearestFont(...) . This requires having their own CFbsTypefaceStore.

      However this cannot be achieved in Qt application as the current Qt API implementation on Symbian does not allow it. Qt's font database stores RWsSession handle in the thread local storage so step 1) is currently OK. But there is no separate instance of CFontStore in each thread currently.

      Changes in QFontDatabase and QFontEngine in the Symbian implementations are needed to achieve the required support.

      The Qt reference documentation on rendering on non-GUI thread should be also updated to indicate Symbian having issues on releases prior to release where this task is done:
      http://doc.trolltech.com/main-snapshot/qfontdatabase.html#supportsThreadedFontRendering
      http://doc.trolltech.com/main-snapshot/threads-modules.html#painting-in-threads

      Attachments

        1. main.cpp
          1 kB
          Mrudul Pendharkar

        Issue Links

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

          Activity

            People

              mrudulpen Mrudul Pendharkar
              auotila Aleksi Uotila
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes