Bug 1692971 [wpt PR 27638] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / widget / android / AndroidCompositorWidget.h
blobbb475f77f405b4beade473525b0e7fec9594a16b
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"
10 #include "GLDefs.h"
11 #include "mozilla/widget/InProcessCompositorWidget.h"
13 namespace mozilla {
14 namespace widget {
16 /**
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
20 * instead.
22 class AndroidCompositorWidget final : public InProcessCompositorWidget {
23 public:
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();
45 protected:
46 virtual ~AndroidCompositorWidget();
48 ANativeWindow* mNativeWindow;
49 ANativeWindow_Buffer mBuffer;
50 int32_t mFormat;
53 } // namespace widget
54 } // namespace mozilla
56 #endif // mozilla_widget_AndroidCompositorWidget_h