2016-07-01 08:15:16 +00: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 "CompositorWidgetChild.h"
|
2016-08-23 04:09:32 +00:00
|
|
|
#include "mozilla/Unused.h"
|
2016-07-19 18:56:07 +00:00
|
|
|
#include "mozilla/widget/CompositorWidgetVsyncObserver.h"
|
|
|
|
#include "nsBaseWidget.h"
|
|
|
|
#include "VsyncDispatcher.h"
|
2016-07-01 08:15:16 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
|
2016-07-19 18:56:07 +00:00
|
|
|
CompositorWidgetChild::CompositorWidgetChild(RefPtr<CompositorVsyncDispatcher> aVsyncDispatcher,
|
|
|
|
RefPtr<CompositorWidgetVsyncObserver> aVsyncObserver)
|
|
|
|
: mVsyncDispatcher(aVsyncDispatcher),
|
|
|
|
mVsyncObserver(aVsyncObserver)
|
2016-07-01 08:15:16 +00:00
|
|
|
{
|
2016-07-19 18:56:07 +00:00
|
|
|
MOZ_ASSERT(XRE_IsParentProcess());
|
2016-07-01 08:15:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CompositorWidgetChild::~CompositorWidgetChild()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositorWidgetChild::EnterPresentLock()
|
|
|
|
{
|
|
|
|
Unused << SendEnterPresentLock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositorWidgetChild::LeavePresentLock()
|
|
|
|
{
|
|
|
|
Unused << SendLeavePresentLock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositorWidgetChild::OnDestroyWindow()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositorWidgetChild::UpdateTransparency(nsTransparencyMode aMode)
|
|
|
|
{
|
|
|
|
Unused << SendUpdateTransparency(static_cast<int32_t>(aMode));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositorWidgetChild::ClearTransparentWindow()
|
|
|
|
{
|
|
|
|
Unused << SendClearTransparentWindow();
|
|
|
|
}
|
|
|
|
|
2016-07-19 18:56:07 +00:00
|
|
|
HDC
|
|
|
|
CompositorWidgetChild::GetTransparentDC() const
|
2016-07-01 08:15:16 +00:00
|
|
|
{
|
|
|
|
// Not supported in out-of-process mode.
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2016-11-15 03:26:00 +00:00
|
|
|
mozilla::ipc::IPCResult
|
2016-07-19 18:56:07 +00:00
|
|
|
CompositorWidgetChild::RecvObserveVsync()
|
|
|
|
{
|
|
|
|
mVsyncDispatcher->SetCompositorVsyncObserver(mVsyncObserver);
|
2016-11-15 03:26:00 +00:00
|
|
|
return IPC_OK();
|
2016-07-19 18:56:07 +00:00
|
|
|
}
|
|
|
|
|
2016-11-15 03:26:00 +00:00
|
|
|
mozilla::ipc::IPCResult
|
2016-07-19 18:56:07 +00:00
|
|
|
CompositorWidgetChild::RecvUnobserveVsync()
|
|
|
|
{
|
|
|
|
mVsyncDispatcher->SetCompositorVsyncObserver(nullptr);
|
2016-11-15 03:26:00 +00:00
|
|
|
return IPC_OK();
|
2016-07-19 18:56:07 +00:00
|
|
|
}
|
|
|
|
|
2016-07-01 08:15:16 +00:00
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|