Loading widget/CompositorWidget.h +18 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,24 @@ class CompositorWidget { */ virtual already_AddRefed<gfx::SourceSurface> EndBackBufferDrawing(); #ifdef XP_MACOSX /** * Return the opaque region of the widget. This is racy and can only be used * on macOS, where the widget works around the raciness. * Bug 1576491 tracks fixing this properly. * The problem with this method is that it can return values "from the future" * - the compositor might be working on frame N but the widget will return its * opaque region from frame N + 1. * It is believed that this won't lead to visible glitches on macOS due to the * SuspendAsyncCATransactions call when the vibrant region changes or when the * window resizes. Whenever the compositor uses an opaque region that's a * frame ahead, the result it renders won't be shown on the screen; instead, * the next composite will happen with the correct display list, and that's * what's shown on the screen once the FlushRendering call completes. */ virtual LayoutDeviceIntRegion GetOpaqueWidgetRegion() { return {}; } #endif /** * Observe or unobserve vsync. */ Loading widget/InProcessCompositorWidget.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,12 @@ uintptr_t InProcessCompositorWidget::GetWidgetKey() { nsIWidget* InProcessCompositorWidget::RealWidget() { return mWidget; } #ifdef XP_MACOSX LayoutDeviceIntRegion InProcessCompositorWidget::GetOpaqueWidgetRegion() { return mWidget->GetOpaqueWidgetRegion(); } #endif void InProcessCompositorWidget::ObserveVsync(VsyncObserver* aObserver) { if (RefPtr<CompositorVsyncDispatcher> cvd = mWidget->GetCompositorVsyncDispatcher()) { Loading widget/InProcessCompositorWidget.h +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,9 @@ class InProcessCompositorWidget : public CompositorWidget { virtual bool InitCompositor(layers::Compositor* aCompositor) override; virtual LayoutDeviceIntSize GetClientSize() override; virtual uint32_t GetGLFrameBufferFormat() override; #ifdef XP_MACOSX virtual LayoutDeviceIntRegion GetOpaqueWidgetRegion() override; #endif virtual void ObserveVsync(VsyncObserver* aObserver) override; virtual uintptr_t GetWidgetKey() override; Loading widget/cocoa/nsChildView.h +2 −0 Original line number Diff line number Diff line Loading @@ -568,6 +568,8 @@ class nsChildView final : public nsBaseWidget { virtual LayoutDeviceIntPoint GetClientOffset() override; virtual LayoutDeviceIntRegion GetOpaqueWidgetRegion() override; void DispatchAPZWheelInputEvent(mozilla::InputData& aEvent, bool aCanTriggerSwipe); nsEventStatus DispatchAPZInputEvent(mozilla::InputData& aEvent); Loading widget/cocoa/nsChildView.mm +5 −0 Original line number Diff line number Diff line Loading @@ -1590,6 +1590,11 @@ LayoutDeviceIntPoint nsChildView::WidgetToScreenOffset() { NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(LayoutDeviceIntPoint(0, 0)); } LayoutDeviceIntRegion nsChildView::GetOpaqueWidgetRegion() { auto opaqueRegion = mOpaqueRegion.Lock(); return *opaqueRegion; } nsresult nsChildView::SetTitle(const nsAString& title) { // child views don't have titles return NS_OK; Loading Loading
widget/CompositorWidget.h +18 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,24 @@ class CompositorWidget { */ virtual already_AddRefed<gfx::SourceSurface> EndBackBufferDrawing(); #ifdef XP_MACOSX /** * Return the opaque region of the widget. This is racy and can only be used * on macOS, where the widget works around the raciness. * Bug 1576491 tracks fixing this properly. * The problem with this method is that it can return values "from the future" * - the compositor might be working on frame N but the widget will return its * opaque region from frame N + 1. * It is believed that this won't lead to visible glitches on macOS due to the * SuspendAsyncCATransactions call when the vibrant region changes or when the * window resizes. Whenever the compositor uses an opaque region that's a * frame ahead, the result it renders won't be shown on the screen; instead, * the next composite will happen with the correct display list, and that's * what's shown on the screen once the FlushRendering call completes. */ virtual LayoutDeviceIntRegion GetOpaqueWidgetRegion() { return {}; } #endif /** * Observe or unobserve vsync. */ Loading
widget/InProcessCompositorWidget.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,12 @@ uintptr_t InProcessCompositorWidget::GetWidgetKey() { nsIWidget* InProcessCompositorWidget::RealWidget() { return mWidget; } #ifdef XP_MACOSX LayoutDeviceIntRegion InProcessCompositorWidget::GetOpaqueWidgetRegion() { return mWidget->GetOpaqueWidgetRegion(); } #endif void InProcessCompositorWidget::ObserveVsync(VsyncObserver* aObserver) { if (RefPtr<CompositorVsyncDispatcher> cvd = mWidget->GetCompositorVsyncDispatcher()) { Loading
widget/InProcessCompositorWidget.h +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,9 @@ class InProcessCompositorWidget : public CompositorWidget { virtual bool InitCompositor(layers::Compositor* aCompositor) override; virtual LayoutDeviceIntSize GetClientSize() override; virtual uint32_t GetGLFrameBufferFormat() override; #ifdef XP_MACOSX virtual LayoutDeviceIntRegion GetOpaqueWidgetRegion() override; #endif virtual void ObserveVsync(VsyncObserver* aObserver) override; virtual uintptr_t GetWidgetKey() override; Loading
widget/cocoa/nsChildView.h +2 −0 Original line number Diff line number Diff line Loading @@ -568,6 +568,8 @@ class nsChildView final : public nsBaseWidget { virtual LayoutDeviceIntPoint GetClientOffset() override; virtual LayoutDeviceIntRegion GetOpaqueWidgetRegion() override; void DispatchAPZWheelInputEvent(mozilla::InputData& aEvent, bool aCanTriggerSwipe); nsEventStatus DispatchAPZInputEvent(mozilla::InputData& aEvent); Loading
widget/cocoa/nsChildView.mm +5 −0 Original line number Diff line number Diff line Loading @@ -1590,6 +1590,11 @@ LayoutDeviceIntPoint nsChildView::WidgetToScreenOffset() { NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(LayoutDeviceIntPoint(0, 0)); } LayoutDeviceIntRegion nsChildView::GetOpaqueWidgetRegion() { auto opaqueRegion = mOpaqueRegion.Lock(); return *opaqueRegion; } nsresult nsChildView::SetTitle(const nsAString& title) { // child views don't have titles return NS_OK; Loading