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

Slow font rendering in Konsole on nvidia + related off-by-one error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: 4.6.0
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
      None

      Description

      When using KDE4's Konsole with a bitmap (.pcf) font with the nvidia proprietary driver, text rendering is very slow. The problem is the XRenderCompositeText32() call in QX11PaintEngine::drawFreetype(), which is very slow due to (guessing from http://www.nvnews.net/vbulletin/showthread.php?t=125111) the fact that bitmap fonts are 1bpp and the driver doesn't accelerate those. See the nvnews.net report and the KDE bugreports linked from it. One of the fonts that are affected is [Misc Fixed] as shipped with xorg.

      The attached patch works around the problem (the last chunk), but as I'm not a fonts expert, I'm not 100% sure about the possible regressions from completely disabling the xrender path for bitmap fonts. Specifically, I'm not sure if it doesn't affect antialiasing (I'd guess that bitmap fonts don't get antialiased anyway, but I don't know) or speed with other drivers.

      Also, regardless of whether you accept the workaround or not, the change also uncovered an off-by-one error on the non-xrender patch in path_for_glyphs() (the rest of the patch). Decrementing 'h' in the loop before executing the body results (with only some fonts, I don't know why) in the fron to be shifted one pixel down because of the 'yp - h' for the y coordinate for the QRect used. As for the rest of the changes (i.e. 'offs'), I'm again not sure what exactly is that for, but this way it is consistent with all other code paths (including XLFD).

        Attachments

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

          Activity

            People

            Assignee:
            sletta Gunnar Sletta
            Reporter:
            llunak Luboš Luňák
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes