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 
24 #include "mir/gl/program_factory.h"
26 #include "display_configuration.h"
27 #include "gl_context.h"
29 #include "overlay_optimization.h"
30 #include <system/window.h>
31 
32 namespace mir
33 {
34 namespace graphics
35 {
36 namespace android
37 {
38 
39 class DisplayDevice;
40 class FramebufferBundle;
41 class LayerList;
42 
44  public NativeDisplayBuffer,
46 {
47 public:
48  //TODO: could probably just take the HalComponentFactory to reduce the
49  // number of dependencies
52  std::unique_ptr<LayerList> layer_list,
53  std::shared_ptr<FramebufferBundle> const& fb_bundle,
54  std::shared_ptr<DisplayDevice> const& display_device,
55  std::shared_ptr<ANativeWindow> const& native_window,
56  GLContext const& shared_gl_context,
57  gl::ProgramFactory const& program_factory,
60  OverlayOptimization overlay_option);
61 
62  geometry::Rectangle view_area() const override;
63  void make_current() override;
64  void release_current() override;
65  void swap_buffers() override;
66  bool post_renderables_if_optimizable(RenderableList const& renderlist) override;
67 
68  MirOrientation orientation() const override;
70 
72  DisplayContents contents() override;
73  MirPowerMode power_mode() const override;
74 private:
75  DisplayName display_name;
76  std::unique_ptr<LayerList> layer_list;
77  std::shared_ptr<FramebufferBundle> const fb_bundle;
78  std::shared_ptr<DisplayDevice> const display_device;
79  std::shared_ptr<ANativeWindow> const native_window;
80  FramebufferGLContext gl_context;
81  HWCFallbackGLRenderer overlay_program;
82  bool overlay_enabled;
83  MirOrientation orientation_;
84  geometry::Displacement offset_from_origin;
85  MirPowerMode power_mode_;
86 };
87 
88 }
89 }
90 }
91 
92 #endif /* MIR_GRAPHICS_ANDROID_DISPLAY_BUFFER_H_ */
All things Mir.
Definition: atomic_callback.h:25
DisplayContents contents() override
Definition: display_buffer.cpp:126
Definition: configurable_display_buffer.h:32
Definition: gl_context.h:40
Definition: program_factory.h:31
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: display_buffer.cpp:82
void configure(MirPowerMode power_mode, MirOrientation orientation, geometry::Displacement) override
Definition: display_buffer.cpp:117
MirPowerMode power_mode() const override
Definition: display_buffer.cpp:131
void swap_buffers() override
Swap buffers for OpenGL rendering.
Definition: display_buffer.cpp:98
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
OverlayOptimization
Definition: overlay_optimization.h:28
DisplayName
Definition: display_name.h:32
NativeDisplayBuffer * native_display_buffer() override
Returns a pointer to the native display buffer object backing this display buffer.
Definition: display_buffer.cpp:136
Definition: display_buffer.h:43
geometry::Rectangle view_area() const override
The area the DisplayBuffer occupies in the virtual screen space.
Definition: display_buffer.cpp:59
Definition: display_buffer.h:35
MirPowerMode
Definition: common.h:101
Definition: render_target.h:29
Definition: displacement.h:32
MirOrientation orientation() const override
Returns the orientation of the display buffer relative to how the user should see it (the orientation...
Definition: display_buffer.cpp:106
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:79
void release_current() override
Releases the current GL render target.
Definition: display_buffer.cpp:77
Definition: rectangle.h:33
Definition: android_input_receiver.h:36
Definition: display_device.h:43
void make_current() override
Makes the the current GL render target.
Definition: display_buffer.cpp:72
Definition: hwc_fallback_gl_renderer.h:51

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016