blob: 107e1956730af2b7c183313219bf346faf7c7de3 [file] [log] [blame]
Tao Bao557fa1f2017-02-07 12:51:00 -08001/*
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
25class 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_