Bug 1751217 Part 3: Make HDR-capable macOS screens report 30 pixelDepth. r=mstange
[gecko.git] / widget / gtk / CompositorWidgetParent.cpp
blob4382ccfd44e5e0d8d18d4dad5b2255eb3544acd8
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 #include "CompositorWidgetParent.h"
7 #include "mozilla/Unused.h"
8 #include "mozilla/widget/PlatformWidgetTypes.h"
10 namespace mozilla {
11 namespace widget {
13 CompositorWidgetParent::CompositorWidgetParent(
14 const CompositorWidgetInitData& aInitData,
15 const layers::CompositorOptions& aOptions)
16 : GtkCompositorWidget(aInitData.get_GtkCompositorWidgetInitData(), aOptions,
17 nullptr) {
18 MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU);
21 CompositorWidgetParent::~CompositorWidgetParent() = default;
23 void CompositorWidgetParent::ObserveVsync(VsyncObserver* aObserver) {
24 if (aObserver) {
25 Unused << SendObserveVsync();
26 } else {
27 Unused << SendUnobserveVsync();
29 mVsyncObserver = aObserver;
32 RefPtr<VsyncObserver> CompositorWidgetParent::GetVsyncObserver() const {
33 MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU);
34 return mVsyncObserver;
37 mozilla::ipc::IPCResult CompositorWidgetParent::RecvNotifyClientSizeChanged(
38 const LayoutDeviceIntSize& aClientSize) {
39 NotifyClientSizeChanged(aClientSize);
40 return IPC_OK();
43 mozilla::ipc::IPCResult CompositorWidgetParent::RecvDisableRendering() {
44 DisableRendering();
45 return IPC_OK();
48 mozilla::ipc::IPCResult CompositorWidgetParent::RecvEnableRendering(
49 const uintptr_t& aXWindow, const bool& aShaped) {
50 EnableRendering(aXWindow, aShaped);
51 return IPC_OK();
54 } // namespace widget
55 } // namespace mozilla