From 8c51282770f86800ea609fda8bddb0d54a84ec62 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 5 Mar 2018 21:26:51 +0000 Subject: Android: more cleanup. Trying to solve the problem of undefined screen buffer content. Moved gradlew.bat into gradlew.zip to make some svn's happy. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12709 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Android/Fl_Android_Screen_Driver.cxx | 26 ++++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/drivers/Android/Fl_Android_Screen_Driver.cxx') diff --git a/src/drivers/Android/Fl_Android_Screen_Driver.cxx b/src/drivers/Android/Fl_Android_Screen_Driver.cxx index e05b1b883..1ffdc382a 100644 --- a/src/drivers/Android/Fl_Android_Screen_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Screen_Driver.cxx @@ -19,6 +19,7 @@ #include "../../config_lib.h" #include "Fl_Android_Screen_Driver.H" +#include "Fl_Android_Application.H" #include "./Fl_Font.H" #include #include @@ -27,13 +28,6 @@ #include #include -#include - -#define LOG_TAG "FLTK" -#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) -#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) -#define LOGV(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) static void nothing() {} void (*fl_unlock_function)() = nothing; @@ -375,14 +369,24 @@ void Fl_WinAPI_Screen_Driver::beep(int type) break; } } +#endif - -void Fl_WinAPI_Screen_Driver::flush() +/** + * On Android, get access to screen memory, then flush(), then + * release screen memory and post it to the physicla screen. + * + * Don't do anything if the screen wasn't previously locked by + * any Fl_Window_Driver. We would just needlessly repost the same screen. + */ +void Fl_Android_Screen_Driver::flush() { - GdiFlush(); + if (Fl_Android_Application::screen_is_locked()) { + Fl_Screen_Driver::flush(); + Fl_Android_Application::unlock_and_post_screen(); + } } - +#if 0 extern void fl_fix_focus(); // in Fl.cxx // We have to keep track of whether we have captured the mouse, since -- cgit v1.2.3