Mir
display_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 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: Cemil Azizoglu <cemil.azizoglu@canonical.com>
17  *
18  */
19 
20 #ifndef MIR_GRAPHICS_X_DISPLAY_BUFFER_H_
21 #define MIR_GRAPHICS_X_DISPLAY_BUFFER_H_
22 
25 #include "gl_context.h"
26 
27 #include <EGL/egl.h>
28 
29 namespace mir
30 {
31 namespace graphics
32 {
33 namespace X
34 {
35 
39 {
40 public:
42  geometry::Size const sz,
43  EGLDisplay const d,
44  EGLSurface const s,
45  EGLContext const c,
46  MirOrientation const o);
47 
48  geometry::Rectangle view_area() const override;
49  void make_current() override;
50  void release_current() override;
51  void swap_buffers() override;
52  bool post_renderables_if_optimizable(RenderableList const& renderlist) override;
53  void set_orientation(MirOrientation const new_orientation);
54 
55  MirOrientation orientation() const override;
57 
58 private:
59  geometry::Size const size;
60  EGLDisplay const egl_dpy;
61  EGLSurface const egl_surf;
62  EGLContext const egl_ctx;
63  MirOrientation orientation_;
64 };
65 
66 }
67 }
68 }
69 
70 #endif /* MIR_GRAPHICS_X_DISPLAY_BUFFER_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
void swap_buffers() override
Swap buffers for OpenGL rendering.
Interface to an output framebuffer.
Definition: display_buffer.h:47
Definition: display_buffer.h:36
void make_current() override
Makes the the current GL render target.
geometry::Rectangle view_area() const override
The area the DisplayBuffer occupies in the virtual screen space.
void set_orientation(MirOrientation const new_orientation)
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
Definition: display_buffer.h:35
Definition: render_target.h:29
void release_current() override
Releases the current GL render target.
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...
NativeDisplayBuffer * native_display_buffer() override
Returns a pointer to the native display buffer object backing this display buffer.
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:79
MirOrientation orientation() const override
Returns the orientation of the display buffer relative to how the user should see it (the orientation...
Definition: rectangle.h:33
detail::IntWrapper< struct XTag > X
Definition: dimensions.h:111

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015