Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / widget / windows / CompositorWidgetChild.h
blobef508bf80268e6a1ba77b2c164fa70266700d004
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef widget_windows_CompositorWidgetChild_h
7 #define widget_windows_CompositorWidgetChild_h
9 #include "WinCompositorWidget.h"
10 #include "mozilla/widget/PCompositorWidgetChild.h"
11 #include "mozilla/widget/CompositorWidgetVsyncObserver.h"
13 namespace mozilla {
14 class CompositorVsyncDispatcher;
16 namespace widget {
18 namespace remote_backbuffer {
19 class Provider;
22 class CompositorWidgetChild final : public PCompositorWidgetChild,
23 public PlatformCompositorWidgetDelegate {
24 public:
25 CompositorWidgetChild(RefPtr<CompositorVsyncDispatcher> aVsyncDispatcher,
26 RefPtr<CompositorWidgetVsyncObserver> aVsyncObserver,
27 const CompositorWidgetInitData& aInitData);
28 ~CompositorWidgetChild() override;
30 bool Initialize();
32 void EnterPresentLock() override;
33 void LeavePresentLock() override;
34 void OnDestroyWindow() override;
35 bool OnWindowResize(const LayoutDeviceIntSize& aSize) override;
36 void NotifyVisibilityUpdated(bool aIsFullyOccluded) override;
38 void UpdateTransparency(TransparencyMode) override;
39 void ClearTransparentWindow() override;
41 mozilla::ipc::IPCResult RecvObserveVsync() override;
42 mozilla::ipc::IPCResult RecvUnobserveVsync() override;
43 mozilla::ipc::IPCResult RecvUpdateCompositorWnd(
44 const WindowsHandle& aCompositorWnd, const WindowsHandle& aParentWnd,
45 UpdateCompositorWndResolver&& aResolve) override;
47 private:
48 RefPtr<CompositorVsyncDispatcher> mVsyncDispatcher;
49 RefPtr<CompositorWidgetVsyncObserver> mVsyncObserver;
50 HWND mCompositorWnd;
52 HWND mWnd;
54 std::unique_ptr<remote_backbuffer::Provider> mRemoteBackbufferProvider;
57 } // namespace widget
58 } // namespace mozilla
60 #endif // widget_windows_CompositorWidgetChild_h