зеркало из https://github.com/mozilla/gecko-dev.git
Bug 717958 - Always read FPS pref on the main thread with OMTC. r=ajuma
This commit is contained in:
Родитель
333feabd4b
Коммит
c4e3f022c6
|
@ -367,7 +367,20 @@ LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext, bool force)
|
|||
console->LogStringMessage(msg.get());
|
||||
}
|
||||
|
||||
Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps");
|
||||
if (NS_IsMainThread()) {
|
||||
Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps");
|
||||
} else {
|
||||
// We have to dispatch an event to the main thread to read the pref.
|
||||
class ReadDrawFPSPref : public nsRunnable {
|
||||
public:
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps");
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
NS_DispatchToMainThread(new ReadDrawFPSPref());
|
||||
}
|
||||
|
||||
reporter.SetSuccessful();
|
||||
return true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче