aboutsummaryrefslogtreecommitdiff
path: root/utils/lcd4linux/patches/171-allow-to-specify-drv_generic_graphic_real_clear.patch
blob: 109f11e0b731b1b337fedab1ed815dab20e3c18a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- a/drv_generic_graphic.c
+++ b/drv_generic_graphic.c
@@ -24,7 +24,7 @@
  *
  */
 
-/* 
+/*
  *
  * exported functions:
  *
@@ -98,6 +98,9 @@ static int INVERTED = 0;
 /* must be implemented by the real driver */
 void (*drv_generic_graphic_real_blit) () = NULL;
 
+/* can be implemented by the real driver */
+void (*drv_generic_graphic_real_clear) () = NULL;
+
 
 /****************************************/
 /*** generic Framebuffer stuff        ***/
@@ -691,7 +694,10 @@ int drv_generic_graphic_clear(void)
 	for (i = 0; i < LCOLS * LROWS; i++)
 	    drv_generic_graphic_FB[l][i] = NO_COL;
 
-    drv_generic_graphic_blit(0, 0, LROWS, LCOLS);
+    if (drv_generic_graphic_real_clear)
+	drv_generic_graphic_real_clear(NO_COL);
+    else
+	drv_generic_graphic_blit(0, 0, LROWS, LCOLS);
 
     return 0;
 }
--- a/drv_generic_graphic.h
+++ b/drv_generic_graphic.h
@@ -40,6 +40,9 @@ extern RGBA NO_COL;		/* no color (comple
 /* these functions must be implemented by the real driver */
 extern void (*drv_generic_graphic_real_blit) (const int row, const int col, const int height, const int width);
 
+/* these functions can be implemented by the real driver */
+extern void (*drv_generic_graphic_real_clear) (const RGBA rgba);
+
 /* helper function to get pixel color or gray value */
 extern RGBA drv_generic_graphic_rgb(const int row, const int col);
 extern unsigned char drv_generic_graphic_gray(const int row, const int col);