Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
platform.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_PLATFORM_H_
20 #define MIR_GRAPHICS_ANDROID_PLATFORM_H_
21 
22 #include "mir/graphics/platform.h"
24 #include "device_quirks.h"
25 
26 namespace mir
27 {
28 namespace graphics
29 {
30 class DisplayReport;
31 namespace android
32 {
33 class GraphicBufferAllocator;
34 class FramebufferFactory;
35 class DisplayBuilder;
36 
38 {
39 public:
40  Platform(
41  std::shared_ptr<DisplayBuilder> const& display_builder,
42  std::shared_ptr<DisplayReport> const& display_report);
43 
44  /* From Platform */
45  std::shared_ptr<graphics::GraphicBufferAllocator> create_buffer_allocator(
46  std::shared_ptr<BufferInitializer> const& buffer_initializer);
47  std::shared_ptr<Display> create_display(
48  std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,
49  std::shared_ptr<graphics::GLProgramFactory> const&,
50  std::shared_ptr<graphics::GLConfig> const& /*gl_config*/);
51  std::shared_ptr<PlatformIpcOperations> make_ipc_operations() const override;
52 
53  std::shared_ptr<PlatformIPCPackage> connection_ipc_package();
54  std::shared_ptr<InternalClient> create_internal_client();
55  std::shared_ptr<graphics::BufferWriter> make_buffer_writer() override;
57  BufferIpcMessage* packer, graphics::Buffer const* buffer, BufferIpcMsgType msg_type) const;
58  EGLNativeDisplayType egl_native_display() const;
59 
60 private:
61  std::shared_ptr<Display> create_fb_backup_display();
62 
63  void initialize(std::shared_ptr<NestedContext> const& nested_context) override;
64 
65  std::shared_ptr<GraphicBufferAllocator> create_mga_buffer_allocator(
66  std::shared_ptr<BufferInitializer> const& buffer_initializer);
67 
68  std::shared_ptr<DisplayBuilder> const display_builder;
69  std::shared_ptr<DisplayReport> const display_report;
70  std::shared_ptr<PlatformIpcOperations> const ipc_operations;
71  DeviceQuirks quirks{PropertiesOps{}};
72 };
73 
74 }
75 }
76 }
77 #endif /* MIR_GRAPHICS_ANDROID_PLATFORM_H_ */
All things Mir.
Definition: aging_buffer.h:24
BufferIpcMsgType
Definition: platform_ipc_operations.h:28
Definition: buffer_ipc_message.h:32
Definition: platform.h:37
Definition: native_platform.h:44
Interface to platform specific support for graphics operations.
Definition: platform.h:67
std::shared_ptr< graphics::BufferWriter > make_buffer_writer() override
Definition: platform.cpp:157
Definition: device_quirks.h:54
EGLNativeDisplayType egl_native_display() const
Definition: platform.cpp:143
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: platform.cpp:132
std::shared_ptr< Display > create_display(std::shared_ptr< graphics::DisplayConfigurationPolicy > const &, std::shared_ptr< graphics::GLProgramFactory > const &, std::shared_ptr< graphics::GLConfig > const &)
std::shared_ptr< InternalClient > create_internal_client()
Definition: platform.cpp:152
Definition: device_quirks.h:45
std::shared_ptr< PlatformIPCPackage > connection_ipc_package()
Definition: platform.cpp:118
std::shared_ptr< graphics::GraphicBufferAllocator > create_buffer_allocator(std::shared_ptr< BufferInitializer > const &buffer_initializer)
void fill_buffer_package(BufferIpcMessage *packer, graphics::Buffer const *buffer, BufferIpcMsgType msg_type) const
Definition: platform.cpp:137
Definition: android_input_receiver.h:32
Definition: buffer.h:34

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