Menu

#422 Qt: blending optimizations

developer_version
closed-out-of-date
nobody
None
4
2015-02-25
2007-09-07
Kees Blom
No

The new qt_image_blend(...) function and its usage in qt_smiltext.cpp can be optimized in the following ways:

1. qt_image_blend(...) now uses setPixel(x,y,pixel) for
each pixel. Using the scanLine(int) that code can be
made more efficient.
2. In the render_smiltext(...), when blending is needed,
qt_image_blend(...) is used twice with 2 different
QImage's, on the screen QPixmap converted to a QImage.
This works, but it can be done smarter:
a. Use ONE QPixmap for drawing the textBackground and
text, as required.
b. convert that QPixmap to a QImage
c. create a new empty QPixmap and use the copyBlt(...)
function to het only the portion of the current
on-screen QPixmap, that is needed for blending.
Convert this portion to a QImage.
d. Blend these 2 QImages first with textBackgroudColor
then with textColor,
e. convert the resulting QImage back to QPixmap
bitBlt(...) the resulting QPixmap to the on-sreen
QPixmap.
This strategy should result in less communication with
the X-server, with smaller messages. The same strategy
is also applicable to Windows XP, but there is less profit, because there is no X-server involved. It is NOT
appplicable to the gtk implementation.

Discussion

  • Kees Blom

    Kees Blom - 2015-02-25

    qt is not supported anymore.

     
  • Kees Blom

    Kees Blom - 2015-02-25
    • status: open --> closed-out-of-date
    • Group: --> developer_version
     

Log in to post a comment.

MongoDB Logo MongoDB