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 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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_
20 #define MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_
21 
23 
25 #include "mir/geometry/size.h"
26 #include "mir/geometry/rectangle.h"
28 
29 #include <EGL/egl.h>
30 
31 namespace mir
32 {
33 namespace graphics
34 {
35 namespace offscreen
36 {
37 
38 namespace detail
39 {
40 
42 {
43 public:
46  void bind() const;
47  void unbind() const;
48 
49 private:
50  geometry::Size const size;
51  int old_fbo;
52  int old_viewport[4];
53  unsigned int color_renderbuffer;
54  unsigned int depth_renderbuffer;
55  unsigned int fbo;
56 };
57 
58 }
59 
63 {
64 public:
66  geometry::Rectangle const& area);
67 
68  geometry::Rectangle view_area() const override;
69  void make_current() override;
70  void release_current() override;
71  void swap_buffers() override;
72 
73  MirOrientation orientation() const override;
74 
75  bool post_renderables_if_optimizable(RenderableList const& renderlist) override;
76 
77  NativeDisplayBuffer* native_display_buffer() override;
78 
79 private:
80  SurfacelessEGLContext const egl_context;
82  geometry::Rectangle const area;
83 };
84 
85 }
86 }
87 }
88 
89 #endif /* MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
bool make_current(mrg::RenderTarget *render_target)
Definition: server_example_adorning_compositor.cpp:39
Interface to an output framebuffer.
Definition: display_buffer.h:47
Definition: surfaceless_egl_context.h:32
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
Definition: display_buffer.h:35
Definition: display_buffer.h:60
Definition: render_target.h:29
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:79
Definition: rectangle.h:33

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