Mir
hal_component_factory.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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_HAL_COMPONENT_FACTORY_H_
20 #define MIR_GRAPHICS_ANDROID_HAL_COMPONENT_FACTORY_H_
21 
22 #include "cmdstream_sync_factory.h"
25 
26 namespace mir
27 {
28 namespace graphics
29 {
30 class DisplayReport;
31 namespace android
32 {
33 class FramebufferBundle;
34 class DisplayResourceFactory;
35 class DisplayDevice;
36 class HwcWrapper;
37 class HwcReport;
38 class DeviceQuirks;
39 class CommandStreamSyncFactory;
40 class GraphicBufferAllocator;
41 
42 
43 //NOTE: this should be the only class that inspects the HWC version and assembles
44 //the components accordingly
46 {
47 public:
49  std::shared_ptr<DisplayResourceFactory> const& res_factory,
50  std::shared_ptr<HwcReport> const& hwc_report,
51  std::shared_ptr<DeviceQuirks> const& quirks);
52 
53  std::unique_ptr<CommandStreamSync> create_command_stream_sync() override;
54  std::unique_ptr<FramebufferBundle> create_framebuffers(DisplayConfigurationOutput const&) override;
55  std::unique_ptr<DisplayDevice> create_display_device() override;
56  std::unique_ptr<HwcConfiguration> create_hwc_configuration() override;
57  std::unique_ptr<LayerList> create_layer_list() override;
58  std::shared_ptr<graphics::GraphicBufferAllocator> the_buffer_allocator() override;
59 
60 private:
61  std::unique_ptr<CommandStreamSyncFactory> create_command_stream_sync_factory();
62 
63  std::shared_ptr<DisplayResourceFactory> const res_factory;
64  std::shared_ptr<HwcReport> const hwc_report;
65 
66  std::shared_ptr<FramebufferBundle> framebuffers;
67  bool force_backup_display;
68  size_t num_framebuffers;
69  bool working_egl_sync;
70 
71  std::shared_ptr<HwcWrapper> hwc_wrapper;
72  std::shared_ptr<framebuffer_device_t> fb_native;
73  HwcVersion hwc_version;
74 
75  std::shared_ptr<GraphicBufferAllocator> buffer_allocator;
76  std::shared_ptr<CommandStreamSyncFactory> command_stream_sync_factory;
77 };
78 
79 }
80 }
81 }
82 
83 #endif /* MIR_GRAPHICS_ANDROID_HAL_COMPONENT_FACTORY_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: hal_component_factory.h:45
std::unique_ptr< LayerList > create_layer_list() override
Definition: hal_component_factory.cpp:103
Definition: display_component_factory.h:39
std::unique_ptr< FramebufferBundle > create_framebuffers(DisplayConfigurationOutput const &) override
Definition: hal_component_factory.cpp:94
Definition: cmdstream_sync_factory.h:30
HalComponentFactory(std::shared_ptr< DisplayResourceFactory > const &res_factory, std::shared_ptr< HwcReport > const &hwc_report, std::shared_ptr< DeviceQuirks > const &quirks)
Definition: hal_component_factory.cpp:42
std::unique_ptr< DisplayDevice > create_display_device() override
Definition: hal_component_factory.cpp:128
Configuration information for a display output.
Definition: display_configuration.h:84
std::shared_ptr< graphics::GraphicBufferAllocator > the_buffer_allocator() override
Definition: hal_component_factory.cpp:168
std::unique_ptr< CommandStreamSync > create_command_stream_sync() override
Definition: hal_component_factory.cpp:74
Definition: android_input_receiver.h:36
HwcVersion
Definition: display_resource_factory.h:42
std::unique_ptr< HwcConfiguration > create_hwc_configuration() override
Definition: hal_component_factory.cpp:158

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016