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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_GRAPHICS_NESTED_DETAIL_NESTED_OUTPUT_H_
20 #define MIR_GRAPHICS_NESTED_DETAIL_NESTED_OUTPUT_H_
21 
24 #include "display.h"
25 #include "host_surface.h"
26 
27 #include <EGL/egl.h>
28 
29 namespace mir
30 {
31 namespace input
32 {
33 class CursorListener;
34 }
35 namespace graphics
36 {
37 namespace nested
38 {
39 class HostSurface;
40 
41 namespace detail
42 {
43 
47 {
48 public:
50  EGLDisplayHandle const& egl_display,
51  std::shared_ptr<HostSurface> const& host_surface,
52  geometry::Rectangle const& area,
53  std::shared_ptr<input::InputDispatcher> const& input_dispatcher,
54  std::shared_ptr<input::CursorListener> const& cursor,
55  MirPixelFormat preferred_format);
56 
57  ~DisplayBuffer() noexcept;
58 
59  geometry::Rectangle view_area() const override;
60  void make_current() override;
61  void release_current() override;
62  void swap_buffers() override;
63  MirOrientation orientation() const override;
64 
65  bool post_renderables_if_optimizable(RenderableList const& renderlist) override;
66 
67  NativeDisplayBuffer* native_display_buffer() override;
68 
69  DisplayBuffer(DisplayBuffer const&) = delete;
70  DisplayBuffer operator=(DisplayBuffer const&) = delete;
71 private:
72  EGLDisplayHandle const& egl_display;
73  std::shared_ptr<HostSurface> const host_surface;
74  EGLConfig const egl_config;
75  EGLContextStore const egl_context;
76  geometry::Rectangle const area;
77  std::shared_ptr<input::InputDispatcher> const dispatcher;
78  std::shared_ptr<input::CursorListener> const cursor_listener;
79  EGLSurfaceHandle const egl_surface;
80 
81  static void event_thunk(MirSurface* surface, MirEvent const* event, void* context);
82  void mir_event(MirEvent const& event);
83 };
84 }
85 }
86 }
87 }
88 
89 #endif /* MIR_GRAPHICS_NESTED_DETAIL_NESTED_OUTPUT_H_ */
All things Mir.
Definition: atomic_callback.h:25
bool make_current(mrg::RenderTarget *render_target)
Definition: server_example_adorning_compositor.cpp:39
Definition: mir_surface.h:146
Interface to an output framebuffer.
Definition: display_buffer.h:47
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
Definition: display_buffer.h:35
Definition: egl_resources.h:29
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
Definition: display_buffer.h:44
Definition: render_target.h:29
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:79
Definition: rectangle.h:33
Definition: event_private.h:181

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