diff options
author | Tao Bao | 2017-02-07 14:51:00 -0600 |
---|---|---|
committer | Tao Bao | 2017-02-10 19:05:15 -0600 |
commit | 557fa1f45e413777a31b1bb2db4eee826c3ee486 (patch) | |
tree | eb142b80610f473197e284f372784c25f04a4f3b /minui/graphics_fbdev.h | |
parent | df464dbe79202b62f8b2cf73f45e52d9f32e5e5e (diff) | |
download | platform-bootable-recovery-557fa1f45e413777a31b1bb2db4eee826c3ee486.tar.gz platform-bootable-recovery-557fa1f45e413777a31b1bb2db4eee826c3ee486.tar.xz platform-bootable-recovery-557fa1f45e413777a31b1bb2db4eee826c3ee486.zip |
minui: Move graphics_{adf,drm,fbdev} into classes.
This CL defines minui_backend as an interface, and expresses the three
backends (adf, drm and fbdev) as subclasses to the interface.
Test: 'Run graphics test' on N9, Pixel C and N5X.
Change-Id: I0e23951c7b2e2ff918957a8d9fc8b0085b6e5952
Diffstat (limited to 'minui/graphics_fbdev.h')
-rw-r--r-- | minui/graphics_fbdev.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/minui/graphics_fbdev.h b/minui/graphics_fbdev.h new file mode 100644 index 00000000..107e1956 --- /dev/null +++ b/minui/graphics_fbdev.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #ifndef _GRAPHICS_FBDEV_H_ | ||
18 | #define _GRAPHICS_FBDEV_H_ | ||
19 | |||
20 | #include <linux/fb.h> | ||
21 | |||
22 | #include "graphics.h" | ||
23 | #include "minui/minui.h" | ||
24 | |||
25 | class MinuiBackendFbdev : public MinuiBackend { | ||
26 | public: | ||
27 | GRSurface* Init() override; | ||
28 | GRSurface* Flip() override; | ||
29 | void Blank(bool) override; | ||
30 | ~MinuiBackendFbdev() override; | ||
31 | MinuiBackendFbdev(); | ||
32 | |||
33 | private: | ||
34 | void SetDisplayedFramebuffer(unsigned n); | ||
35 | |||
36 | GRSurface gr_framebuffer[2]; | ||
37 | bool double_buffered; | ||
38 | GRSurface* gr_draw; | ||
39 | int displayed_buffer; | ||
40 | fb_var_screeninfo vi; | ||
41 | int fb_fd; | ||
42 | }; | ||
43 | |||
44 | #endif // _GRAPHICS_FBDEV_H_ | ||