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. Why QRasterPaintEngine is called in an QOpenGLWidget?
Qt 6.11 is out! See what's new in the release blog

Why QRasterPaintEngine is called in an QOpenGLWidget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 327 Views
  • 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.
  • I Offline
    I Offline
    ivz hh
    wrote on last edited by
    #1

    Hi all,

    Thank you for reading this post! Recently I am working on an old code base. The app runs on X11 with a remote server. The function is to render a series of images repeatedly (1..N-1..N..1..). The class is very efficient to render a series of images on X11 + Mesa3D/LLVMPipe (20fps).

    Later, I added a new QOpenGLWidget with similar functionality. But the maximum fps is only 60% of the original. In the beginning, I thought it is because images in the new widget has higher resolution. But after launching a perf on Linux, I found out that 20% of the time is spent on qt_memfill32. Another 10% is spent on memcpy.

    In comparison, the original code will barely trigger qt_memfill32 and memcpy. I am confused about what's the mechanism behind this. I read the official article Qt Graphics and Performance - An Overview. The old QOpenGLWidget doesn't apply any of the flags to directly render to screen.

    Hope anyone can help me!

    Thanks!

    P.S. the stack for the new QOpenGLWidget:

    #0  in qt_memfill32(unsigned int*, unsigned int, int)
    #1  qt_rectfill_argb32(QRasterBuffer*, int, int, int, int, QRgba64 const&)
    #2  fillRect_normalized(QRect const&, QSpanData*, QRasterPaintEnginePrivate*)
    #3  QRasterPaintEngine::fillRect(QRectF const&, QSpanData*)
    #4  QPainter::fillRect(QRect const&, QBrush const&)
    #5  QWidgetPrivate::paintBackground(QPainter*, QRegion const&, int) const ()
    #6  QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
    #7  QWidgetBackingStore::doSync() ()
    #8  QWidgetBackingStore::sync() ()
    #9  QWidgetPrivate::syncBackingStore() ()
    #10 QWidget::event(QEvent*) ()
    #11 QMainWindow::event(QEvent*) ()
    
    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