Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 
42 /* this is a partitioned list. renderlist makes up the first renderlist.size() elements
43  of the list, and there are additional_layers added to the end.
44  std::distance(begin(), additional_layers_begin()) == renderlist.size()
45  std::distance(additional_layers_begin(), end()) == additional_layers
46  std::distance(begin(), end()) == renderlist.size() + additional_layers
47 */
48 class LayerList
49 {
50 public:
51  LayerList(RenderableList const& renderlist, size_t additional_layers);
52  bool update_list_and_check_if_changed(
53  RenderableList const& renderlist,
54  size_t additional_layers);
55 
56  std::list<HWCLayer>::iterator begin();
57  std::list<HWCLayer>::iterator additional_layers_begin();
58  std::list<HWCLayer>::iterator end();
59 
60  std::weak_ptr<hwc_display_contents_1_t> native_list();
61  NativeFence retirement_fence();
62 private:
63  LayerList& operator=(LayerList const&) = delete;
64  LayerList(LayerList const&) = delete;
65 
66  std::list<HWCLayer> layers;
67  std::shared_ptr<hwc_display_contents_1_t> hwc_representation;
68  std::list<HWCLayer>::iterator first_additional_layer;
69 };
70 
71 }
72 }
73 }
74 
75 #endif /* MIR_GRAPHICS_ANDROID_HWC_LAYERLIST_H_ */
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014