171-allow-to-specify-drv_generic_graphic_real_clear.patch 1.4 KB

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