1 /* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
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 #ifndef mozilla_widget_AndroidCompositorWidget_h
7 #define mozilla_widget_AndroidCompositorWidget_h
9 #include "AndroidNativeWindow.h"
11 #include "mozilla/widget/InProcessCompositorWidget.h"
17 * AndroidCompositorWidget inherits from InProcessCompositorWidget because
18 * Android does not support OOP compositing yet. Once it does,
19 * AndroidCompositorWidget will be made to inherit from CompositorWidget
22 class AndroidCompositorWidget final
: public InProcessCompositorWidget
{
24 using InProcessCompositorWidget::InProcessCompositorWidget
;
26 AndroidCompositorWidget(const layers::CompositorOptions
& aOptions
,
27 nsBaseWidget
* aWidget
);
29 already_AddRefed
<gfx::DrawTarget
> StartRemoteDrawingInRegion(
30 LayoutDeviceIntRegion
& aInvalidRegion
,
31 layers::BufferMode
* aBufferMode
) override
;
32 void EndRemoteDrawingInRegion(
33 gfx::DrawTarget
* aDrawTarget
,
34 const LayoutDeviceIntRegion
& aInvalidRegion
) override
;
36 AndroidCompositorWidget
* AsAndroid() override
{ return this; }
38 EGLNativeWindowType
GetEGLNativeWindow();
40 EGLSurface
GetPresentationEGLSurface();
41 void SetPresentationEGLSurface(EGLSurface aVal
);
43 ANativeWindow
* GetPresentationANativeWindow();
46 virtual ~AndroidCompositorWidget();
48 ANativeWindow
* mNativeWindow
;
49 ANativeWindow_Buffer mBuffer
;
54 } // namespace mozilla
56 #endif // mozilla_widget_AndroidCompositorWidget_h