Mir
device_quirks.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * 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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_DEVICE_QUIRKS_H_
20 #define MIR_GRAPHICS_ANDROID_DEVICE_QUIRKS_H_
21 
22 #include <hybris/properties/properties.h>
23 #include <string>
24 
25 namespace boost{ namespace program_options {class options_description;}}
26 
27 namespace mir
28 {
29 namespace options{ class Option; }
30 namespace graphics
31 {
32 namespace android
33 {
35 {
36 public:
37  PropertiesWrapper() = default;
38  virtual ~PropertiesWrapper() = default;
39  virtual int property_get(
40  char const* key,
41  char* value,
42  char const* default_value) const = 0;
43 private:
44  PropertiesWrapper(PropertiesWrapper const&) = delete;
45  PropertiesWrapper& operator=(PropertiesWrapper const&) = delete;
46 };
47 
49 {
50 public:
51  int property_get(
52  char const* key,
53  char* value,
54  char const* default_value) const;
55 };
56 
58 {
59 public:
60  DeviceQuirks(PropertiesWrapper const& properties);
61  DeviceQuirks(PropertiesWrapper const& properties, mir::options::Option const& options);
62 
63  unsigned int num_framebuffers() const;
64  bool gralloc_cannot_be_closed_safely() const;
65  int aligned_width(int width) const;
66  bool clear_fb_context_fence() const;
67  int fb_gralloc_bits() const;
68  bool working_egl_sync() const;
69 
70  static void add_options(boost::program_options::options_description& config);
71 
72 private:
73  DeviceQuirks(DeviceQuirks const&) = delete;
74  DeviceQuirks & operator=(DeviceQuirks const&) = delete;
75  std::string const device_name;
76  unsigned int const num_framebuffers_;
77  bool const gralloc_cannot_be_closed_safely_;
78  bool const enable_width_alignment_quirk;
79  bool const clear_fb_context_fence_;
80  bool const fb_ion_heap_;
81  bool const working_egl_sync_;
82 };
83 }
84 }
85 }
86 #endif /* MIR_GRAPHICS_ANDROID_DEVICE_QUIRKS_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: device_quirks.h:25
Definition: device_quirks.h:57
unsigned int width
Definition: touchspot_image.c:4
Definition: device_quirks.h:48
Definition: device_quirks.h:34
Definition: android_input_receiver.h:36
Definition: option.h:33

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