Bug 1869647 - Mark hasStorageAccess.sub.https.window.html as intermittent after wpt...
[gecko.git] / widget / gtk / CompositorWidgetParent.cpp
blob998614622e9096ef53418c0eca1a2a6abd55bdc3
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"
9 #include "nsWindow.h"
11 namespace mozilla::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 mozilla::widget