aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwm.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-11-17 20:25:02 +1000
committerinmarket <andrewh@inmarket.com.au>2013-11-17 20:25:02 +1000
commit1384918a1cd90e7e557e7645a8bfebb00c6ba984 (patch)
treed91f7b246c3ac14a49618b855704e5f9ea6aec6d /src/gwin/gwm.c
parent6a2fc9a647b1c674cad841e5eef5dc0a4b7dbd1f (diff)
downloaduGFX-1384918a1cd90e7e557e7645a8bfebb00c6ba984.tar.gz
uGFX-1384918a1cd90e7e557e7645a8bfebb00c6ba984.tar.bz2
uGFX-1384918a1cd90e7e557e7645a8bfebb00c6ba984.zip
Use the GTimer thread for full screen redraws when available to save application stack space.
Diffstat (limited to 'src/gwin/gwm.c')
-rw-r--r--src/gwin/gwm.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gwin/gwm.c b/src/gwin/gwm.c
index 1a25897e..f4dd8090 100644
--- a/src/gwin/gwm.c
+++ b/src/gwin/gwm.c
@@ -49,6 +49,12 @@ static const GWindowManager GNullWindowManager = {
gfxQueueASync _GWINList;
GWindowManager * _GWINwm;
+#if GFX_USE_GTIMER
+ static GTimer RedrawTimer;
+ static GDisplay * RedrawDisplay;
+ static bool_t RedrawPreserve;
+ static void _gwinRedrawDisplay(void * param);
+#endif
/*-----------------------------------------------
* Window Routines
@@ -58,6 +64,10 @@ void _gwmInit(void) {
gfxQueueASyncInit(&_GWINList);
_GWINwm = (GWindowManager *)&GNullWindowManager;
_GWINwm->vmt->Init();
+ #if GFX_USE_GTIMER
+ gtimerInit(&RedrawTimer);
+ gtimerStart(&RedrawTimer, _gwinRedrawDisplay, 0, TRUE, TIME_INFINITE);
+ #endif
}
void gwinSetWindowManager(struct GWindowManager *gwm) {
@@ -87,6 +97,17 @@ GWindowMinMax gwinGetMinMax(GHandle gh) {
}
void gwinRedrawDisplay(GDisplay *g, bool_t preserve) {
+ #if GFX_USE_GTIMER
+ RedrawDisplay = g;
+ RedrawPreserve = preserve;
+ gtimerJab(&RedrawTimer);
+ }
+ static void _gwinRedrawDisplay(void * param) {
+ GDisplay *g = RedrawDisplay;
+ bool_t preserve = RedrawPreserve;
+ (void) param;
+ #endif
+
const gfxQueueASyncItem * qi;
GHandle gh;