Bug 859517: Move LayerManagerOGL::Initialize's helper-nsRunnable from function-scope to class-scope to fix build warning about ignored visibility attribute. r=BenWa

This commit is contained in:
Daniel Holbert 2013-04-08 15:06:28 -07:00
parent 471ef56d35
commit a0a4661570
2 changed files with 17 additions and 9 deletions

View File

@ -486,6 +486,16 @@ LayerManagerOGL::AddPrograms(ShaderProgramType aType)
}
}
// Impl of a a helper-runnable's "Run" method, used in Initialize()
NS_IMETHODIMP
LayerManagerOGL::ReadDrawFPSPref::Run()
{
// NOTE: This must match the code in Initialize()'s NS_IsMainThread check.
Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps");
Preferences::AddBoolVarCache(&sFrameCounter, "layers.acceleration.frame-counter");
return NS_OK;
}
bool
LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext, bool force)
{
@ -667,19 +677,11 @@ LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext, bool force)
}
if (NS_IsMainThread()) {
// NOTE: This must match the code in ReadDrawFPSPref::Run().
Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps");
Preferences::AddBoolVarCache(&sFrameCounter, "layers.acceleration.frame-counter");
} 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");
Preferences::AddBoolVarCache(&sFrameCounter, "layers.acceleration.frame-counter");
return NS_OK;
}
};
NS_DispatchToMainThread(new ReadDrawFPSPref());
}

View File

@ -371,6 +371,12 @@ private:
*/
bool mIsRenderingToEGLSurface;
/** Helper-class used by Initialize **/
class ReadDrawFPSPref MOZ_FINAL : public nsRunnable {
public:
NS_IMETHOD Run() MOZ_OVERRIDE;
};
/** Current root layer. */
LayerOGL *RootLayer() const;