Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
hwc_layers.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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_LAYERS_H_
20 #define MIR_GRAPHICS_ANDROID_HWC_LAYERS_H_
21 
24 #include "mir/geometry/rectangle.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 class NativeBuffer;
39 
40 namespace android
41 {
43 {
48 };
49 
50 class HWCLayer
51 {
52 public:
53  HWCLayer(
54  std::shared_ptr<hwc_display_contents_1_t> list,
55  size_t layer_index);
56  HWCLayer(
57  LayerType,
58  geometry::Rectangle const& screen_position,
59  bool alpha_enabled,
60  Buffer const& buffer,
61  std::shared_ptr<hwc_display_contents_1_t> list, size_t layer_index);
62 
63  HWCLayer& operator=(HWCLayer && layer);
64  HWCLayer(HWCLayer && layer);
65 
66  HWCLayer& operator=(HWCLayer const& layer) = delete;
67  HWCLayer(HWCLayer const& layer) = delete;
68 
69  bool setup_layer(
70  LayerType type,
71  geometry::Rectangle const& position,
72  bool alpha_enabled,
73  Buffer const& buffer);
74  bool needs_gl_render() const;
75  void set_acquirefence_from(Buffer const& buffer);
76  void update_from_releasefence(Buffer const& buffer);
77 private:
78  hwc_layer_1_t* hwc_layer;
79  std::shared_ptr<hwc_display_contents_1_t> hwc_list;
80  hwc_rect_t visible_rect;
81 };
82 }
83 }
84 }
85 
86 #endif /* MIR_GRAPHICS_ANDROID_HWC_LAYERS_H_ */
All things Mir.
Definition: aging_buffer.h:24
struct MirBufferPackage NativeBuffer
Definition: native_buffer.h:35
Definition: hwc_layers.h:45
LayerType
Definition: hwc_layers.h:42
Definition: hwc_layers.h:50
HWCLayer(std::shared_ptr< hwc_display_contents_1_t > list, size_t layer_index)
Definition: hwc_layers.cpp:56
bool needs_gl_render() const
Definition: hwc_layers.cpp:86
bool setup_layer(LayerType type, geometry::Rectangle const &position, bool alpha_enabled, Buffer const &buffer)
Definition: hwc_layers.cpp:102
Definition: hwc_layers.h:47
Definition: hwc_layers.h:44
HWCLayer & operator=(HWCLayer &&layer)
Definition: hwc_layers.cpp:41
void set_acquirefence_from(Buffer const &buffer)
Definition: hwc_layers.cpp:162
Definition: rectangle.h:33
Definition: buffer.h:43
Definition: android_input_receiver.h:32
void update_from_releasefence(Buffer const &buffer)
Definition: hwc_layers.cpp:91

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