Bug 1469486 - Protect main thread in-process access to WinCompositorWidget transparent surface. r=lsalzman, a=pascalc FIREFOX_63b_RELBRANCH FENNEC_63_0b15_BUILD1 FENNEC_63_0b15_RELEASE
authorRyan Hunt <rhunt@eqrion.net>
Thu, 27 Sep 2018 15:57:56 -0500
branchFIREFOX_63b_RELBRANCH
changeset 490293 6641ad209d525686077ef92932d171021e8d99a4
parent 490292 e19d6a029c18b1b36bc66522cfac6590ff844d62
child 496964 db3a5881e0d22fa59c2107d49c0fefa675fe6bd3
push id9982
push userryanvm@gmail.com
push dateMon, 15 Oct 2018 15:29:21 +0000
treeherdermozilla-beta@6641ad209d52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman, pascalc
bugs1469486
milestone63.0
Bug 1469486 - Protect main thread in-process access to WinCompositorWidget transparent surface. r=lsalzman, a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D7178
widget/windows/InProcessWinCompositorWidget.cpp
widget/windows/InProcessWinCompositorWidget.h
--- a/widget/windows/InProcessWinCompositorWidget.cpp
+++ b/widget/windows/InProcessWinCompositorWidget.cpp
@@ -32,16 +32,41 @@ InProcessWinCompositorWidget::InProcessW
                                                            const layers::CompositorOptions& aOptions,
                                                            nsWindow* aWindow)
  : WinCompositorWidget(aInitData, aOptions),
    mWindow(aWindow)
 {
   MOZ_ASSERT(mWindow);
 }
 
+void
+InProcessWinCompositorWidget::OnDestroyWindow()
+{
+  EnterPresentLock();
+  WinCompositorWidget::OnDestroyWindow();
+  LeavePresentLock();
+}
+
+void
+InProcessWinCompositorWidget::UpdateTransparency(nsTransparencyMode aMode)
+{
+  EnterPresentLock();
+  WinCompositorWidget::UpdateTransparency(aMode);
+  LeavePresentLock();
+}
+
+void
+InProcessWinCompositorWidget::ClearTransparentWindow()
+{
+  EnterPresentLock();
+  WinCompositorWidget::ClearTransparentWindow();
+  LeavePresentLock();
+}
+
+
 nsIWidget*
 InProcessWinCompositorWidget::RealWidget()
 {
   return mWindow;
 }
 
 void
 InProcessWinCompositorWidget::ObserveVsync(VsyncObserver* aObserver)
--- a/widget/windows/InProcessWinCompositorWidget.h
+++ b/widget/windows/InProcessWinCompositorWidget.h
@@ -19,16 +19,20 @@ namespace widget {
 // with the compositor.
 class InProcessWinCompositorWidget final : public WinCompositorWidget
 {
 public:
   InProcessWinCompositorWidget(const WinCompositorWidgetInitData& aInitData,
                                const layers::CompositorOptions& aOptions,
                                nsWindow* aWindow);
 
+  void OnDestroyWindow() override;
+  void UpdateTransparency(nsTransparencyMode aMode) override;
+  void ClearTransparentWindow() override;
+
   void ObserveVsync(VsyncObserver* aObserver) override;
   nsIWidget* RealWidget() override;
 
 private:
   nsWindow* mWindow;
 };
 
 } // namespace widget