Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
display_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser 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_DISPLAY_BUFFER_H_
20 #define MIR_GRAPHICS_ANDROID_DISPLAY_BUFFER_H_
21 
25 #include "display_configuration.h"
26 #include "gl_context.h"
28 #include "overlay_optimization.h"
29 #include <system/window.h>
30 
31 namespace mir
32 {
33 namespace graphics
34 {
35 namespace android
36 {
37 
38 class DisplayDevice;
39 class FramebufferBundle;
40 
42 {
43 public:
44  DisplayBuffer(std::shared_ptr<FramebufferBundle> const& fb_bundle,
45  std::shared_ptr<DisplayDevice> const& display_device,
46  std::shared_ptr<ANativeWindow> const& native_window,
47  GLContext const& shared_gl_context,
48  GLProgramFactory const& program_factory,
49  OverlayOptimization overlay_option);
50 
52  void make_current();
53  void release_current();
54  void post_update();
55  bool post_renderables_if_optimizable(RenderableList const& renderlist);
56 
57  MirOrientation orientation() const override;
58  bool uses_alpha() const override;
59 
62 
63 private:
64  std::shared_ptr<FramebufferBundle> const fb_bundle;
65  std::shared_ptr<DisplayDevice> const display_device;
66  std::shared_ptr<ANativeWindow> const native_window;
67  FramebufferGLContext gl_context;
68  HWCFallbackGLRenderer overlay_program;
69  bool overlay_enabled;
70  DisplayConfigurationOutput current_configuration;
71 };
72 
73 }
74 }
75 }
76 
77 #endif /* MIR_GRAPHICS_ANDROID_DISPLAY_BUFFER_H_ */
All things Mir.
Definition: aging_buffer.h:24
void release_current()
Releases the current GL rendering target.
Definition: configurable_display_buffer.h:32
void configure(DisplayConfigurationOutput const &)
bool post_renderables_if_optimizable(RenderableList const &renderlist)
This will render renderlist to the screen and post the result to the screen if there is a hardware op...
Definition: gl_context.h:40
DisplayConfigurationOutput configuration() const
Definition: gl_program_factory.h:31
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:134
OverlayOptimization
Definition: overlay_optimization.h:28
bool uses_alpha() const override
Returns true if the display buffer has an alpha channel and the alpha channel will be read from at so...
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88
Definition: display_buffer.h:41
geometry::Rectangle view_area() const
The area the DisplayBuffer occupies in the virtual screen space.
void post_update()
This will trigger OpenGL rendering and post the result to the screen.
MirOrientation orientation() const override
Returns the orientation of the display buffer relative to how the user should see it (the orientation...
Configuration information for a display output.
Definition: display_configuration.h:83
Definition: rectangle.h:33
Definition: android_input_receiver.h:32
void make_current()
Makes the DisplayBuffer the current GL rendering target.
Definition: hwc_fallback_gl_renderer.h:50

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014