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 
24 
25 namespace mir
26 {
27 namespace graphics
28 {
29 class DisplayReport;
30 namespace android
31 {
32 class FramebufferBundle;
33 class DisplayResourceFactory;
34 class GraphicBufferAllocator;
35 class DisplayDevice;
36 class HwcWrapper;
37 class HwcReport;
38 class DeviceQuirks;
39 
40 //NOTE: this should be the only class that inspects the HWC version and assembles
41 //the components accordingly
43 {
44 public:
46  std::shared_ptr<GraphicBufferAllocator> const& buffer_allocator,
47  std::shared_ptr<DisplayResourceFactory> const& res_factory,
48  std::shared_ptr<HwcReport> const& hwc_report,
49  std::shared_ptr<DeviceQuirks> const& quirks);
50 
51  std::unique_ptr<FramebufferBundle> create_framebuffers(DisplayConfigurationOutput const&) override;
52  std::unique_ptr<DisplayDevice> create_display_device() override;
53  std::unique_ptr<HwcConfiguration> create_hwc_configuration() override;
54  std::unique_ptr<LayerList> create_layer_list() override;
55 
56 private:
57  std::shared_ptr<GraphicBufferAllocator> const buffer_allocator;
58  std::shared_ptr<DisplayResourceFactory> const res_factory;
59  std::shared_ptr<HwcReport> const hwc_report;
60 
61  std::shared_ptr<FramebufferBundle> framebuffers;
62  bool force_backup_display;
63  size_t num_framebuffers;
64 
65  std::shared_ptr<HwcWrapper> hwc_wrapper;
66  std::shared_ptr<framebuffer_device_t> fb_native;
67  HwcVersion hwc_version;
68 };
69 
70 }
71 }
72 }
73 
74 #endif /* MIR_GRAPHICS_ANDROID_HAL_COMPONENT_FACTORY_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: hal_component_factory.h:42
std::unique_ptr< LayerList > create_layer_list() override
Definition: hal_component_factory.cpp:77
Definition: display_component_factory.h:36
std::unique_ptr< FramebufferBundle > create_framebuffers(DisplayConfigurationOutput const &) override
Definition: hal_component_factory.cpp:68
HalComponentFactory(std::shared_ptr< GraphicBufferAllocator > const &buffer_allocator, 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:40
std::unique_ptr< DisplayDevice > create_display_device() override
Definition: hal_component_factory.cpp:102
Configuration information for a display output.
Definition: display_configuration.h:83
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:132

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015