Mir
fb_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_FB_DEVICE_H_
20 #define MIR_GRAPHICS_ANDROID_FB_DEVICE_H_
21 
22 #include "display_device.h"
23 #include "hwc_configuration.h"
24 #include <hardware/gralloc.h>
25 #include <hardware/fb.h>
26 
27 namespace mir
28 {
29 namespace graphics
30 {
31 namespace android
32 {
33 
35 {
36 public:
37  FbControl(std::shared_ptr<framebuffer_device_t> const& fbdev);
38  void power_mode(DisplayName, MirPowerMode) override;
41  std::function<void()> const& hotplug_cb,
42  std::function<void(DisplayName)> const& vsync_cb) override;
43 private:
44  std::shared_ptr<framebuffer_device_t> const fb_device;
45 };
46 
47 class FBDevice : public DisplayDevice
48 {
49 public:
50  FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev);
51 
52  bool compatible_renderlist(RenderableList const& renderlist) override;
53  void commit(std::list<DisplayContents> const& contents) override;
54  std::chrono::milliseconds recommended_sleep() const override;
55 
56 private:
57  std::shared_ptr<framebuffer_device_t> const fb_device;
58  void content_cleared() override;
59 };
60 
61 }
62 }
63 }
64 #endif /* MIR_GRAPHICS_ANDROID_FB_DEVICE_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: display_device.h:52
bool compatible_renderlist(RenderableList const &renderlist) override
Definition: fb_device.cpp:113
Definition: fb_device.h:47
std::shared_ptr< void > ConfigChangeSubscription
Definition: hwc_configuration.h:35
Definition: hwc_configuration.h:37
FbControl(std::shared_ptr< framebuffer_device_t > const &fbdev)
Definition: fb_device.cpp:36
DisplayName
Definition: display_name.h:31
Definition: fb_device.h:34
MirPowerMode
Definition: common.h:101
std::chrono::milliseconds recommended_sleep() const override
Definition: fb_device.cpp:122
Configuration information for a display output.
Definition: display_configuration.h:83
void power_mode(DisplayName, MirPowerMode) override
Definition: fb_device.cpp:43
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:79
FBDevice(std::shared_ptr< framebuffer_device_t > const &fbdev)
Definition: fb_device.cpp:89
DisplayConfigurationOutput active_config_for(DisplayName) override
Definition: fb_device.cpp:56
Definition: android_input_receiver.h:36
ConfigChangeSubscription subscribe_to_config_changes(std::function< void()> const &hotplug_cb, std::function< void(DisplayName)> const &vsync_cb) override
Definition: fb_device.cpp:82
void commit(std::list< DisplayContents > const &contents) override
Definition: fb_device.cpp:94

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