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"
13 CompositorWidgetParent::CompositorWidgetParent(
14 const CompositorWidgetInitData
& aInitData
,
15 const layers::CompositorOptions
& aOptions
)
16 : GtkCompositorWidget(aInitData
.get_GtkCompositorWidgetInitData(), aOptions
,
18 MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU
);
21 CompositorWidgetParent::~CompositorWidgetParent() = default;
23 void CompositorWidgetParent::ObserveVsync(VsyncObserver
* aObserver
) {
25 Unused
<< SendObserveVsync();
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
);
43 mozilla::ipc::IPCResult
CompositorWidgetParent::RecvDisableRendering() {
48 mozilla::ipc::IPCResult
CompositorWidgetParent::RecvEnableRendering(
49 const uintptr_t& aXWindow
, const bool& aShaped
) {
50 EnableRendering(aXWindow
, aShaped
);
55 } // namespace mozilla