Bug 1253840 - Remove .ini file as it's no longer necessary by passing on all platform...
[gecko.git] / widget / android / AndroidCompositorWidget.h
blobc478477b5fe3275a2bef4c03a19e0b0e3cb7108f
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 "CompositorWidget.h"
10 #include "AndroidNativeWindow.h"
11 #include "GLDefs.h"
13 namespace mozilla {
14 namespace widget {
16 class PlatformCompositorWidgetDelegate : public CompositorWidgetDelegate {
17 public:
18 virtual void NotifyClientSizeChanged(
19 const LayoutDeviceIntSize& aClientSize) = 0;
21 // CompositorWidgetDelegate Overrides
22 PlatformCompositorWidgetDelegate* AsPlatformSpecificDelegate() override {
23 return this;
27 class AndroidCompositorWidgetInitData;
29 class AndroidCompositorWidget : public CompositorWidget {
30 public:
31 AndroidCompositorWidget(const AndroidCompositorWidgetInitData& aInitData,
32 const layers::CompositorOptions& aOptions);
33 ~AndroidCompositorWidget() override;
35 EGLNativeWindowType GetEGLNativeWindow();
37 // CompositorWidget overrides
39 already_AddRefed<gfx::DrawTarget> StartRemoteDrawingInRegion(
40 const LayoutDeviceIntRegion& aInvalidRegion,
41 layers::BufferMode* aBufferMode) override;
42 void EndRemoteDrawingInRegion(
43 gfx::DrawTarget* aDrawTarget,
44 const LayoutDeviceIntRegion& aInvalidRegion) override;
46 bool OnResumeComposition() override;
48 AndroidCompositorWidget* AsAndroid() override { return this; }
50 LayoutDeviceIntSize GetClientSize() override;
51 void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize);
53 protected:
54 int32_t mWidgetId;
55 java::sdk::Surface::GlobalRef mSurface;
56 ANativeWindow* mNativeWindow;
57 ANativeWindow_Buffer mBuffer;
58 int32_t mFormat;
59 LayoutDeviceIntSize mClientSize;
61 private:
62 // Called whenever the compositor surface may have changed. The derived class
63 // should update mSurface to the new compositor surface.
64 virtual void OnCompositorSurfaceChanged() = 0;
67 } // namespace widget
68 } // namespace mozilla
70 #endif // mozilla_widget_AndroidCompositorWidget_h