Commit c4e3f022 authored by Benoit Girard's avatar Benoit Girard
Browse files

Bug 717958 - Always read FPS pref on the main thread with OMTC. r=ajuma

parent 333feabd
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -367,7 +367,20 @@ LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext, bool force)
    console->LogStringMessage(msg.get());
  }

  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;