19 #ifndef MIR_GRAPHICS_ANDROID_HWC_COMMON_DEVICE_H_
20 #define MIR_GRAPHICS_ANDROID_HWC_COMMON_DEVICE_H_
23 #include <hardware/hwcomposer.h>
26 #include <condition_variable>
35 class HWCVsyncCoordinator;
36 class HWCCommonDevice;
40 HWCCommonDevice*
self;
43 class HWCCommonDevice :
public DisplaySupportProvider
46 virtual ~HWCCommonDevice() noexcept;
50 unsigned int number_of_framebuffers_available() const;
55 HWCCommonDevice(std::shared_ptr<hwc_composer_device_1> const& hwc_device,
56 std::shared_ptr<HWCVsyncCoordinator> const& coordinator);
58 std::shared_ptr<hwc_composer_device_1> const hwc_device;
59 std::shared_ptr<HWCVsyncCoordinator> const coordinator;
61 std::unique_lock<std::mutex> lock_unblanked();
64 int turn_screen_on() const noexcept(
true);
65 int turn_screen_off() const noexcept(true);
67 HWCCallbacks callbacks;
69 std::mutex blanked_mutex;
70 std::condition_variable blanked_cond;