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