Bug 980027: Part 2: Set compositor thread priority to platform-based value. r=benwa

This commit is contained in:
Ben Kelly 2014-03-17 11:52:42 -04:00
parent d5eb9aeb05
commit 411269dfa3

View File

@ -51,6 +51,8 @@
#endif
#include "GeckoProfiler.h"
#include "mozilla/ipc/ProtocolTypes.h"
#include "mozilla/Hal.h"
#include "mozilla/HalTypes.h"
using namespace base;
using namespace mozilla;
@ -109,6 +111,11 @@ static void ReleaseCompositorThread()
}
}
static void SetThreadPriority()
{
hal::SetCurrentThreadPriority(hal::THREAD_PRIORITY_COMPOSITOR);
}
void
CompositorParent::StartUpWithExistingThread(MessageLoop* aMsgLoop,
PlatformThreadId aThreadID)
@ -162,6 +169,7 @@ bool CompositorParent::CreateThread()
sCompositorThread = nullptr;
return false;
}
return true;
}
@ -200,6 +208,8 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
CompositorLoop()->PostTask(FROM_HERE, NewRunnableFunction(&AddCompositor,
this, &mCompositorID));
CompositorLoop()->PostTask(FROM_HERE, NewRunnableFunction(SetThreadPriority));
mRootLayerTreeID = AllocateLayerTreeId();
sIndirectLayerTrees[mRootLayerTreeID].mParent = this;