summaryrefslogtreecommitdiff
path: root/src/drivers/Android/Fl_Android_Screen_Driver.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-05 21:26:51 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-05 21:26:51 +0000
commit8c51282770f86800ea609fda8bddb0d54a84ec62 (patch)
tree047ce2b209563cb97fd28e24ebeca3d50dccbf80 /src/drivers/Android/Fl_Android_Screen_Driver.cxx
parent900457f0b443945731a728b84fbd6aaa72a39267 (diff)
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
Diffstat (limited to 'src/drivers/Android/Fl_Android_Screen_Driver.cxx')
-rw-r--r--src/drivers/Android/Fl_Android_Screen_Driver.cxx26
1 files changed, 15 insertions, 11 deletions
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 <FL/Fl.H>
#include <FL/platform.H>
@@ -27,13 +28,6 @@
#include <FL/fl_ask.H>
#include <stdio.h>
-#include <android/log.h>
-
-#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