From 778675de842b388271acb3ed22ee6600b0099087 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 18 Jul 2018 22:16:50 -0400 Subject: [PATCH] Bug 1474968 - pass DWrite font gamma and contrast to WebRender. r=jrmuizel --- gfx/2d/ScaledFontDWrite.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/2d/ScaledFontDWrite.cpp b/gfx/2d/ScaledFontDWrite.cpp index 1e485b198b2a..335045b1e437 100644 --- a/gfx/2d/ScaledFontDWrite.cpp +++ b/gfx/2d/ScaledFontDWrite.cpp @@ -475,7 +475,13 @@ ScaledFontDWrite::GetWRFontInstanceOptions(Maybe* aOutO } options.bg_color = wr::ToColorU(Color()); options.synthetic_italics = wr::DegreesToSyntheticItalics(GetSyntheticObliqueAngle()); + + wr::FontInstancePlatformOptions platformOptions; + platformOptions.gamma = uint16_t(std::round(mGamma * 100.0f)); + platformOptions.contrast = uint16_t(std::round(std::min(mContrast, 1.0f) * 100.0f)); + *aOutOptions = Some(options); + *aOutPlatformOptions = Some(platformOptions); return true; }