Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 "gl_context.h"
26 #include <system/window.h>
27 
28 namespace mir
29 {
30 namespace graphics
31 {
32 namespace android
33 {
34 
35 class DisplayDevice;
36 class FramebufferBundle;
37 
38 class DisplayBuffer : public ConfigurableDisplayBuffer
39 {
40 public:
41  DisplayBuffer(std::shared_ptr<FramebufferBundle> const& fb_bundle,
42  std::shared_ptr<DisplayDevice> const& display_device,
43  std::shared_ptr<ANativeWindow> const& native_window,
44  GLContext const& shared_gl_context);
45 
46  geometry::Rectangle view_area() const;
47  void make_current();
48  void release_current();
49  void post_update();
50  bool can_bypass() const override;
51 
53  RenderableList const& renderlist,
54  std::function<void(Renderable const&)> const& render_fn);
55  MirOrientation orientation() const override;
56 
57  DisplayConfigurationOutput configuration() const;
58  void configure(DisplayConfigurationOutput const&);
59 
60 private:
61  void post();
62 
63  std::shared_ptr<FramebufferBundle> const fb_bundle;
64  std::shared_ptr<DisplayDevice> const display_device;
65  std::shared_ptr<ANativeWindow> const native_window;
66  GLContext gl_context;
67  bool prepared;
68  DisplayConfigurationOutput current_configuration;
69  MirOrientation rotation;
70 };
71 
72 }
73 }
74 }
75 
76 #endif /* MIR_GRAPHICS_ANDROID_DISPLAY_BUFFER_H_ */
virtual void release_current()=0
Releases the current GL rendering target.
virtual void render_and_post_update(RenderableList const &renderlist, std::function< void(Renderable const &)> const &render_fn)=0
This will render renderlist to the screen and post the result to the screen.
MirOrientation
Definition: common.h:113
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88
virtual bool can_bypass() const =0
to be deprecated
virtual void post_update()=0
This will trigger OpenGL rendering and post the result to the screen.
virtual geometry::Rectangle view_area() const =0
The area the DisplayBuffer occupies in the virtual screen space.
virtual void make_current()=0
Makes the DisplayBuffer the current GL rendering target.
virtual MirOrientation orientation() const =0
Returns the orientation of the display buffer relative to how the user should see it (the orientation...

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014