Commit bae9947d authored by David Anderson's avatar David Anderson
Browse files

Add IsHidden to CompositorWidget. (bug 1365879 part 10, r=rhunt)

parent f23fbf52
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -967,7 +967,7 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
  // this is important because resizing our buffers when mimised will fail and
  // cause a crash when we're restored.
  NS_ASSERTION(mHwnd, "Couldn't find an HWND when initialising?");
  if (::IsIconic(mHwnd)) {
  if (mWidget->IsHidden()) {
    // We are not going to render, and not going to call EndFrame so we have to
    // read-unlock our textures to prevent them from accumulating.
    ReadUnlockTextures();
+7 −0
Original line number Diff line number Diff line
@@ -257,6 +257,13 @@ public:
    return mOptions;
  }

  /**
   * Return true if the window is hidden and should not be composited.
   */
  virtual bool IsHidden() const {
    return false;
  }

  /**
   * This is only used by out-of-process compositors.
   */
+6 −0
Original line number Diff line number Diff line
@@ -327,5 +327,11 @@ WinCompositorWidget::FreeWindowSurface(HDC dc)
    ::ReleaseDC(mWnd, dc);
}

bool
WinCompositorWidget::IsHidden() const
{
  return ::IsIconic(mWnd);
}

} // namespace widget
} // namespace mozilla
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ public:
  CompositorWidgetDelegate* AsDelegate() override {
    return this;
  }
  bool IsHidden() const override;

  // CompositorWidgetDelegate overrides.
  void EnterPresentLock() override;