Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
real_hwc_wrapper.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 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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_REAL_HWC_WRAPPER_H_
20 #define MIR_GRAPHICS_ANDROID_REAL_HWC_WRAPPER_H_
21 
22 #include "hwc_wrapper.h"
23 #include <memory>
24 #include <hardware/hwcomposer.h>
25 
26 namespace mir
27 {
28 namespace graphics
29 {
30 namespace android
31 {
32 class HwcLogger;
33 class RealHwcWrapper : public HwcWrapper
34 {
35 public:
37  std::shared_ptr<hwc_composer_device_1> const& hwc_device,
38  std::shared_ptr<HwcLogger> const& logger);
39 
40  void prepare(hwc_display_contents_1_t&) const override;
41  void set(hwc_display_contents_1_t&) const override;
42  void register_hooks(std::shared_ptr<HWCCallbacks> const& callbacks) override;
43  void vsync_signal_on() const override;
44  void vsync_signal_off() const override;
45  void display_on() const override;
46  void display_off() const override;
47 private:
48  static size_t const num_displays{3}; //primary, external, virtual
49  //note: the callbacks have to extend past the lifetime of the hwc_composer_device_1 for some
50  // devices (LP: 1364637)
51  std::shared_ptr<HWCCallbacks> registered_callbacks;
52  std::shared_ptr<hwc_composer_device_1> const hwc_device;
53  std::shared_ptr<HwcLogger> const logger;
54 };
55 
56 }
57 }
58 }
59 #endif /* MIR_GRAPHICS_ANDROID_REAL_HWC_WRAPPER_H_ */
void display_off() const override
Definition: real_hwc_wrapper.cpp:104
All things Mir.
Definition: aging_buffer.h:24
void display_on() const override
Definition: real_hwc_wrapper.cpp:93
void prepare(hwc_display_contents_1_t &) const override
Definition: real_hwc_wrapper.cpp:36
RealHwcWrapper(std::shared_ptr< hwc_composer_device_1 > const &hwc_device, std::shared_ptr< HwcLogger > const &logger)
Definition: real_hwc_wrapper.cpp:28
void register_hooks(std::shared_ptr< HWCCallbacks > const &callbacks) override
Definition: real_hwc_wrapper.cpp:65
void set(hwc_display_contents_1_t &) const override
Definition: real_hwc_wrapper.cpp:52
Definition: hwc_wrapper.h:32
Definition: real_hwc_wrapper.h:33
Definition: android_input_receiver.h:32
void vsync_signal_on() const override
Definition: real_hwc_wrapper.cpp:71
void vsync_signal_off() const override
Definition: real_hwc_wrapper.cpp:82

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014