From 41b12d46e37b0dd032008915205bf5e71dc81256 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Fri, 7 Aug 2015 16:24:59 -0400 Subject: [PATCH] Backed out changeset 4e63305fe592 (bug 1191040) for Linux gtest crashes. CLOSED TREE --- gfx/layers/ipc/CompositorParent.cpp | 3 +++ gfx/tests/gtest/TestTiledLayerBuffer.cpp | 2 ++ gfx/thebes/gfxPlatform.cpp | 4 +--- gfx/thebes/gfxPlatform.h | 13 ++++++------- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index 08d4fde3b62..e67091b0382 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -682,6 +682,8 @@ CompositorParent::CompositorParent(nsIWidget* aWidget, mCompositorScheduler = new CompositorSoftwareTimerScheduler(this); } + gfxPlatform::GetPlatform()->ComputeTileSize(); + LayerScope::SetPixelScale(mWidget->GetDefaultScale().scale); } @@ -1733,6 +1735,7 @@ public: , mNotifyAfterRemotePaint(false) { MOZ_ASSERT(NS_IsMainThread()); + gfxPlatform::GetPlatform()->ComputeTileSize(); } // IToplevelProtocol::CloneToplevel() diff --git a/gfx/tests/gtest/TestTiledLayerBuffer.cpp b/gfx/tests/gtest/TestTiledLayerBuffer.cpp index c5e9b0f41d3..03b18ea71be 100644 --- a/gfx/tests/gtest/TestTiledLayerBuffer.cpp +++ b/gfx/tests/gtest/TestTiledLayerBuffer.cpp @@ -11,6 +11,8 @@ namespace mozilla { namespace layers { TEST(TiledLayerBuffer, TileStart) { + gfxPlatform::GetPlatform()->ComputeTileSize(); + ASSERT_EQ(RoundDownToTileEdge(10, 256), 0); ASSERT_EQ(RoundDownToTileEdge(-10, 256), -256); } diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index c0c5adfe483..f746df0d83a 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -504,8 +504,6 @@ gfxPlatform::Init() InitLayersAccelerationPrefs(); InitLayersIPC(); - gPlatform->ComputeTileSize(); - nsresult rv; bool usePlatformFontList = true; @@ -1004,7 +1002,7 @@ 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(); diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 02fe6082c2c..7f835a516a5 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -307,6 +307,12 @@ public: 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 @@ -754,13 +760,6 @@ private: 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 mScreenReferenceSurface; nsTArray mCJKPrefLangs; nsCOMPtr mSRGBOverrideObserver;