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 "CompositorWidgetChild.h"
7 #include "mozilla/Unused.h"
8 #include "gfxPlatform.h"
13 CompositorWidgetChild::CompositorWidgetChild(
14 RefPtr
<CompositorVsyncDispatcher
> aVsyncDispatcher
,
15 RefPtr
<CompositorWidgetVsyncObserver
> aVsyncObserver
,
16 const CompositorWidgetInitData
&)
17 : mVsyncDispatcher(aVsyncDispatcher
), mVsyncObserver(aVsyncObserver
) {
18 MOZ_ASSERT(XRE_IsParentProcess());
19 MOZ_ASSERT(!gfxPlatform::IsHeadless());
22 CompositorWidgetChild::~CompositorWidgetChild() = default;
24 bool CompositorWidgetChild::Initialize() { return true; }
26 mozilla::ipc::IPCResult
CompositorWidgetChild::RecvObserveVsync() {
27 mVsyncDispatcher
->SetCompositorVsyncObserver(mVsyncObserver
);
31 mozilla::ipc::IPCResult
CompositorWidgetChild::RecvUnobserveVsync() {
32 mVsyncDispatcher
->SetCompositorVsyncObserver(nullptr);
36 void CompositorWidgetChild::NotifyClientSizeChanged(
37 const LayoutDeviceIntSize
& aClientSize
) {
38 Unused
<< SendNotifyClientSizeChanged(aClientSize
);
41 void CompositorWidgetChild::DisableRendering() {
42 Unused
<< SendDisableRendering();
45 void CompositorWidgetChild::EnableRendering(const uintptr_t aXWindow
,
47 Unused
<< SendEnableRendering(aXWindow
, aShaped
);
51 } // namespace mozilla