diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2018-03-07 21:07:35 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2018-03-07 21:07:35 +0000 |
| commit | f058d3a99c396f21d6e17f201682462da1d305cc (patch) | |
| tree | 9375b3b30a86aca011bb395ca2d6f434a8e458d5 /src/drivers/Android | |
| parent | dcc10a6a0a4cf0ec6e2a2a95f8b110230d65f1aa (diff) | |
Android: using wait_for_expose to sync screen and windows
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12718 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Android')
| -rw-r--r-- | src/drivers/Android/Fl_Android_Application.cxx | 5 | ||||
| -rw-r--r-- | src/drivers/Android/Fl_Android_Window_Driver.H | 2 | ||||
| -rw-r--r-- | src/drivers/Android/Fl_Android_Window_Driver.cxx | 17 |
3 files changed, 22 insertions, 2 deletions
diff --git a/src/drivers/Android/Fl_Android_Application.cxx b/src/drivers/Android/Fl_Android_Application.cxx index dbaa97d04..890d175a4 100644 --- a/src/drivers/Android/Fl_Android_Application.cxx +++ b/src/drivers/Android/Fl_Android_Application.cxx @@ -23,6 +23,7 @@ */ #include "Fl_Android_Application.H" +#include "Fl_Android_Window_Driver.H" #include <jni.h> @@ -238,6 +239,7 @@ void Fl_Android_Application::pre_exec_cmd(int8_t cmd) pNativeWindow = pPendingWindow; pthread_cond_broadcast(&pCond); pthread_mutex_unlock(&pMutex); + Fl_Android_Window_Driver::expose_all(); break; case APP_CMD_TERM_WINDOW: @@ -416,10 +418,11 @@ bool Fl_Android_Application::copy_screen() src += srcStride; dst += dstStride; } + unlock_and_post_screen(); ret = true; } else { - Fl::damage(FL_DAMAGE_EXPOSE); + // wait for screen buffer to be created } return ret; } diff --git a/src/drivers/Android/Fl_Android_Window_Driver.H b/src/drivers/Android/Fl_Android_Window_Driver.H index 2fa1619d8..49be9a913 100644 --- a/src/drivers/Android/Fl_Android_Window_Driver.H +++ b/src/drivers/Android/Fl_Android_Window_Driver.H @@ -134,6 +134,8 @@ public: #endif + void wait_for_expose() { wait_for_expose_value = 1; } + static void expose_all(); // Leuwer: 0171 473 1850 }; diff --git a/src/drivers/Android/Fl_Android_Window_Driver.cxx b/src/drivers/Android/Fl_Android_Window_Driver.cxx index 42ffe2917..3c8d36ee7 100644 --- a/src/drivers/Android/Fl_Android_Window_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Window_Driver.cxx @@ -69,13 +69,28 @@ void Fl_Android_Window_Driver::show() i(x); x->next = Fl_X::first; Fl_X::first = x; - pWindow->redraw(); + if (Fl_Android_Application::native_window()) { + pWindow->redraw(); + } else { + pWindow->wait_for_expose(); + } } else { // bring window to front } } +void Fl_Android_Window_Driver::expose_all() +{ + for (Fl_X *x = Fl_X::first; x; x = x->next) { + Fl_Window *win = x->w; + win->driver()->wait_for_expose_value = 0; + win->damage(FL_DAMAGE_EXPOSE); + win->redraw(); + } +} + + void Fl_Android_Window_Driver::make_current() { ((Fl_Android_Screen_Driver*)Fl::screen_driver())->pScreenContentChanged = true; |
