Bug 1064107 - Ensure that gfxPlatform is initialized by the time we create the compositor. r=Bas
authorNicolas Silva <nsilva@mozilla.com>
Fri, 10 Oct 2014 10:53:30 +0200
changeset 209844 5c6980f9caff1c87e94cce5e67d0ef28f7e7d49c
parent 209752 62347d33dbc37c19bd0caacf24c31d748ada6cdc
child 209845 48ef078126bff7d189691d3d3bea46e3f666747a
push id27628
push userkwierso@gmail.com
push dateSat, 11 Oct 2014 02:00:16 +0000
treeherdermozilla-central@f74ad36bb97b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1064107
milestone35.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 1064107 - Ensure that gfxPlatform is initialized by the time we create the compositor. r=Bas
widget/xpwidgets/nsBaseWidget.cpp
--- a/widget/xpwidgets/nsBaseWidget.cpp
+++ b/widget/xpwidgets/nsBaseWidget.cpp
@@ -864,16 +864,19 @@ nsBaseWidget::GetPreferredCompositorBack
     aHints.AppendElement(LayersBackend::LAYERS_OPENGL);
   }
 
   aHints.AppendElement(LayersBackend::LAYERS_BASIC);
 }
 
 void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
 {
+  // This makes sure that gfxPlatforms gets initialized if it hasn't by now.
+  gfxPlatform::GetPlatform();
+
   MOZ_ASSERT(gfxPlatform::UsesOffMainThreadCompositing(),
              "This function assumes OMTC");
 
   // Recreating this is tricky, as we may still have an old and we need
   // to make sure it's properly destroyed by calling DestroyCompositor!
 
   // If we've already received a shutdown notification, don't try
   // create a new compositor.