Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 /* this is a partitioned list. renderlist makes up the first renderlist.size() elements
50  of the list, and there are additional_layers added to the end.
51  std::distance(begin(), additional_layers_begin()) == renderlist.size()
52  std::distance(additional_layers_begin(), end()) == additional_layers
53  std::distance(begin(), end()) == renderlist.size() + additional_layers
54 */
55 class LayerList
56 {
57 public:
58  LayerList(RenderableList const& renderlist, size_t additional_layers);
59  void update_list(RenderableList const& renderlist, size_t additional_layers);
60 
61  std::list<HwcLayerEntry>::iterator begin();
62  std::list<HwcLayerEntry>::iterator additional_layers_begin();
63  std::list<HwcLayerEntry>::iterator end();
64 
65  std::weak_ptr<hwc_display_contents_1_t> native_list();
67 private:
68  LayerList& operator=(LayerList const&) = delete;
69  LayerList(LayerList const&) = delete;
70 
71  std::list<HwcLayerEntry> layers;
72  std::shared_ptr<hwc_display_contents_1_t> hwc_representation;
73  std::list<HwcLayerEntry>::iterator first_additional_layer;
74 };
75 
76 }
77 }
78 }
79 
80 #endif /* MIR_GRAPHICS_ANDROID_HWC_LAYERLIST_H_ */
std::weak_ptr< hwc_display_contents_1_t > native_list()
Definition: hwc_layerlist.cpp:130
All things Mir.
Definition: aging_buffer.h:24
Definition: hwc_layers.h:50
NativeFence retirement_fence()
Definition: hwc_layerlist.cpp:135
HWCLayer layer
Definition: hwc_layerlist.h:45
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88
std::list< HwcLayerEntry >::iterator end()
Definition: hwc_layerlist.cpp:125
int NativeFence
Definition: fence.h:30
Definition: hwc_layerlist.h:42
Definition: hwc_layerlist.h:55
std::list< HwcLayerEntry >::iterator begin()
Definition: hwc_layerlist.cpp:115
void update_list(RenderableList const &renderlist, size_t additional_layers)
Definition: hwc_layerlist.cpp:60
HwcLayerEntry(HWCLayer &&layer, bool needs_commit)
Definition: hwc_layerlist.cpp:54
Definition: android_input_receiver.h:32
LayerList(RenderableList const &renderlist, size_t additional_layers)
Definition: hwc_layerlist.cpp:140
std::list< HwcLayerEntry >::iterator additional_layers_begin()
Definition: hwc_layerlist.cpp:120
bool needs_commit
Definition: hwc_layerlist.h:46

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