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

Byeongsik Jeon bsjeon at hanmail.net
Thu Apr 21 13:49:17 CDT 2022


---
v2: [PATCH 5/5] ~0u -> 0xffffff

"if (glyph_ptr[x] == ~0u) { dst_ptr[x] = text_pixel; continue; }"
I realized that this line is not working. I'm sorry that didn't review it
more carefully.

I got 10% additional performance improvement, so re-tested the entire test.

---
After commit 649dd12, I propose some improvements related to the dibdrv
FontSmoothingGamma code. Using pre-computed value and Removing branches
in the inline function can provide some performance improvements.

CrystalMark2004R7 GDI Text Bench result(5times average) [1][2]:

    - OLD         : 6673 (100%) pre 649dd12
    - CURRENT     : 5584 ( 84%) with gamma == 1000
    - CURRENT     : 4989 ( 75%) with gamma != 1000
    - PATCH v2 1/5: 5125 ( 77%)
    - PATCH v2 2/5: 5528 ( 83%)
    - PATCH v2 5/5: 6772 (101%)

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!
With the dibdrv glyph cache ON, the performance factors in the pre-caching
phase are hidden. This indicates that dibdrv::draw_glyph() performance is
the dominant factor of the CrystalMark result value.

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 calculation depending
on the fontsmoothing type.  And current Wine does not synchronize the xrdb
resource values and the SystemParametersInfo() results.

Therefore, required some attention 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 ++----
 dlls/win32u/freetype.c          |  4 +-
 3 files changed, 43 insertions(+), 48 deletions(-)

-- 
2.36.0




More information about the wine-devel mailing list