Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
nested_output.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 
22 #include "nested_display.h"
23 
24 namespace mir
25 {
26 namespace graphics
27 {
28 namespace nested
29 {
30 class HostSurface;
31 
32 namespace detail
33 {
34 
36 {
37 public:
39  EGLDisplayHandle const& egl_display,
40  std::shared_ptr<HostSurface> const& host_surface,
41  geometry::Rectangle const& area,
42  std::shared_ptr<input::InputDispatcher> const& input_dispatcher,
43  MirPixelFormat preferred_format);
44 
45  ~NestedOutput() noexcept;
46 
47  geometry::Rectangle view_area() const override;
48  void make_current() override;
49  void release_current() override;
50  void post_update() override;
51  MirOrientation orientation() const override;
52  bool uses_alpha() const override;
53 
54  bool post_renderables_if_optimizable(RenderableList const& renderlist);
55 
56  NestedOutput(NestedOutput const&) = delete;
57  NestedOutput operator=(NestedOutput const&) = delete;
58 private:
59  bool const uses_alpha_;
60  EGLDisplayHandle const& egl_display;
61  std::shared_ptr<HostSurface> const host_surface;
62  EGLConfig const egl_config;
63  EGLContextStore const egl_context;
64  geometry::Rectangle const area;
65  std::shared_ptr<input::InputDispatcher> const dispatcher;
66  EGLSurfaceHandle const egl_surface;
67 
68  static void event_thunk(MirSurface* surface, MirEvent const* event, void* context);
69  void mir_event(MirEvent const& event);
70 };
71 }
72 }
73 }
74 }
75 
76 #endif /* MIR_GRAPHICS_NESTED_DETAIL_NESTED_OUTPUT_H_ */
All things Mir.
Definition: aging_buffer.h:24
Definition: mir_surface.h:56
Interface to an output framebuffer.
Definition: display_buffer.h:38
~NestedOutput() noexcept
Definition: nested_output.cpp:90
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:134
MirOrientation orientation() const override
Returns the orientation of the display buffer relative to how the user should see it (the orientation...
Definition: nested_output.cpp:76
bool post_renderables_if_optimizable(RenderableList const &renderlist)
This will render renderlist to the screen and post the result to the screen if there is a hardware op...
Definition: nested_output.cpp:71
void make_current() override
Makes the DisplayBuffer the current GL rendering target.
Definition: nested_output.cpp:55
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88
void release_current() override
Releases the current GL rendering target.
Definition: nested_output.cpp:61
bool uses_alpha() const override
Returns true if the display buffer has an alpha channel and the alpha channel will be read from at so...
Definition: nested_output.cpp:85
Definition: egl_resources.h:29
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:119
void post_update() override
This will trigger OpenGL rendering and post the result to the screen.
Definition: nested_output.cpp:66
geometry::Rectangle view_area() const override
The area the DisplayBuffer occupies in the virtual screen space.
Definition: nested_output.cpp:50
Definition: rectangle.h:33
Definition: event.h:227
NestedOutput operator=(NestedOutput const &)=delete
NestedOutput(EGLDisplayHandle const &egl_display, std::shared_ptr< HostSurface > const &host_surface, geometry::Rectangle const &area, std::shared_ptr< input::InputDispatcher > const &input_dispatcher, MirPixelFormat preferred_format)
Definition: nested_output.cpp:31
Definition: nested_output.h:35

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014