gdi32: Don't bother computing the gamma ramp when not used.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-05-03 09:48:00 +02:00
parent ea50d41b3f
commit f2068ec438
1 changed files with 6 additions and 3 deletions

View File

@ -4009,10 +4009,13 @@ static void init_font_options(void)
This looks roughly similar to Windows Native with the same registry value.
MS GDI seems to be rasterizing the outline at a different rate than FreeType. */
gamma = 1000 * gamma / 1400;
for (i = 0; i < 256; i++)
if (gamma != 1000)
{
font_gamma_ramp.encode[i] = pow( i / 255., 1000. / gamma ) * 255. + .5;
font_gamma_ramp.decode[i] = pow( i / 255., gamma / 1000. ) * 255. + .5;
for (i = 0; i < 256; i++)
{
font_gamma_ramp.encode[i] = pow( i / 255., 1000. / gamma ) * 255. + .5;
font_gamma_ramp.decode[i] = pow( i / 255., gamma / 1000. ) * 255. + .5;
}
}
font_gamma_ramp.gamma = gamma;
TRACE("gamma %d\n", font_gamma_ramp.gamma);