Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / widget / gtk / CompositorWidgetParent.cpp
blob7f576f35e7b703b66f86ef975e776ff1914033b3
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::RecvCleanupResources() {
44 CleanupResources();
45 return IPC_OK();
48 mozilla::ipc::IPCResult CompositorWidgetParent::RecvSetRenderingSurface(
49 const uintptr_t& aXWindow, const bool& aShaped) {
50 SetRenderingSurface(aXWindow, aShaped);
51 return IPC_OK();
54 } // namespace mozilla::widget