Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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> get_ipc_package() override;
44  std::shared_ptr<InternalClient> create_internal_client() override;
45  void fill_ipc_package(BufferIPCPacker* packer, Buffer const* buffer) const override;
46 
47  static std::shared_ptr<InternalNativeDisplay> internal_native_display();
48  static bool internal_native_display_in_use();
49 
50 private:
51  int drm_fd;
52  std::shared_ptr<NestedContext> nested_context;
54 
55  static std::shared_ptr<InternalNativeDisplay> ensure_internal_native_display(std::shared_ptr<PlatformIPCPackage> const& package);
56  static void finish_internal_native_display();
57 };
58 }
59 }
60 }
61 
62 #endif // MIR_GRAPHICS_MESA_NATIVE_PLATFORM_H_
void fill_ipc_package(BufferIPCPacker *packer, Buffer const *buffer) const override
Definition: native_platform.cpp:99
static bool internal_native_display_in_use()
Definition: native_platform.cpp:127
Definition: native_platform.h:41
std::shared_ptr< InternalClient > create_internal_client() override
Definition: native_platform.cpp:93
Definition: native_platform.h:35
Definition: display_helpers.h:78
std::shared_ptr< PlatformIPCPackage > get_ipc_package() override
Definition: native_platform.cpp:61
void initialize(std::shared_ptr< NestedContext > const &nested_context)
Definition: native_platform.cpp:40
std::shared_ptr< GraphicBufferAllocator > create_buffer_allocator(std::shared_ptr< BufferInitializer > const &buffer_initializer) override
virtual ~NativePlatform()
Definition: native_platform.cpp:50
Definition: buffer_ipc_packer.h:30
Definition: buffer.h:34
static std::shared_ptr< InternalNativeDisplay > internal_native_display()
Definition: native_platform.cpp:133

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014