Update minuitwrp graphics in line with latest minui

Note: events.cpp is still old code renamed to cpp to make it
easier to call functions like gr_fb_width().

I had to modify AOSP fbdev code to provide a separate memory
surface for drawing to as drawing directly to the framebuffer
resulted in rendering taking about 5 times longer.

I also modified AOSP adf code to provide a separate memory surface
for drawing for the same performance reasons. The Nexus 9 supports
adf graphics.

Overlay graphics work on at least one device. Overlay provides a
separate memory buffer already so performance is good.

I do not have a drm device yet that I know of. I made some attempt
to update the drm code to determine the correct pixel format based
on the drm graphics format, but what is available in pixel flinger
and what is available in drm do not line up all that well. Reports
are that the Pixel C is using drm graphics, but performance is
slow, likely due to the use of a mmap instead of a memory buffyer.

Change-Id: Ibd45bccca6ac2cb826037aa9b2aa5065cf683eed
diff --git a/minuitwrp/minui.h b/minuitwrp/minui.h
index 25a785a..018f327 100644
--- a/minuitwrp/minui.h
+++ b/minuitwrp/minui.h
@@ -18,6 +18,16 @@
 #define _MINUI_H_
 
 #include "../gui/placement.h"
+#include <stdbool.h>
+
+struct GRSurface {
+    int width;
+    int height;
+    int row_bytes;
+    int pixel_bytes;
+    unsigned char* data;
+    __u32 format;
+};
 
 typedef void* gr_surface;
 typedef unsigned short gr_pixel;
@@ -32,7 +42,7 @@
 int gr_fb_height(void);
 gr_pixel *gr_fb_data(void);
 void gr_flip(void);
-int gr_fb_blank(int blank);
+void gr_fb_blank(bool blank);
 
 void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
 void gr_clip(int x, int y, int w, int h);
@@ -41,14 +51,7 @@
 void gr_line(int x0, int y0, int x1, int y1, int width);
 gr_surface gr_render_circle(int radius, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
 
-int gr_textEx(int x, int y, const char *s, void* font);
 int gr_textEx_scaleW(int x, int y, const char *s, void* pFont, int max_width, int placement, int scale);
-int gr_textExW(int x, int y, const char *s, void* font, int max_width);
-int gr_textExWH(int x, int y, const char *s, void* pFont, int max_width, int max_height);
-static inline int gr_text(int x, int y, const char *s)     { return gr_textEx(x, y, s, NULL); }
-int gr_measureEx(const char *s, void* font);
-static inline int gr_measure(const char *s)                { return gr_measureEx(s, NULL); }
-int gr_maxExW(const char *s, void* font, int max_width);
 
 int gr_getMaxFontHeight(void *font);
 
@@ -86,11 +89,6 @@
 void res_free_surface(gr_surface surface);
 int res_scale_surface(gr_surface source, gr_surface* destination, float scale_w, float scale_h);
 
-// Needed for AOSP:
-int ev_wait(int timeout);
-void ev_dispatch(void);
-int ev_get_input(int fd, short revents, struct input_event *ev);
-
 int vibrate(int timeout_ms);
 
 #endif