19 #ifndef MIR_GRAPHICS_ANDROID_HWC_LAYERLIST_H_
20 #define MIR_GRAPHICS_ANDROID_HWC_LAYERLIST_H_
23 #include <hardware/hwcomposer.h>
26 #include <initializer_list>
39 HWCRect(geometry::Rectangle& rect);
41 operator hwc_rect_t
const& ()
const {
return self; }
42 operator hwc_rect_t& () {
return self; }
47 struct HWCDefaultLayer
49 HWCDefaultLayer(std::initializer_list<HWCRect> list);
52 operator hwc_layer_1
const& ()
const {
return self; }
53 operator hwc_layer_1& () {
return self; }
56 HWCDefaultLayer& operator=(HWCDefaultLayer
const&) =
delete;
57 HWCDefaultLayer(HWCDefaultLayer
const&) =
delete;
62 struct HWCFBLayer :
public HWCDefaultLayer
65 HWCFBLayer(buffer_handle_t native_buf,
66 HWCRect display_frame_rect);
72 virtual ~HWCLayerList() =
default;
74 virtual hwc_display_contents_1_t* native_list()
const = 0;
75 virtual void set_fb_target(std::shared_ptr<Buffer>
const&) = 0;
78 HWCLayerList() =
default;
79 HWCLayerList& operator=(HWCLayerList
const&) =
delete;
80 HWCLayerList(HWCLayerList
const&) =
delete;
84 class LayerList :
public HWCLayerList
89 void set_fb_target(std::shared_ptr<Buffer>
const&);
90 hwc_display_contents_1_t* native_list()
const;
93 std::vector<std::shared_ptr<HWCDefaultLayer>> layer_list;
96 static size_t const fb_position = 0u;
97 std::shared_ptr<hwc_display_contents_1_t> hwc_representation;