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/java/GeckoServiceGpuProcessWrappers.h"
9 #include "mozilla/widget/PlatformWidgetTypes.h"
14 CompositorWidgetParent::CompositorWidgetParent(
15 const CompositorWidgetInitData
& aInitData
,
16 const layers::CompositorOptions
& aOptions
)
17 : AndroidCompositorWidget(aInitData
.get_AndroidCompositorWidgetInitData(),
19 MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU
);
22 CompositorWidgetParent::~CompositorWidgetParent() = default;
24 nsIWidget
* CompositorWidgetParent::RealWidget() { return nullptr; }
26 void CompositorWidgetParent::ObserveVsync(VsyncObserver
* aObserver
) {
28 Unused
<< SendObserveVsync();
30 Unused
<< SendUnobserveVsync();
32 mVsyncObserver
= aObserver
;
35 RefPtr
<VsyncObserver
> CompositorWidgetParent::GetVsyncObserver() const {
36 MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU
);
37 return mVsyncObserver
;
40 mozilla::ipc::IPCResult
CompositorWidgetParent::RecvNotifyClientSizeChanged(
41 const LayoutDeviceIntSize
& aClientSize
) {
42 NotifyClientSizeChanged(aClientSize
);
46 void CompositorWidgetParent::OnCompositorSurfaceChanged() {
47 java::GeckoServiceGpuProcess::RemoteCompositorSurfaceManager::LocalRef
48 manager
= java::GeckoServiceGpuProcess::RemoteCompositorSurfaceManager::
50 mSurface
= manager
->GetCompositorSurface(mWidgetId
);
54 } // namespace mozilla