Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
android_display.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_
20 #define MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_
21 
22 #include "mir/graphics/display.h"
26 
27 #include <EGL/egl.h>
28 #include <memory>
29 
30 namespace mir
31 {
32 namespace graphics
33 {
34 
35 class DisplayReport;
36 class DisplayBuffer;
37 
38 namespace android
39 {
40 
41 class AndroidDisplayBufferFactory;
42 class DisplaySupportProvider;
43 
44 class AndroidDisplay : public Display
45 {
46 public:
47  explicit AndroidDisplay(std::shared_ptr<AndroidFramebufferWindowQuery> const&,
48  std::shared_ptr<AndroidDisplayBufferFactory> const&,
49  std::shared_ptr<DisplaySupportProvider> const&,
50  std::shared_ptr<DisplayReport> const&);
51  ~AndroidDisplay();
52 
53  void for_each_display_buffer(std::function<void(DisplayBuffer&)> const& f);
54 
55  std::shared_ptr<DisplayConfiguration> configuration();
56  void configure(DisplayConfiguration const&);
57 
59  EventHandlerRegister& handlers,
60  DisplayConfigurationChangeHandler const& conf_change_handler);
61 
63  EventHandlerRegister& handlers,
64  DisplayPauseHandler const& pause_handler,
65  DisplayResumeHandler const& resume_handler);
66 
67  void pause();
68  void resume();
69 
70  std::weak_ptr<Cursor> the_cursor();
71  std::unique_ptr<graphics::GLContext> create_gl_context();
72 
73 private:
74  std::shared_ptr<AndroidFramebufferWindowQuery> const native_window;
75  EGLDisplay egl_display;
76  EGLConfig egl_config;
77  EGLContextStore const egl_context_shared;
78  EGLSurfaceStore const egl_surface_dummy;
79  std::unique_ptr<DisplayBuffer> display_buffer;
80  std::shared_ptr<DisplaySupportProvider> display_provider;
81 
82  AndroidDisplayConfiguration current_configuration;
83 };
84 
85 }
86 }
87 }
88 #endif /* MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013