summaryrefslogtreecommitdiffstats
path: root/minui/graphics.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-02-13 19:36:46 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-02-13 19:36:46 +0100
commit1cb8964aac8e54137328b1e5b6a0b062d2b98b2a (patch)
tree9842f950b9bd3a8100fccaec5b3a2bce10350e06 /minui/graphics.h
parentMerge "minui: Save errno before calling close()." am: df464dbe79 am: 8075089ca1 (diff)
parentMerge "minui: Move graphics_{adf,drm,fbdev} into classes." am: 0d14cc279c (diff)
downloadandroid_bootable_recovery-1cb8964aac8e54137328b1e5b6a0b062d2b98b2a.tar
android_bootable_recovery-1cb8964aac8e54137328b1e5b6a0b062d2b98b2a.tar.gz
android_bootable_recovery-1cb8964aac8e54137328b1e5b6a0b062d2b98b2a.tar.bz2
android_bootable_recovery-1cb8964aac8e54137328b1e5b6a0b062d2b98b2a.tar.lz
android_bootable_recovery-1cb8964aac8e54137328b1e5b6a0b062d2b98b2a.tar.xz
android_bootable_recovery-1cb8964aac8e54137328b1e5b6a0b062d2b98b2a.tar.zst
android_bootable_recovery-1cb8964aac8e54137328b1e5b6a0b062d2b98b2a.zip
Diffstat (limited to '')
-rw-r--r--minui/graphics.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/minui/graphics.h b/minui/graphics.h
index 1eaafc75a..3c45a406b 100644
--- a/minui/graphics.h
+++ b/minui/graphics.h
@@ -19,25 +19,20 @@
#include "minui/minui.h"
-// TODO: lose the function pointers.
-struct minui_backend {
- // Initializes the backend and returns a GRSurface* to draw into.
- GRSurface* (*init)(minui_backend*);
+class MinuiBackend {
+ public:
+ // Initializes the backend and returns a GRSurface* to draw into.
+ virtual GRSurface* Init() = 0;
- // Causes the current drawing surface (returned by the most recent
- // call to flip() or init()) to be displayed, and returns a new
- // drawing surface.
- GRSurface* (*flip)(minui_backend*);
+ // Causes the current drawing surface (returned by the most recent call to Flip() or Init()) to
+ // be displayed, and returns a new drawing surface.
+ virtual GRSurface* Flip() = 0;
- // Blank (or unblank) the screen.
- void (*blank)(minui_backend*, bool);
+ // Blank (or unblank) the screen.
+ virtual void Blank(bool) = 0;
- // Device cleanup when drawing is done.
- void (*exit)(minui_backend*);
+ // Device cleanup when drawing is done.
+ virtual ~MinuiBackend() {};
};
-minui_backend* open_fbdev();
-minui_backend* open_adf();
-minui_backend* open_drm();
-
-#endif
+#endif // _GRAPHICS_H_