Mir
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 class LayerList;
41 
43 {
44 public:
45  //TODO: could probably just take the HalComponentFactory to reduce the
46  // number of dependencies
48  std::unique_ptr<LayerList> layer_list,
49  std::shared_ptr<FramebufferBundle> const& fb_bundle,
50  std::shared_ptr<DisplayDevice> const& display_device,
51  std::shared_ptr<ANativeWindow> const& native_window,
52  GLContext const& shared_gl_context,
53  GLProgramFactory const& program_factory,
55  OverlayOptimization overlay_option);
56 
57  geometry::Rectangle view_area() const override;
58  void make_current() override;
59  void release_current() override;
60  void gl_swap_buffers() override;
61  void flip() override;
62  bool post_renderables_if_optimizable(RenderableList const& renderlist) override;
63 
64  MirOrientation orientation() const override;
65  bool uses_alpha() const override;
66  void configure(MirPowerMode power_mode, MirOrientation orientation) override;
67 private:
68  std::unique_ptr<LayerList> layer_list;
69  std::shared_ptr<FramebufferBundle> const fb_bundle;
70  std::shared_ptr<DisplayDevice> const display_device;
71  std::shared_ptr<ANativeWindow> const native_window;
72  FramebufferGLContext gl_context;
73  HWCFallbackGLRenderer overlay_program;
74  bool overlay_enabled;
75  MirOrientation orientation_;
76 };
77 
78 }
79 }
80 }
81 
82 #endif /* MIR_GRAPHICS_ANDROID_DISPLAY_BUFFER_H_ */
All things Mir.
Definition: buffer_stream.h:37
Definition: configurable_display_buffer.h:32
void configure(MirPowerMode power_mode, MirOrientation orientation) override
Definition: gl_context.h:40
bool post_renderables_if_optimizable(RenderableList const &renderlist) override
This will render renderlist to the screen and post the result to the screen if there is a hardware op...
Definition: gl_program_factory.h:31
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:142
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:80
Definition: display_buffer.h:42
MirPowerMode
Definition: common.h:103
void flip() override
After gl_swap_buffers, flip the new front buffer to the screen This most likely involves a wait for v...
MirOrientation orientation() const override
Returns the orientation of the display buffer relative to how the user should see it (the orientation...
geometry::Rectangle view_area() const override
The area the DisplayBuffer occupies in the virtual screen space.
void gl_swap_buffers() override
Swap buffers for OpenGL rendering.
void release_current() override
Releases the current GL rendering target.
Definition: rectangle.h:33
Definition: android_input_receiver.h:32
void make_current() override
Makes the DisplayBuffer the current GL rendering target.
Definition: hwc_fallback_gl_renderer.h:50

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015