Add IsHidden to CompositorWidget. (bug 1365879 part 10, r=rhunt)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -327,5 +327,11 @@ WinCompositorWidget::FreeWindowSurface(HDC dc)
|
||||
::ReleaseDC(mWnd, dc);
|
||||
}
|
||||
|
||||
bool
|
||||
WinCompositorWidget::IsHidden() const
|
||||
{
|
||||
return ::IsIconic(mWnd);
|
||||
}
|
||||
|
||||
} // namespace widget
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
CompositorWidgetDelegate* AsDelegate() override {
|
||||
return this;
|
||||
}
|
||||
bool IsHidden() const override;
|
||||
|
||||
// CompositorWidgetDelegate overrides.
|
||||
void EnterPresentLock() override;
|
||||
|
||||
Reference in New Issue
Block a user