2016-07-22 20:23:07 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "CompositorWidgetParent.h"
|
|
|
|
#include "mozilla/Unused.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
|
2017-01-13 01:29:42 +03:00
|
|
|
CompositorWidgetParent::CompositorWidgetParent(const CompositorWidgetInitData& aInitData,
|
|
|
|
const layers::CompositorOptions& aOptions)
|
|
|
|
: X11CompositorWidget(aInitData, aOptions)
|
2016-07-22 20:23:07 +03:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU);
|
|
|
|
}
|
|
|
|
|
|
|
|
CompositorWidgetParent::~CompositorWidgetParent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositorWidgetParent::ObserveVsync(VsyncObserver* aObserver)
|
|
|
|
{
|
|
|
|
if (aObserver) {
|
|
|
|
Unused << SendObserveVsync();
|
|
|
|
} else {
|
|
|
|
Unused << SendUnobserveVsync();
|
|
|
|
}
|
|
|
|
mVsyncObserver = aObserver;
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<VsyncObserver>
|
|
|
|
CompositorWidgetParent::GetVsyncObserver() const
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU);
|
|
|
|
return mVsyncObserver;
|
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2016-07-22 20:23:07 +03:00
|
|
|
CompositorWidgetParent::RecvNotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize)
|
|
|
|
{
|
|
|
|
NotifyClientSizeChanged(aClientSize);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-07-22 20:23:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|