Bug 1413178 - Initialize the new field that was added in webrender commit 479d43ab4f245c42b33e12f9b6f050045ec84ab3. r=lsalzman
authorMarkus Stange <mstange@themasta.com>
Fri, 03 Nov 2017 00:37:20 -0400
changeset 443364 e0f98b3490f680fe0561ec3074d9188b18c84cea
parent 443363 033d34b29a645463b3d3993f1c9841eb3a7501e1
child 443365 f7af48305978405e52c1b61920b3a51746249579
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1413178
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1413178 - Initialize the new field that was added in webrender commit 479d43ab4f245c42b33e12f9b6f050045ec84ab3. r=lsalzman MozReview-Commit-ID: 3oFtSjbnBsI
gfx/2d/ScaledFontDWrite.cpp
gfx/2d/ScaledFontFontconfig.cpp
gfx/webrender_bindings/WebRenderTypes.h
--- a/gfx/2d/ScaledFontDWrite.cpp
+++ b/gfx/2d/ScaledFontDWrite.cpp
@@ -309,16 +309,17 @@ ScaledFontDWrite::GetWRFontInstanceOptio
 {
   AntialiasMode aaMode = GetDefaultAAMode();
   if (aaMode != AntialiasMode::SUBPIXEL) {
     wr::FontInstanceOptions options;
     options.render_mode =
       aaMode == AntialiasMode::NONE ? wr::FontRenderMode::Mono : wr::FontRenderMode::Alpha;
     options.subpx_dir = wr::SubpixelDirection::Horizontal;
     options.synthetic_italics = false;
+    options.bg_color = wr::ToColorU(Color());
     *aOutOptions = Some(options);
   }
 
   wr::FontInstancePlatformOptions platformOptions;
   platformOptions.use_embedded_bitmap = UseEmbeddedBitmaps();
   platformOptions.force_gdi_rendering = ForceGDIMode();
   *aOutPlatformOptions = Some(platformOptions);
   return true;
--- a/gfx/2d/ScaledFontFontconfig.cpp
+++ b/gfx/2d/ScaledFontFontconfig.cpp
@@ -248,16 +248,17 @@ bool
 ScaledFontFontconfig::GetWRFontInstanceOptions(Maybe<wr::FontInstanceOptions>* aOutOptions,
                                                Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
                                                std::vector<FontVariation>* aOutVariations)
 {
   wr::FontInstanceOptions options;
   options.render_mode = wr::FontRenderMode::Alpha;
   options.subpx_dir = wr::SubpixelDirection::Horizontal;
   options.synthetic_italics = false;
+  options.bg_color = wr::ToColorU(Color());
 
   wr::FontInstancePlatformOptions platformOptions;
   platformOptions.flags = 0;
   platformOptions.lcd_filter = wr::FontLCDFilter::Legacy;
   platformOptions.hinting = wr::FontHinting::Normal;
 
   FcBool autohint;
   if (FcPatternGetBool(mPattern, FC_AUTOHINT, 0, &autohint) == FcResultMatch && autohint) {
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -254,16 +254,26 @@ static inline wr::ColorF ToColorF(const 
   wr::ColorF c;
   c.r = color.r;
   c.g = color.g;
   c.b = color.b;
   c.a = color.a;
   return c;
 }
 
+static inline wr::ColorU ToColorU(const gfx::Color& color)
+{
+  wr::ColorU c;
+  c.r = uint8_t(color.r * 255.0f);
+  c.g = uint8_t(color.g * 255.0f);
+  c.b = uint8_t(color.b * 255.0f);
+  c.a = uint8_t(color.a * 255.0f);
+  return c;
+}
+
 static inline wr::LayoutPoint ToLayoutPoint(const mozilla::LayoutDevicePoint& point)
 {
   wr::LayoutPoint p;
   p.x = point.x;
   p.y = point.y;
   return p;
 }