Mir
platform.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 #ifndef MIR_GRAPHICS_X_PLATFORM_H_
20 #define MIR_GRAPHICS_X_PLATFORM_H_
21 
22 #include "mir/graphics/platform.h"
23 #include "display_helpers.h"
24 #include "mir/geometry/size.h"
25 
26 #include <X11/Xlib.h>
27 #include <X11/Xutil.h>
28 
29 namespace mir
30 {
31 namespace graphics
32 {
33 namespace X
34 {
35 
37 {
38 public:
39  explicit Platform(std::shared_ptr<::Display> const& conn, mir::geometry::Size const size);
40  ~Platform() = default;
41 
42  /* From Platform */
43  std::shared_ptr<graphics::GraphicBufferAllocator> create_buffer_allocator() override;
44 
45  std::shared_ptr<graphics::Display> create_display(
46  std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
47  std::shared_ptr<GLConfig> const& gl_config) override;
48 
49  std::shared_ptr<PlatformIpcOperations> make_ipc_operations() const override;
50 
51  EGLNativeDisplayType egl_native_display() const override;
52 private:
53  std::shared_ptr<::Display> const x11_connection;
54  std::shared_ptr<mir::udev::Context> udev;
55  std::shared_ptr<mesa::helpers::DRMHelper> const drm;
57  mir::geometry::Size const size;
58 };
59 
60 }
61 }
62 }
63 #endif /* MIR_GRAPHICS_X_PLATFORM_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
Interface to platform specific support for graphics operations.
Definition: platform.h:66
EGLNativeDisplayType egl_native_display() const override
Definition: platform.h:36
std::shared_ptr< PlatformIpcOperations > make_ipc_operations() const override
Creates an object capable of doing platform specific processing of buffers before they are sent or af...
Definition: display_helpers.h:86
std::shared_ptr< graphics::Display > create_display(std::shared_ptr< DisplayConfigurationPolicy > const &initial_conf_policy, std::shared_ptr< GLConfig > const &gl_config) override
Creates the display subsystem.
std::shared_ptr< graphics::GraphicBufferAllocator > create_buffer_allocator() override
Creates the buffer allocator subsystem.
detail::IntWrapper< struct XTag > X
Definition: dimensions.h:111

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