Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
android_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_ANDROID_PLATFORM_H_
20 #define MIR_GRAPHICS_ANDROID_ANDROID_PLATFORM_H_
21 
22 #include "mir/graphics/platform.h"
24 
25 namespace mir
26 {
27 namespace graphics
28 {
29 class DisplayReport;
30 namespace android
31 {
32 class GraphicBufferAllocator;
33 class FramebufferFactory;
34 class DisplayBuilder;
35 
36 class AndroidPlatform : public Platform, public NativePlatform
37 {
38 public:
39  AndroidPlatform(
40  std::shared_ptr<DisplayBuilder> const& display_builder,
41  std::shared_ptr<DisplayReport> const& display_report);
42 
43  /* From Platform */
44  std::shared_ptr<graphics::GraphicBufferAllocator> create_buffer_allocator(
45  std::shared_ptr<BufferInitializer> const& buffer_initializer);
46  std::shared_ptr<Display> create_display(
47  std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,
48  std::shared_ptr<graphics::GLConfig> const& /*gl_config*/);
49  std::shared_ptr<PlatformIPCPackage> get_ipc_package();
50  std::shared_ptr<InternalClient> create_internal_client();
51  void fill_ipc_package(BufferIPCPacker* packer, graphics::Buffer const* buffer) const;
52  EGLNativeDisplayType egl_native_display() const;
53 
54 private:
55  std::shared_ptr<Display> create_fb_backup_display();
56 
57  void initialize(std::shared_ptr<NestedContext> const& nested_context) override;
58 
59  // TODO a design that has this and create_buffer_allocator is missing simplicity
60  virtual std::shared_ptr<GraphicBufferAllocator> create_mga_buffer_allocator(
61  const std::shared_ptr<BufferInitializer>& buffer_initializer);
62 
63  std::shared_ptr<DisplayBuilder> const display_builder;
64  std::shared_ptr<DisplayReport> const display_report;
65 };
66 
67 }
68 }
69 }
70 #endif /* MIR_GRAPHICS_ANDROID_ANDROID_PLATFORM_H_ */
void initialize(std::shared_ptr< mir::logging::Logger > const &logger)
virtual std::shared_ptr< InternalClient > create_internal_client()=0
Creates the in-process client support object.
virtual std::shared_ptr< Display > create_display(std::shared_ptr< DisplayConfigurationPolicy > const &initial_conf_policy, std::shared_ptr< GLConfig > const &gl_config)=0
Creates the display subsystem.
virtual void fill_ipc_package(BufferIPCPacker *packer, Buffer const *buffer) const =0
Fills the IPC package for a buffer.
virtual EGLNativeDisplayType egl_native_display() const =0
virtual std::shared_ptr< PlatformIPCPackage > get_ipc_package()=0
Gets the IPC package for the platform.
virtual std::shared_ptr< GraphicBufferAllocator > create_buffer_allocator(std::shared_ptr< BufferInitializer > const &buffer_initializer)=0
Creates the buffer allocator subsystem.

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