Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
native_platform.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 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:
17  * Eleni Maria Stea <elenimaria.stea@canonical.com>
18  * Alan Griffiths <alan@octopull.co.uk>
19  */
20 
21 #ifndef MIR_GRAPHICS_MESA_NATIVE_PLATFORM_H_
22 #define MIR_GRAPHICS_MESA_NATIVE_PLATFORM_H_
23 
25 #include "display_helpers.h"
26 
27 namespace mir
28 {
29 namespace graphics
30 {
31 namespace mesa
32 {
33 class InternalNativeDisplay;
34 
36 {
37 public:
38  virtual ~NativePlatform();
39 
40  void initialize(std::shared_ptr<NestedContext> const& nested_context);
41  std::shared_ptr<GraphicBufferAllocator> create_buffer_allocator(
42  std::shared_ptr<BufferInitializer> const& buffer_initializer) override;
43  std::shared_ptr<PlatformIPCPackage> connection_ipc_package() override;
44  std::shared_ptr<InternalClient> create_internal_client() override;
46  BufferIpcMessage* packer, Buffer const* buffer, BufferIpcMsgType msg_type) const override;
47  std::shared_ptr<graphics::BufferWriter> make_buffer_writer() override;
48 
49  static std::shared_ptr<InternalNativeDisplay> internal_native_display();
50  static bool internal_native_display_in_use();
51 
52 private:
53  int drm_fd;
54  std::shared_ptr<NestedContext> nested_context;
56 
57  static std::shared_ptr<InternalNativeDisplay> ensure_internal_native_display(std::shared_ptr<PlatformIPCPackage> const& package);
58  static void finish_internal_native_display();
59 };
60 }
61 }
62 }
63 
64 #endif // MIR_GRAPHICS_MESA_NATIVE_PLATFORM_H_
All things Mir.
Definition: aging_buffer.h:24
static bool internal_native_display_in_use()
Definition: native_platform.cpp:134
std::shared_ptr< graphics::BufferWriter > make_buffer_writer() override
Definition: native_platform.cpp:161
BufferIpcMsgType
Definition: platform_ipc_operations.h:28
Definition: buffer_ipc_message.h:32
Definition: native_platform.h:44
std::shared_ptr< InternalClient > create_internal_client() override
Definition: native_platform.cpp:95
void fill_buffer_package(BufferIpcMessage *packer, Buffer const *buffer, BufferIpcMsgType msg_type) const override
Definition: native_platform.cpp:102
Definition: native_platform.h:35
Definition: display_helpers.h:78
void initialize(std::shared_ptr< NestedContext > const &nested_context)
Definition: native_platform.cpp:41
std::shared_ptr< GraphicBufferAllocator > create_buffer_allocator(std::shared_ptr< BufferInitializer > const &buffer_initializer) override
std::shared_ptr< PlatformIPCPackage > connection_ipc_package() override
Definition: native_platform.cpp:63
virtual ~NativePlatform()
Definition: native_platform.cpp:51
Definition: buffer.h:34
static std::shared_ptr< InternalNativeDisplay > internal_native_display()
Definition: native_platform.cpp:140

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