mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1128690 - Ensure Talos Performance Tests still work with silk enabled. r=mstange
This commit is contained in:
parent
ce76729963
commit
a9182f7264
@ -403,6 +403,24 @@ MessageLoop* CompositorParent::CompositorLoop()
|
||||
return CompositorThread() ? CompositorThread()->message_loop() : nullptr;
|
||||
}
|
||||
|
||||
static bool
|
||||
IsInCompositorAsapMode()
|
||||
{
|
||||
// Returns true if the compositor is allowed to be in ASAP mode
|
||||
// and layout is not in ASAP mode
|
||||
return gfxPrefs::LayersCompositionFrameRate() == 0 &&
|
||||
!gfxPlatform::IsInLayoutAsapMode();
|
||||
}
|
||||
|
||||
static bool
|
||||
UseVsyncComposition()
|
||||
{
|
||||
return gfxPrefs::VsyncAlignedCompositor()
|
||||
&& gfxPrefs::HardwareVsyncEnabled()
|
||||
&& !IsInCompositorAsapMode()
|
||||
&& !gfxPlatform::IsInLayoutAsapMode();
|
||||
}
|
||||
|
||||
CompositorParent::CompositorParent(nsIWidget* aWidget,
|
||||
bool aUseExternalSurfaceSize,
|
||||
int aSurfaceWidth, int aSurfaceHeight)
|
||||
@ -445,7 +463,8 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
|
||||
mApzcTreeManager = new APZCTreeManager();
|
||||
}
|
||||
|
||||
if (gfxPrefs::VsyncAlignedCompositor() && gfxPrefs::HardwareVsyncEnabled()) {
|
||||
if (UseVsyncComposition()) {
|
||||
NS_WARNING("Enabling vsync compositor\n");
|
||||
mCompositorVsyncObserver = new CompositorVsyncObserver(this, aWidget);
|
||||
}
|
||||
|
||||
|
@ -2303,3 +2303,15 @@ gfxPlatform::CreateHardwareVsyncSource()
|
||||
nsRefPtr<mozilla::gfx::VsyncSource> softwareVsync = new SoftwareVsyncSource();
|
||||
return softwareVsync.forget();
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
gfxPlatform::IsInLayoutAsapMode()
|
||||
{
|
||||
// There are 2 modes of ASAP mode.
|
||||
// 1 is that the refresh driver and compositor are in lock step
|
||||
// the second is that the compositor goes ASAP and the refresh driver
|
||||
// goes at whatever the configurated rate is. This only checks the version
|
||||
// talos uses, which is the refresh driver and compositor are in lockstep.
|
||||
return Preferences::GetInt("layout.frame_rate", -1) == 0;
|
||||
}
|
||||
|
||||
|
@ -608,6 +608,13 @@ public:
|
||||
return mVsyncSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if layout rendering should use ASAP mode, which means
|
||||
* the refresh driver and compositor should render ASAP.
|
||||
* Used for talos testing purposes
|
||||
*/
|
||||
static bool IsInLayoutAsapMode();
|
||||
|
||||
protected:
|
||||
gfxPlatform();
|
||||
virtual ~gfxPlatform();
|
||||
|
@ -849,10 +849,14 @@ CreateVsyncRefreshTimer()
|
||||
// ready.
|
||||
gfxPrefs::GetSingleton();
|
||||
|
||||
if (!gfxPrefs::VsyncAlignedRefreshDriver() || !gfxPrefs::HardwareVsyncEnabled()) {
|
||||
if (!gfxPrefs::VsyncAlignedRefreshDriver()
|
||||
|| !gfxPrefs::HardwareVsyncEnabled()
|
||||
|| gfxPlatform::IsInLayoutAsapMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
NS_WARNING("Enabling vsync refresh driver\n");
|
||||
|
||||
if (XRE_IsParentProcess()) {
|
||||
// Make sure all vsync systems are ready.
|
||||
gfxPlatform::GetPlatform();
|
||||
|
Loading…
Reference in New Issue
Block a user