Mir
hwc_device.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_DEVICE_H_
20 #define MIR_GRAPHICS_ANDROID_HWC_DEVICE_H_
21 
22 #include "mir_toolkit/common.h"
24 #include "display_device.h"
25 #include "hwc_layerlist.h"
26 #include <memory>
27 #include <vector>
28 
29 namespace mir
30 {
31 namespace graphics
32 {
33 class Buffer;
34 
35 namespace android
36 {
37 class SyncFileOps;
38 class HwcWrapper;
39 class HwcConfiguration;
40 
41 class HwcDevice : public DisplayDevice
42 {
43 public:
44  HwcDevice(std::shared_ptr<HwcWrapper> const& hwc_wrapper);
45 
46  bool compatible_renderlist(RenderableList const& renderlist) override;
47  void commit(std::list<DisplayContents> const& contents) override;
48  void content_cleared() override;
49  std::chrono::milliseconds recommended_sleep() const override;
50 
51 private:
52  bool buffer_is_onscreen(Buffer const&) const;
53  std::vector<std::shared_ptr<Buffer>> onscreen_overlay_buffers;
54 
55  std::shared_ptr<HwcWrapper> const hwc_wrapper;
56  std::shared_ptr<SyncFileOps> const sync_ops;
57  std::chrono::milliseconds recommend_sleep{0};
58 };
59 
60 }
61 }
62 }
63 
64 #endif /* MIR_GRAPHICS_ANDROID_HWC_DEVICE_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: display_device.h:52
void commit(std::list< DisplayContents > const &contents) override
Definition: hwc_device.cpp:85
std::chrono::milliseconds recommended_sleep() const override
Definition: hwc_device.cpp:155
bool compatible_renderlist(RenderableList const &renderlist) override
Definition: hwc_device.cpp:49
void content_cleared() override
Definition: hwc_device.cpp:160
HwcDevice(std::shared_ptr< HwcWrapper > const &hwc_wrapper)
Definition: hwc_device.cpp:67
Definition: hwc_device.h:41
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:79
Definition: buffer.h:46
Definition: android_input_receiver.h:36

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015