diff options
author | Tao Bao <tbao@google.com> | 2017-02-13 19:29:46 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-02-13 19:29:46 +0100 |
commit | 6585a3c368149b5e3805f82d13ffdda18483be36 (patch) | |
tree | eb142b80610f473197e284f372784c25f04a4f3b /minui/graphics.h | |
parent | Merge "minui: Save errno before calling close()." (diff) | |
parent | Merge "minui: Move graphics_{adf,drm,fbdev} into classes." (diff) | |
download | android_bootable_recovery-6585a3c368149b5e3805f82d13ffdda18483be36.tar android_bootable_recovery-6585a3c368149b5e3805f82d13ffdda18483be36.tar.gz android_bootable_recovery-6585a3c368149b5e3805f82d13ffdda18483be36.tar.bz2 android_bootable_recovery-6585a3c368149b5e3805f82d13ffdda18483be36.tar.lz android_bootable_recovery-6585a3c368149b5e3805f82d13ffdda18483be36.tar.xz android_bootable_recovery-6585a3c368149b5e3805f82d13ffdda18483be36.tar.zst android_bootable_recovery-6585a3c368149b5e3805f82d13ffdda18483be36.zip |
Diffstat (limited to 'minui/graphics.h')
-rw-r--r-- | minui/graphics.h | 29 |
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_ |