Mir
hwc_layerlist.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 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_HWC_LAYERLIST_H_
20 #define MIR_GRAPHICS_ANDROID_HWC_LAYERLIST_H_
21 
23 #include "mir/geometry/rectangle.h"
24 #include "hwc_layers.h"
25 #include <hardware/hwcomposer.h>
26 #include <memory>
27 #include <vector>
28 #include <initializer_list>
29 #include <list>
30 
31 namespace mir
32 {
33 namespace graphics
34 {
35 
36 class Renderable;
37 class Buffer;
38 
39 namespace android
40 {
41 
43 {
47 };
48 
49 class LayerList
50 {
51 public:
52  LayerList(
53  std::shared_ptr<LayerAdapter> const& layer_adapter,
54  RenderableList const& renderlist);
55  void update_list(RenderableList const& renderlist);
56 
57  std::list<HwcLayerEntry>::iterator begin();
58  std::list<HwcLayerEntry>::iterator end();
59 
61  void setup_fb(std::shared_ptr<Buffer> const& fb_target);
62  bool needs_swapbuffers();
63  void swap_occurred();
64 
65  hwc_display_contents_1_t* native_list();
67 private:
68  LayerList& operator=(LayerList const&) = delete;
69  LayerList(LayerList const&) = delete;
70 
71  RenderableList renderable_list;
72 
73  void update_list_mode(RenderableList const& renderlist);
74 
75  std::shared_ptr<LayerAdapter> const layer_adapter;
76  std::list<HwcLayerEntry> layers;
77  std::shared_ptr<hwc_display_contents_1_t> hwc_representation;
78  enum Mode
79  {
80  no_extra_layers,
81  skip_only,
82  target_only,
83  skip_and_target
84  } mode;
85  size_t additional_layers_for(Mode mode);
86 };
87 
88 }
89 }
90 }
91 
92 #endif /* MIR_GRAPHICS_ANDROID_HWC_LAYERLIST_H_ */
All things Mir.
Definition: buffer_stream.h:37
void swap_occurred()
Definition: hwc_layerlist.cpp:206
LayerList(std::shared_ptr< LayerAdapter > const &layer_adapter, RenderableList const &renderlist)
Definition: hwc_layerlist.cpp:156
void setup_fb(std::shared_ptr< Buffer > const &fb_target)
Definition: hwc_layerlist.cpp:185
Definition: hwc_layers.h:82
NativeFence retirement_fence()
Definition: hwc_layerlist.cpp:150
hwc_display_contents_1_t * native_list()
Definition: hwc_layerlist.cpp:145
HWCLayer layer
Definition: hwc_layerlist.h:45
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:80
std::list< HwcLayerEntry >::iterator end()
Definition: hwc_layerlist.cpp:140
int NativeFence
Definition: fence.h:30
Definition: hwc_layerlist.h:42
bool needs_swapbuffers()
Definition: hwc_layerlist.cpp:164
Definition: hwc_layerlist.h:49
void update_list(RenderableList const &renderlist)
Definition: hwc_layerlist.cpp:87
std::list< HwcLayerEntry >::iterator begin()
Definition: hwc_layerlist.cpp:135
HwcLayerEntry(HWCLayer &&layer, bool needs_commit)
Definition: hwc_layerlist.cpp:54
RenderableList rejected_renderables()
Definition: hwc_layerlist.cpp:172
Definition: android_input_receiver.h:32
bool needs_commit
Definition: hwc_layerlist.h:46

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015