[PATCH 0/5] win32u: Improve dibdrv FontSmoothingGamma related code.

Byeongsik Jeon bsjeon at hanmail.net
Wed Apr 20 11:40:02 CDT 2022


After commit 649dd12, I propose some improvements related to the dibdrv
FontSmoothingGamma code. Removing duplicate calculation codes and
branches in the inline function can provide some performance improvements.

CrystalMark2004R7 GDI Text Bench result [1][2]:

    - OLD      : 6590 (100%) pre 649dd12
    - CURRENT  : 5567 ( 84%) with gamma == 1000
    - CURRENT  : 4927 ( 73%) with gamma != 1000
    - PATCH 1/5: 5113 ( 77%)
    - PATCH 2/5: 5494 ( 83%)
    - PATCH 5/5: 6007 ( 91%)

Please, Note that OLD and CURRENT(gamma == 1000) doesn't have
FontSmoothingGamma ability.

These improvements allow to change the gamma default value to 1400(MS
GDI32 default value), while reducing performance losses.

[1]
If the dibdrv glyph caching code is turned off, the  CrystalMark result
value is reduced by 10 times! This indicates that dibdrv::draw_glyph()
performance is the dominant factor of the CrystalMark result value with
the glyph caching turn on.

The result does not represent GDI32 text engine performance in all situations,
but it can be referred to in the current situation.

[2]
CrystalMark apply different weights to the result value with the fortsmooth
mode. Currently, Wine does not synchronize the xrdb values and
the SystemParametersInfo() results.

Therefore, some attention is required in the configuration of the test
environment and the result analysis. I tested it under the conditions below:
    $ xrdb -remove
    $ winetricks fontsmooth=rgb

Byeong-Sik Jeon (5):
  win32u: Remove gamma == 1000 special case code.
  win32u: Use pre-calculated decoded_text value.
  win32u: Remove the gamma value calibration code.
  win32u: Set the default gamma value to 1400.
  win32u: Remove the branches in blend_color_gamma().

 dlls/win32u/dibdrv/primitives.c | 74 +++++++++++++++++----------------
 dlls/win32u/font.c              | 13 ++----
 2 files changed, 41 insertions(+), 46 deletions(-)

-- 
2.36.0




More information about the wine-devel mailing list