diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /widget/InProcessCompositorWidget.cpp | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'widget/InProcessCompositorWidget.cpp')
-rw-r--r-- | widget/InProcessCompositorWidget.cpp | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/widget/InProcessCompositorWidget.cpp b/widget/InProcessCompositorWidget.cpp new file mode 100644 index 000000000..9b301fc48 --- /dev/null +++ b/widget/InProcessCompositorWidget.cpp @@ -0,0 +1,145 @@ +/* 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 "InProcessCompositorWidget.h" +#include "nsBaseWidget.h" + +#if defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING) +#include "mozilla/widget/AndroidCompositorWidget.h" +#endif + +namespace mozilla { +namespace widget { + +// Platforms with no OOP compositor process support use +// InProcessCompositorWidget by default. +#if !defined(MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING) +/* static */ RefPtr<CompositorWidget> +CompositorWidget::CreateLocal(const CompositorWidgetInitData& aInitData, nsIWidget* aWidget) +{ + MOZ_ASSERT(aWidget); +#ifdef MOZ_WIDGET_ANDROID + return new AndroidCompositorWidget(static_cast<nsBaseWidget*>(aWidget)); +#else + return new InProcessCompositorWidget(static_cast<nsBaseWidget*>(aWidget)); +#endif +} +#endif + +InProcessCompositorWidget::InProcessCompositorWidget(nsBaseWidget* aWidget) + : mWidget(aWidget) +{ +} + +bool +InProcessCompositorWidget::PreRender(WidgetRenderingContext* aContext) +{ + return mWidget->PreRender(aContext); +} + +void +InProcessCompositorWidget::PostRender(WidgetRenderingContext* aContext) +{ + mWidget->PostRender(aContext); +} + +void +InProcessCompositorWidget::DrawWindowUnderlay(WidgetRenderingContext* aContext, + LayoutDeviceIntRect aRect) +{ + mWidget->DrawWindowUnderlay(aContext, aRect); +} + +void +InProcessCompositorWidget::DrawWindowOverlay(WidgetRenderingContext* aContext, + LayoutDeviceIntRect aRect) +{ + mWidget->DrawWindowOverlay(aContext, aRect); +} + +already_AddRefed<gfx::DrawTarget> +InProcessCompositorWidget::StartRemoteDrawing() +{ + return mWidget->StartRemoteDrawing(); +} + +already_AddRefed<gfx::DrawTarget> +InProcessCompositorWidget::StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion, + layers::BufferMode* aBufferMode) +{ + return mWidget->StartRemoteDrawingInRegion(aInvalidRegion, aBufferMode); +} + +void +InProcessCompositorWidget::EndRemoteDrawing() +{ + mWidget->EndRemoteDrawing(); +} + +void +InProcessCompositorWidget::EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget, + LayoutDeviceIntRegion& aInvalidRegion) +{ + mWidget->EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion); +} + +void +InProcessCompositorWidget::CleanupRemoteDrawing() +{ + mWidget->CleanupRemoteDrawing(); +} + +void +InProcessCompositorWidget::CleanupWindowEffects() +{ + mWidget->CleanupWindowEffects(); +} + +bool +InProcessCompositorWidget::InitCompositor(layers::Compositor* aCompositor) +{ + return mWidget->InitCompositor(aCompositor); +} + +LayoutDeviceIntSize +InProcessCompositorWidget::GetClientSize() +{ + return mWidget->GetClientSize(); +} + +uint32_t +InProcessCompositorWidget::GetGLFrameBufferFormat() +{ + return mWidget->GetGLFrameBufferFormat(); +} + +layers::Composer2D* +InProcessCompositorWidget::GetComposer2D() +{ + return mWidget->GetComposer2D(); +} + +uintptr_t +InProcessCompositorWidget::GetWidgetKey() +{ + return reinterpret_cast<uintptr_t>(mWidget); +} + +nsIWidget* +InProcessCompositorWidget::RealWidget() +{ + return mWidget; +} + +void +InProcessCompositorWidget::ObserveVsync(VsyncObserver* aObserver) +{ + if (RefPtr<CompositorVsyncDispatcher> cvd = mWidget->GetCompositorVsyncDispatcher()) { + cvd->SetCompositorVsyncObserver(aObserver); + } +} + +} // namespace widget +} // namespace mozilla + |