mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1820066 [2/3] - Allow in-process use of the compositor window r=sotaro
The in-process compositor assumes that no compositor window was present. This is not guaranteed to be true if, for example, the preference `gfx.webrender.flip-sequential` is set. Make the in-process compositor more closely mirror the out-of-process compositor. (At present this effectively just means calling ::SetParent on the compositor window.) Differential Revision: https://phabricator.services.mozilla.com/D172733
This commit is contained in:
parent
0fe41b776a
commit
cfe1fff87e
@ -259,6 +259,9 @@ void CompositorBridgeParent::InitSameProcess(widget::CompositorWidget* aWidget,
|
||||
|
||||
mWidget = aWidget;
|
||||
mRootLayerTreeID = aLayerTreeId;
|
||||
#if defined(XP_WIN)
|
||||
mWidget->AsWindows()->SetRootLayerTreeID(mRootLayerTreeID);
|
||||
#endif
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
@ -360,4 +360,15 @@ void InProcessWinCompositorWidget::ObserveVsync(VsyncObserver* aObserver) {
|
||||
}
|
||||
}
|
||||
|
||||
void InProcessWinCompositorWidget::UpdateCompositorWnd(
|
||||
const HWND aCompositorWnd, const HWND aParentWnd) {
|
||||
MOZ_ASSERT(layers::CompositorThreadHolder::IsInCompositorThread());
|
||||
MOZ_ASSERT(aCompositorWnd && aParentWnd);
|
||||
MOZ_ASSERT(aParentWnd == mWnd);
|
||||
|
||||
// Since we're in the parent process anyway, we can just call SetParent
|
||||
// directly.
|
||||
::SetParent(aCompositorWnd, aParentWnd);
|
||||
mSetParentCompleted = true;
|
||||
}
|
||||
} // namespace mozilla::widget
|
||||
|
@ -71,7 +71,7 @@ class InProcessWinCompositorWidget final
|
||||
nsIWidget* RealWidget() override;
|
||||
|
||||
void UpdateCompositorWnd(const HWND aCompositorWnd,
|
||||
const HWND aParentWnd) override {}
|
||||
const HWND aParentWnd) override;
|
||||
void SetRootLayerTreeID(const layers::LayersId& aRootLayerTreeId) override {}
|
||||
|
||||
private:
|
||||
|
@ -70,10 +70,10 @@ void WinCompositorWidget::UpdateCompositorWndSizeIfNecessary() {
|
||||
return;
|
||||
}
|
||||
|
||||
// This code is racing with the compositor, which needs to reparent
|
||||
// the compositor surface to the actual window (mWnd). To avoid racing
|
||||
// mutations, we refuse to proceed until ::SetParent() is called in parent
|
||||
// process. After the ::SetParent() call, composition is scheduled in
|
||||
// This code is racing with the compositor, which needs to reparent the
|
||||
// compositor surface to the actual window (mWnd). To avoid racing mutations,
|
||||
// we refuse to proceed until ::SetParent() is called in the parent process.
|
||||
// After the ::SetParent() call, composition is scheduled in
|
||||
// CompositorWidgetParent::UpdateCompositorWnd().
|
||||
if (!mSetParentCompleted) {
|
||||
// ::SetParent() is not completed yet.
|
||||
|
Loading…
Reference in New Issue
Block a user