Backed out changeset 4e63305fe592 (bug 1191040) for Linux gtest crashes.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 07 Aug 2015 16:24:59 -0400
changeset 288534 e102197e30343e1ac789eca738ee44cb14cad861
parent 288533 2c5a611f298646326c73bdca44336fce92a59af0
child 288535 6a35a662414682d09bde784faeb5703efbdcdbf3
child 288544 2fa6cc610bd43cca35e867e42b7e188f2dbb6ab6
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1191040
milestone42.0a1
backs out4e63305fe592b0131892eb432cc7332e850ca752
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
Backed out changeset 4e63305fe592 (bug 1191040) for Linux gtest crashes. CLOSED TREE
gfx/layers/ipc/CompositorParent.cpp
gfx/tests/gtest/TestTiledLayerBuffer.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -677,16 +677,18 @@ CompositorParent::CompositorParent(nsIWi
 
   if (UseVsyncComposition()) {
     gfxDebugOnce() << "Enabling vsync compositor";
     mCompositorScheduler = new CompositorVsyncScheduler(this, aWidget);
   } else {
     mCompositorScheduler = new CompositorSoftwareTimerScheduler(this);
   }
 
+  gfxPlatform::GetPlatform()->ComputeTileSize();
+
   LayerScope::SetPixelScale(mWidget->GetDefaultScale().scale);
 }
 
 bool
 CompositorParent::IsInCompositorThread()
 {
   return CompositorThread() && CompositorThread()->thread_id() == PlatformThread::CurrentId();
 }
@@ -1728,16 +1730,17 @@ class CrossProcessCompositorParent final
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CrossProcessCompositorParent)
 public:
   explicit CrossProcessCompositorParent(Transport* aTransport)
     : mTransport(aTransport)
     , mCompositorThreadHolder(sCompositorThreadHolder)
     , mNotifyAfterRemotePaint(false)
   {
     MOZ_ASSERT(NS_IsMainThread());
+    gfxPlatform::GetPlatform()->ComputeTileSize();
   }
 
   // IToplevelProtocol::CloneToplevel()
   virtual IToplevelProtocol*
   CloneToplevel(const InfallibleTArray<mozilla::ipc::ProtocolFdMapping>& aFds,
                 base::ProcessHandle aPeerProcess,
                 mozilla::ipc::ProtocolCloneContext* aCtx) override;
 
--- a/gfx/tests/gtest/TestTiledLayerBuffer.cpp
+++ b/gfx/tests/gtest/TestTiledLayerBuffer.cpp
@@ -6,16 +6,18 @@
 #include "TiledLayerBuffer.h"
 
 #include "gtest/gtest.h"
 
 namespace mozilla {
 namespace layers {
 
 TEST(TiledLayerBuffer, TileStart) {
+  gfxPlatform::GetPlatform()->ComputeTileSize();
+
   ASSERT_EQ(RoundDownToTileEdge(10, 256), 0);
   ASSERT_EQ(RoundDownToTileEdge(-10, 256), -256);
 }
 
 TEST(TiledLayerBuffer, TilesPlacement) {
   for (int firstY = -10; firstY < 10; ++firstY) {
     for (int firstX = -10; firstX < 10; ++firstX) {
       for (int height = 1; height < 10; ++height) {
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -499,18 +499,16 @@ gfxPlatform::Init()
 
 #ifdef MOZ_GL_DEBUG
     GLContext::StaticInit();
 #endif
 
     InitLayersAccelerationPrefs();
     InitLayersIPC();
 
-    gPlatform->ComputeTileSize();
-
     nsresult rv;
 
     bool usePlatformFontList = true;
 #if defined(MOZ_WIDGET_GTK)
     usePlatformFontList = gfxPlatformGtk::UseFcFontList();
 #elif defined(MOZ_WIDGET_QT)
     usePlatformFontList = false;
 #endif
@@ -999,17 +997,17 @@ gfxPlatform::SetTileSize(int aWidth, int
 }
 
 void
 gfxPlatform::ComputeTileSize()
 {
   // The tile size should be picked in the parent processes
   // and sent to the child processes over IPDL GetTileSize.
   if (!XRE_IsParentProcess()) {
-    return;
+    NS_RUNTIMEABORT("wrong process.");
   }
 
   int32_t w = gfxPrefs::LayersTileWidth();
   int32_t h = gfxPrefs::LayersTileHeight();
 
   // TODO We may want to take the screen size into consideration here.
   if (gfxPrefs::LayersTilesAdjust()) {
 #ifdef MOZ_WIDGET_GONK
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -302,16 +302,22 @@ public:
      */
     virtual nsresult GetFontList(nsIAtom *aLangGroup,
                                  const nsACString& aGenericFamily,
                                  nsTArray<nsString>& aListOfFonts);
 
     int GetTileWidth();
     int GetTileHeight();
     void SetTileSize(int aWidth, int aHeight);
+    /**
+     * Calling this function will compute and set the ideal tile size for the
+     * platform. This should only be called in the parent process; child processes
+     * should be updated via SetTileSize to match the value computed in the parent.
+     */
+    void ComputeTileSize();
 
     /**
      * Rebuilds the any cached system font lists
      */
     virtual nsresult UpdateFontList();
 
     /**
      * Create the platform font-list object (gfxPlatformFontList concrete subclass).
@@ -749,23 +755,16 @@ private:
     static void CreateCMSOutputProfile();
 
     static void GetCMSOutputProfileData(void *&mem, size_t &size);
 
     friend void RecordingPrefChanged(const char *aPrefName, void *aClosure);
 
     virtual void GetPlatformCMSOutputProfile(void *&mem, size_t &size);
 
-    /**
-     * Calling this function will compute and set the ideal tile size for the
-     * platform. This will only have an effect in the parent process; child processes
-     * should be updated via SetTileSize to match the value computed in the parent.
-     */
-    void ComputeTileSize();
-
     nsRefPtr<gfxASurface> mScreenReferenceSurface;
     nsTArray<uint32_t> mCJKPrefLangs;
     nsCOMPtr<nsIObserver> mSRGBOverrideObserver;
     nsCOMPtr<nsIObserver> mFontPrefsObserver;
     nsCOMPtr<nsIObserver> mMemoryPressureObserver;
 
     // The preferred draw target backend to use for canvas
     mozilla::gfx::BackendType mPreferredCanvasBackend;