Bug 1191040 - Ensure that we only compute the tile size once. r=BenWa

This commit is contained in:
Matt Woodrow 2015-08-07 15:37:56 -04:00
parent 11e59e0bf7
commit 23350b9b55
4 changed files with 12 additions and 12 deletions

View File

@ -682,8 +682,6 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
mCompositorScheduler = new CompositorSoftwareTimerScheduler(this);
}
gfxPlatform::GetPlatform()->ComputeTileSize();
LayerScope::SetPixelScale(mWidget->GetDefaultScale().scale);
}
@ -1735,7 +1733,6 @@ public:
, mNotifyAfterRemotePaint(false)
{
MOZ_ASSERT(NS_IsMainThread());
gfxPlatform::GetPlatform()->ComputeTileSize();
}
// IToplevelProtocol::CloneToplevel()

View File

@ -11,8 +11,6 @@ namespace mozilla {
namespace layers {
TEST(TiledLayerBuffer, TileStart) {
gfxPlatform::GetPlatform()->ComputeTileSize();
ASSERT_EQ(RoundDownToTileEdge(10, 256), 0);
ASSERT_EQ(RoundDownToTileEdge(-10, 256), -256);
}

View File

@ -504,6 +504,8 @@ gfxPlatform::Init()
InitLayersAccelerationPrefs();
InitLayersIPC();
gPlatform->ComputeTileSize();
nsresult rv;
bool usePlatformFontList = true;
@ -1002,7 +1004,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()) {
NS_RUNTIMEABORT("wrong process.");
return;
}
int32_t w = gfxPrefs::LayersTileWidth();
@ -1026,6 +1028,7 @@ gfxPlatform::ComputeTileSize()
#endif
}
#ifdef XP_MACOSX
// Use double sized tiles for HiDPI screens.
nsCOMPtr<nsIScreenManager> screenManager =
do_GetService("@mozilla.org/gfx/screenmanager;1");
@ -1041,6 +1044,7 @@ gfxPlatform::ComputeTileSize()
h *= 2;
}
}
#endif
SetTileSize(w, h);
}

View File

@ -307,12 +307,6 @@ 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
@ -760,6 +754,13 @@ 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<gfxASurface> mScreenReferenceSurface;
nsTArray<uint32_t> mCJKPrefLangs;
nsCOMPtr<nsIObserver> mSRGBOverrideObserver;