aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker2014-03-11 15:22:04 -0500
committerDoug Zongker2014-03-11 16:56:41 -0500
commit5290f2087a314506e2926edd9640cf1feb793866 (patch)
tree0245103a4704afed026ed8dbdd3bab776dea58d2 /minui/graphics.h
parentc91612d4668688c5d7bf76c258c11010697a03d2 (diff)
downloadplatform-bootable-recovery-5290f2087a314506e2926edd9640cf1feb793866.tar.gz
platform-bootable-recovery-5290f2087a314506e2926edd9640cf1feb793866.tar.xz
platform-bootable-recovery-5290f2087a314506e2926edd9640cf1feb793866.zip
separate fbdev-specific code out from minui
Isolate the code that interacts with fbdev, in preparation for adding a new backend. Change-Id: I19105e9da1ca6408cebc110f7e2bb5abfb481ee9
Diffstat (limited to 'minui/graphics.h')
-rw-r--r--minui/graphics.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/minui/graphics.h b/minui/graphics.h
new file mode 100644
index 00000000..94b89a55
--- /dev/null
+++ b/minui/graphics.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2014 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_H_
18#define _GRAPHICS_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <stdbool.h>
25#include "minui.h"
26
27typedef struct minui_backend {
28 // Initializes the backend and returns a gr_surface to draw into.
29 gr_surface (*init)(struct minui_backend*);
30
31 // Causes the current drawing surface (returned by the most recent
32 // call to flip() or init()) to be displayed, and returns a new
33 // drawing surface.
34 gr_surface (*flip)(struct minui_backend*);
35
36 // Blank (or unblank) the screen.
37 void (*blank)(struct minui_backend*, bool);
38
39 // Device cleanup when drawing is done.
40 void (*exit)(struct minui_backend*);
41} minui_backend;
42
43minui_backend* open_fbdev();
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif