Bug 1315706 - Pass a wrapper struct to various CompositorWidget functions. r=dvander
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 07 Nov 2016 21:16:52 -0500
changeset 366616 dd859148673c2ac94c827e2da05e7f89120c633d
parent 366615 87b6987646642d3d998df229e423b466271ccd4d
child 366617 11d72a9e3365c9b32e79d8a251c4fc571e29850c
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1315706
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1315706 - Pass a wrapper struct to various CompositorWidget functions. r=dvander This is the first step in using these functions without having a LayerManagerComposite at all. MozReview-Commit-ID: 2zkuB7Ox4Ut
gfx/layers/composite/LayerManagerComposite.cpp
widget/CompositorWidget.h
widget/InProcessCompositorWidget.cpp
widget/InProcessCompositorWidget.h
widget/android/nsWindow.cpp
widget/android/nsWindow.h
widget/cocoa/nsChildView.h
widget/cocoa/nsChildView.mm
widget/nsBaseWidget.h
widget/windows/WinCompositorWidget.cpp
widget/windows/WinCompositorWidget.h
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -37,16 +37,17 @@
 #include "mozilla/gfx/Point.h"          // for IntSize, Point
 #include "mozilla/gfx/Rect.h"           // for Rect
 #include "mozilla/gfx/Types.h"          // for Color, SurfaceFormat
 #include "mozilla/layers/Compositor.h"  // for Compositor
 #include "mozilla/layers/CompositorTypes.h"
 #include "mozilla/layers/Effects.h"     // for Effect, EffectChain, etc
 #include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper
 #include "mozilla/layers/LayersTypes.h"  // for etc
+#include "mozilla/widget/CompositorWidget.h" // for WidgetRenderingContext
 #include "ipc/CompositorBench.h"        // for CompositorBench
 #include "ipc/ShadowLayerUtils.h"
 #include "mozilla/mozalloc.h"           // for operator new, etc
 #include "nsAppRunner.h"
 #include "mozilla/RefPtr.h"                   // for nsRefPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsDebug.h"                    // for NS_WARNING, NS_RUNTIMEABORT, etc
 #include "nsISupportsImpl.h"            // for Layer::AddRef, etc
@@ -906,21 +907,28 @@ LayerManagerComposite::Render(const nsIn
     }
     mCompositor->EndFrameForExternalComposition(Matrix());
     mLastFrameMissedHWC = false;
     return;
   } else if (!mTarget && !haveLayerEffects) {
     mLastFrameMissedHWC = !!composer2D;
   }
 
+  mozilla::widget::WidgetRenderingContext widgetContext;
+#if defined(XP_MACOSX)
+  widgetContext.mLayerManager = this;
+#elif defined(MOZ_WIDGET_ANDROID)
+  widgetContext.mCompositor = GetCompositor();
+#endif
+
   {
     PROFILER_LABEL("LayerManagerComposite", "PreRender",
       js::ProfileEntry::Category::GRAPHICS);
 
-    if (!mCompositor->GetWidget()->PreRender(this)) {
+    if (!mCompositor->GetWidget()->PreRender(&widgetContext)) {
       return;
     }
   }
 
   ParentLayerIntRect clipRect;
   IntRect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.width, mRenderBounds.height);
   IntRect actualBounds;
 
@@ -941,23 +949,23 @@ LayerManagerComposite::Render(const nsIn
     mCompositor->BeginFrame(aInvalidRegion, &rect, bounds, aOpaqueRegion, nullptr, &actualBounds);
   } else {
     gfx::IntRect rect;
     mCompositor->BeginFrame(aInvalidRegion, nullptr, bounds, aOpaqueRegion, &rect, &actualBounds);
     clipRect = ParentLayerIntRect(rect.x, rect.y, rect.width, rect.height);
   }
 
   if (actualBounds.IsEmpty()) {
-    mCompositor->GetWidget()->PostRender(this);
+    mCompositor->GetWidget()->PostRender(&widgetContext);
     return;
   }
 
   // Allow widget to render a custom background.
   mCompositor->GetWidget()->DrawWindowUnderlay(
-    this, LayoutDeviceIntRect::FromUnknownRect(actualBounds));
+    &widgetContext, LayoutDeviceIntRect::FromUnknownRect(actualBounds));
 
   RefPtr<CompositingRenderTarget> previousTarget;
   if (haveLayerEffects) {
     previousTarget = PushGroupForLayerEffects();
   } else {
     mTwoPassTmpTarget = nullptr;
   }
 
@@ -975,17 +983,17 @@ LayerManagerComposite::Render(const nsIn
   if (mTwoPassTmpTarget) {
     MOZ_ASSERT(haveLayerEffects);
     PopGroupForLayerEffects(previousTarget, clipRect.ToUnknownRect(),
                             grayscaleVal, invertVal, contrastVal);
   }
 
   // Allow widget to render a custom foreground.
   mCompositor->GetWidget()->DrawWindowOverlay(
-    this, LayoutDeviceIntRect::FromUnknownRect(actualBounds));
+    &widgetContext, LayoutDeviceIntRect::FromUnknownRect(actualBounds));
 
   // Debugging
   RenderDebugOverlay(actualBounds);
 
   {
     PROFILER_LABEL("LayerManagerComposite", "EndFrame",
       js::ProfileEntry::Category::GRAPHICS);
 
@@ -994,17 +1002,17 @@ LayerManagerComposite::Render(const nsIn
     // Call after EndFrame()
     mCompositor->SetDispAcquireFence(mRoot);
   }
 
   if (composer2D) {
     composer2D->Render(mCompositor->GetWidget()->RealWidget());
   }
 
-  mCompositor->GetWidget()->PostRender(this);
+  mCompositor->GetWidget()->PostRender(&widgetContext);
 
   RecordFrame();
 }
 
 #if defined(MOZ_WIDGET_ANDROID)
 class ScopedCompositorProjMatrix {
 public:
   ScopedCompositorProjMatrix(CompositorOGL* aCompositor, const Matrix4x4& aProjMatrix):
--- a/widget/CompositorWidget.h
+++ b/widget/CompositorWidget.h
@@ -48,16 +48,28 @@ class CompositorWidgetParent;
 
 // CompositorWidgetChild should implement CompositorWidgetDelegate and
 // PCompositorWidgetChild.
 class CompositorWidgetChild;
 
 # define MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING
 #endif
 
+class WidgetRenderingContext
+{
+public:
+#if defined(XP_MACOSX)
+  WidgetRenderingContext() : mLayerManager(nullptr) {}
+  layers::LayerManagerComposite* mLayerManager;
+#elif defined(MOZ_WIDGET_ANDROID)
+  WidgetRenderingContext() : mCompositor(nullptr) {}
+  layers::Compositor* mCompositor;
+#endif
+};
+
 /**
  * Access to a widget from the compositor is restricted to these methods.
  */
 class CompositorWidget
 {
 public:
   NS_INLINE_DECL_REFCOUNTING(mozilla::widget::CompositorWidget)
 
@@ -69,45 +81,45 @@ public:
 
   /**
    * Called before rendering using OMTC. Returns false when the widget is
    * not ready to be rendered (for example while the window is closed).
    *
    * Always called from the compositing thread, which may be the main-thread if
    * OMTC is not enabled.
    */
-  virtual bool PreRender(layers::LayerManagerComposite* aManager) {
+  virtual bool PreRender(WidgetRenderingContext* aContext) {
     return true;
   }
 
   /**
    * Called after rendering using OMTC. Not called when rendering was
    * cancelled by a negative return value from PreRender.
    *
    * Always called from the compositing thread, which may be the main-thread if
    * OMTC is not enabled.
    */
-  virtual void PostRender(layers::LayerManagerComposite* aManager)
+  virtual void PostRender(WidgetRenderingContext* aContext)
   {}
 
   /**
    * Called before the LayerManager draws the layer tree.
    *
    * Always called from the compositing thread.
    */
-  virtual void DrawWindowUnderlay(layers::LayerManagerComposite* aManager,
+  virtual void DrawWindowUnderlay(WidgetRenderingContext* aContext,
                                   LayoutDeviceIntRect aRect)
   {}
 
   /**
    * Called after the LayerManager draws the layer tree
    *
    * Always called from the compositing thread.
    */
-  virtual void DrawWindowOverlay(layers::LayerManagerComposite* aManager,
+  virtual void DrawWindowOverlay(WidgetRenderingContext* aContext,
                                  LayoutDeviceIntRect aRect)
   {}
 
   /**
    * Return a DrawTarget for the window which can be composited into.
    *
    * Called by BasicCompositor on the compositor thread for OMTC drawing
    * before each composition.
--- a/widget/InProcessCompositorWidget.cpp
+++ b/widget/InProcessCompositorWidget.cpp
@@ -28,39 +28,39 @@ CompositorWidget::CreateLocal(const Comp
 #endif
 
 InProcessCompositorWidget::InProcessCompositorWidget(nsBaseWidget* aWidget)
  : mWidget(aWidget)
 {
 }
 
 bool
-InProcessCompositorWidget::PreRender(layers::LayerManagerComposite* aManager)
+InProcessCompositorWidget::PreRender(WidgetRenderingContext* aContext)
 {
-  return mWidget->PreRender(aManager);
+  return mWidget->PreRender(aContext);
 }
 
 void
-InProcessCompositorWidget::PostRender(layers::LayerManagerComposite* aManager)
+InProcessCompositorWidget::PostRender(WidgetRenderingContext* aContext)
 {
-  mWidget->PostRender(aManager);
+  mWidget->PostRender(aContext);
 }
 
 void
-InProcessCompositorWidget::DrawWindowUnderlay(layers::LayerManagerComposite* aManager,
-                                          LayoutDeviceIntRect aRect)
+InProcessCompositorWidget::DrawWindowUnderlay(WidgetRenderingContext* aContext,
+                                              LayoutDeviceIntRect aRect)
 {
-  mWidget->DrawWindowUnderlay(aManager, aRect);
+  mWidget->DrawWindowUnderlay(aContext, aRect);
 }
 
 void
-InProcessCompositorWidget::DrawWindowOverlay(layers::LayerManagerComposite* aManager,
-                                         LayoutDeviceIntRect aRect)
+InProcessCompositorWidget::DrawWindowOverlay(WidgetRenderingContext* aContext,
+                                             LayoutDeviceIntRect aRect)
 {
-  mWidget->DrawWindowOverlay(aManager, aRect);
+  mWidget->DrawWindowOverlay(aContext, aRect);
 }
 
 already_AddRefed<gfx::DrawTarget>
 InProcessCompositorWidget::StartRemoteDrawing()
 {
   return mWidget->StartRemoteDrawing();
 }
 
--- a/widget/InProcessCompositorWidget.h
+++ b/widget/InProcessCompositorWidget.h
@@ -12,21 +12,21 @@ namespace widget {
 
 // This version of CompositorWidget implements a wrapper around
 // nsBaseWidget.
 class InProcessCompositorWidget : public CompositorWidget
 {
 public:
   explicit InProcessCompositorWidget(nsBaseWidget* aWidget);
 
-  virtual bool PreRender(layers::LayerManagerComposite* aManager) override;
-  virtual void PostRender(layers::LayerManagerComposite* aManager) override;
-  virtual void DrawWindowUnderlay(layers::LayerManagerComposite* aManager,
+  virtual bool PreRender(WidgetRenderingContext* aManager) override;
+  virtual void PostRender(WidgetRenderingContext* aManager) override;
+  virtual void DrawWindowUnderlay(WidgetRenderingContext* aContext,
                                   LayoutDeviceIntRect aRect) override;
-  virtual void DrawWindowOverlay(layers::LayerManagerComposite* aManager,
+  virtual void DrawWindowOverlay(WidgetRenderingContext* aContext,
                                  LayoutDeviceIntRect aRect) override;
   virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override;
   virtual already_AddRefed<gfx::DrawTarget>
   StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
                              layers::BufferMode* aBufferMode) override;
   virtual void EndRemoteDrawing() override;
   virtual void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
                                         LayoutDeviceIntRegion& aInvalidRegion) override;
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -3457,39 +3457,39 @@ nsWindow::SynthesizeNativeMouseMove(Layo
     MOZ_ASSERT(mLayerViewSupport);
     GeckoLayerClient::LocalRef client = mLayerViewSupport->GetLayerClient();
     client->SynthesizeNativeMouseEvent(sdk::MotionEvent::ACTION_HOVER_MOVE, aPoint.x, aPoint.y);
 
     return NS_OK;
 }
 
 bool
-nsWindow::PreRender(LayerManagerComposite* aManager)
+nsWindow::PreRender(WidgetRenderingContext* aContext)
 {
     if (Destroyed()) {
         return true;
     }
 
-    layers::Compositor* compositor = aManager->GetCompositor();
+    layers::Compositor* compositor = aContext->mCompositor;
 
     GeckoLayerClient::LocalRef client;
 
     if (NativePtr<LayerViewSupport>::Locked lvs{mLayerViewSupport}) {
         client = lvs->GetLayerClient();
     }
 
     if (compositor && client) {
         // Android Color is ARGB which is apparently unusual.
         compositor->SetDefaultClearColor(gfx::Color::UnusualFromARGB((uint32_t)client->ClearColor()));
     }
 
     return true;
 }
 void
-nsWindow::DrawWindowUnderlay(LayerManagerComposite* aManager,
+nsWindow::DrawWindowUnderlay(WidgetRenderingContext* aContext,
                              LayoutDeviceIntRect aRect)
 {
     if (Destroyed()) {
         return;
     }
 
     GeckoLayerClient::LocalRef client;
 
@@ -3510,17 +3510,17 @@ nsWindow::DrawWindowUnderlay(LayerManage
     if (!WidgetPaintsBackground()) {
         return;
     }
 
     frame->BeginDrawing();
 }
 
 void
-nsWindow::DrawWindowOverlay(LayerManagerComposite* aManager,
+nsWindow::DrawWindowOverlay(WidgetRenderingContext* aContext,
                             LayoutDeviceIntRect aRect)
 {
     PROFILER_LABEL("nsWindow", "DrawWindowOverlay",
         js::ProfileEntry::Category::GRAPHICS);
 
     if (Destroyed() || NS_WARN_IF(!mLayerRendererFrame)) {
         return;
     }
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -199,19 +199,21 @@ public:
     virtual nsIMEUpdatePreference GetIMEUpdatePreference() override;
 
     void SetSelectionDragState(bool aState);
     LayerManager* GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
                                   LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
                                   LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT) override;
 
     virtual bool NeedsPaint() override;
-    virtual bool PreRender(LayerManagerComposite* aManager) override;
-    virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override;
-    virtual void DrawWindowOverlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override;
+    virtual bool PreRender(mozilla::widget::WidgetRenderingContext* aContext) override;
+    virtual void DrawWindowUnderlay(mozilla::widget::WidgetRenderingContext* aContext,
+                                    LayoutDeviceIntRect aRect) override;
+    virtual void DrawWindowOverlay(mozilla::widget::WidgetRenderingContext* aContext,
+                                   LayoutDeviceIntRect aRect) override;
 
     virtual bool WidgetPaintsBackground() override;
 
     virtual uint32_t GetMaxTouchPoints() const override;
 
     void UpdateZoomConstraints(const uint32_t& aPresShellId,
                                const FrameMetrics::ViewID& aViewId,
                                const mozilla::Maybe<ZoomConstraints>& aConstraints) override;
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -47,16 +47,17 @@ class SwipeTracker;
 struct SwipeEventQueue;
 class VibrancyManager;
 namespace layers {
 class GLManager;
 class IAPZCTreeManager;
 } // namespace layers
 namespace widget {
 class RectTextureImage;
+class WidgetRenderingContext;
 } // namespace widget
 } // namespace mozilla
 
 @interface NSEvent (Undocumented)
 
 // Return Cocoa event's corresponding Carbon event.  Not initialized (on
 // synthetic events) until the OS actually "sends" the event.  This method
 // has been present in the same form since at least OS X 10.2.8.
@@ -436,19 +437,19 @@ public:
 
 #ifdef ACCESSIBILITY
   already_AddRefed<mozilla::a11y::Accessible> GetDocumentAccessible();
 #endif
 
   virtual void CreateCompositor() override;
   virtual void PrepareWindowEffects() override;
   virtual void CleanupWindowEffects() override;
-  virtual bool PreRender(LayerManagerComposite* aManager) override;
-  virtual void PostRender(LayerManagerComposite* aManager) override;
-  virtual void DrawWindowOverlay(LayerManagerComposite* aManager,
+  virtual bool PreRender(mozilla::widget::WidgetRenderingContext* aContext) override;
+  virtual void PostRender(mozilla::widget::WidgetRenderingContext* aContext) override;
+  virtual void DrawWindowOverlay(mozilla::widget::WidgetRenderingContext* aManager,
                                  LayoutDeviceIntRect aRect) override;
 
   virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) override;
 
   virtual void UpdateWindowDraggingRegion(const LayoutDeviceIntRegion& aRegion) override;
   LayoutDeviceIntRegion GetNonDraggableRegion() { return mNonDraggableRegion.Region(); }
 
   virtual void ReportSwipeStarted(uint64_t aInputBlockId, bool aStartSwipe) override;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -62,16 +62,17 @@
 #include "HeapCopyOfStackArray.h"
 #include "mozilla/layers/IAPZCTreeManager.h"
 #include "mozilla/layers/APZThreadUtils.h"
 #include "mozilla/layers/GLManager.h"
 #include "mozilla/layers/CompositorOGL.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "mozilla/layers/BasicCompositor.h"
 #include "mozilla/layers/InputAPZContext.h"
+#include "mozilla/widget/CompositorWidget.h"
 #include "gfxUtils.h"
 #include "gfxPrefs.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/BorrowedContext.h"
 #include "mozilla/gfx/MacIOSurface.h"
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #include "mozilla/a11y/Platform.h"
@@ -2014,19 +2015,19 @@ void
 nsChildView::CleanupWindowEffects()
 {
   mResizerImage = nullptr;
   mCornerMaskImage = nullptr;
   mTitlebarImage = nullptr;
 }
 
 bool
-nsChildView::PreRender(LayerManagerComposite* aManager)
-{
-  UniquePtr<GLManager> manager(GLManager::CreateGLManager(aManager));
+nsChildView::PreRender(WidgetRenderingContext* aContext)
+{
+  UniquePtr<GLManager> manager(GLManager::CreateGLManager(aContext->mLayerManager));
   if (!manager) {
     return true;
   }
 
   // The lock makes sure that we don't attempt to tear down the view while
   // compositing. That would make us unable to call postRender on it when the
   // composition is done, thus keeping the GL context locked forever.
   mViewTearDownLock.Lock();
@@ -2036,32 +2037,32 @@ nsChildView::PreRender(LayerManagerCompo
   if (![(ChildView*)mView preRender:glContext]) {
     mViewTearDownLock.Unlock();
     return false;
   }
   return true;
 }
 
 void
-nsChildView::PostRender(LayerManagerComposite* aManager)
-{
-  UniquePtr<GLManager> manager(GLManager::CreateGLManager(aManager));
+nsChildView::PostRender(WidgetRenderingContext* aContext)
+{
+  UniquePtr<GLManager> manager(GLManager::CreateGLManager(aContext->mLayerManager));
   if (!manager) {
     return;
   }
   NSOpenGLContext *glContext = GLContextCGL::Cast(manager->gl())->GetNSOpenGLContext();
   [(ChildView*)mView postRender:glContext];
   mViewTearDownLock.Unlock();
 }
 
 void
-nsChildView::DrawWindowOverlay(LayerManagerComposite* aManager,
+nsChildView::DrawWindowOverlay(WidgetRenderingContext* aContext,
                                LayoutDeviceIntRect aRect)
 {
-  mozilla::UniquePtr<GLManager> manager(GLManager::CreateGLManager(aManager));
+  mozilla::UniquePtr<GLManager> manager(GLManager::CreateGLManager(aContext->mLayerManager));
   if (manager) {
     DrawWindowOverlay(manager.get(), aRect);
   }
 }
 
 void
 nsChildView::DrawWindowOverlay(GLManager* aManager, LayoutDeviceIntRect aRect)
 {
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -58,16 +58,17 @@ class APZEventState;
 class CompositorSession;
 class ImageContainer;
 struct ScrollableLayerGuid;
 } // namespace layers
 
 namespace widget {
 class CompositorWidgetDelegate;
 class InProcessCompositorWidget;
+class WidgetRenderingContext;
 } // namespace widget
 
 class CompositorVsyncDispatcher;
 } // namespace mozilla
 
 namespace base {
 class Thread;
 } // namespace base
@@ -386,25 +387,25 @@ public:
 #if defined(XP_WIN)
   uint64_t CreateScrollCaptureContainer() override;
 #endif
 
 protected:
   // These are methods for CompositorWidgetWrapper, and should only be
   // accessed from that class. Derived widgets can choose which methods to
   // implement, or none if supporting out-of-process compositing.
-  virtual bool PreRender(mozilla::layers::LayerManagerComposite* aManager) {
+  virtual bool PreRender(mozilla::widget::WidgetRenderingContext* aContext) {
     return true;
   }
-  virtual void PostRender(mozilla::layers::LayerManagerComposite* aManager)
+  virtual void PostRender(mozilla::widget::WidgetRenderingContext* aContext)
   {}
-  virtual void DrawWindowUnderlay(mozilla::layers::LayerManagerComposite* aManager,
+  virtual void DrawWindowUnderlay(mozilla::widget::WidgetRenderingContext* aContext,
                                   LayoutDeviceIntRect aRect)
   {}
-  virtual void DrawWindowOverlay(mozilla::layers::LayerManagerComposite* aManager,
+  virtual void DrawWindowOverlay(mozilla::widget::WidgetRenderingContext* aContext,
                                  LayoutDeviceIntRect aRect)
   {}
   virtual already_AddRefed<DrawTarget> StartRemoteDrawing();
   virtual already_AddRefed<DrawTarget>
   StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion, BufferMode* aBufferMode)
   {
     return StartRemoteDrawing();
   }
--- a/widget/windows/WinCompositorWidget.cpp
+++ b/widget/windows/WinCompositorWidget.cpp
@@ -39,28 +39,28 @@ WinCompositorWidget::WinCompositorWidget
 void
 WinCompositorWidget::OnDestroyWindow()
 {
   mTransparentSurface = nullptr;
   mMemoryDC = nullptr;
 }
 
 bool
-WinCompositorWidget::PreRender(layers::LayerManagerComposite* aManager)
+WinCompositorWidget::PreRender(WidgetRenderingContext* aContext)
 {
   // This can block waiting for WM_SETTEXT to finish
   // Using PreRender is unnecessarily pessimistic because
   // we technically only need to block during the present call
   // not all of compositor rendering
   mPresentLock.Enter();
   return true;
 }
 
 void
-WinCompositorWidget::PostRender(layers::LayerManagerComposite* aManager)
+WinCompositorWidget::PostRender(WidgetRenderingContext* aContext)
 {
   mPresentLock.Leave();
 }
 
 LayoutDeviceIntSize
 WinCompositorWidget::GetClientSize()
 {
   RECT r;
--- a/widget/windows/WinCompositorWidget.h
+++ b/widget/windows/WinCompositorWidget.h
@@ -40,18 +40,18 @@ public:
 // with the compositor.
 class WinCompositorWidget
  : public CompositorWidget,
    public CompositorWidgetDelegate
 {
 public:
   WinCompositorWidget(const CompositorWidgetInitData& aInitData);
 
-  bool PreRender(layers::LayerManagerComposite*) override;
-  void PostRender(layers::LayerManagerComposite*) override;
+  bool PreRender(WidgetRenderingContext*) override;
+  void PostRender(WidgetRenderingContext*) override;
   already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override;
   void EndRemoteDrawing() override;
   bool NeedsToDeferEndRemoteDrawing() override;
   LayoutDeviceIntSize GetClientSize() override;
   already_AddRefed<gfx::DrawTarget> GetBackBufferDrawTarget(gfx::DrawTarget* aScreenTarget,
                                                             const LayoutDeviceIntRect& aRect,
                                                             const LayoutDeviceIntRect& aClearRect) override;
   already_AddRefed<gfx::SourceSurface> EndBackBufferDrawing() override;