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 class GLContext;
33 namespace android
34 {
36 {
37 public:
38  PropertiesWrapper() = default;
39  virtual ~PropertiesWrapper() = default;
40  virtual int property_get(
41  char const* key,
42  char* value,
43  char const* default_value) const = 0;
44 private:
45  PropertiesWrapper(PropertiesWrapper const&) = delete;
46  PropertiesWrapper& operator=(PropertiesWrapper const&) = delete;
47 };
48 
50 {
51 public:
52  int property_get(
53  char const* key,
54  char* value,
55  char const* default_value) const;
56 };
57 
58 struct GPUInfo
59 {
60  std::string const gl_vendor;
61  std::string const gl_renderer;
62 };
64 {
65 public:
66  DeviceQuirks(PropertiesWrapper const& properties);
67  DeviceQuirks(PropertiesWrapper const& properties, mir::options::Option const& options);
68  DeviceQuirks(PropertiesWrapper const& properties, graphics::GLContext const& context);
69 
70  unsigned int num_framebuffers() const;
71  bool gralloc_cannot_be_closed_safely() const;
72  int aligned_width(int width) const;
73  bool clear_fb_context_fence() const;
74  int fb_gralloc_bits() const;
75  bool working_egl_sync() const;
76 
77  static void add_options(boost::program_options::options_description& config);
78 
79 private:
80  DeviceQuirks(DeviceQuirks const&) = delete;
81  DeviceQuirks & operator=(DeviceQuirks const&) = delete;
82  std::string const device_name;
83  GPUInfo const gpu_info;
84 
85  unsigned int const num_framebuffers_;
86  bool const gralloc_cannot_be_closed_safely_;
87  bool const enable_width_alignment_quirk;
88  bool const clear_fb_context_fence_;
89  bool const fb_ion_heap_;
90  bool const working_egl_sync_;
91 };
92 }
93 }
94 }
95 #endif /* MIR_GRAPHICS_ANDROID_DEVICE_QUIRKS_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: device_quirks.h:25
Definition: device_quirks.h:58
Definition: device_quirks.h:63
std::string const gl_renderer
Definition: device_quirks.h:61
unsigned int width
Definition: touchspot_image.c:4
Definition: device_quirks.h:49
Definition: device_quirks.h:35
Definition: android_input_receiver.h:36
Definition: gl_context.h:27
Definition: option.h:33
std::string const gl_vendor
Definition: device_quirks.h:60

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016