Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
76bdcb53
Kaydet (Commit)
76bdcb53
authored
Ock 27, 2012
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: push the redraw-needed command into the app thread & wait
üst
d396ec82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
android_native_app_glue.c
sal/android/android_native_app_glue.c
+24
-0
No files found.
sal/android/android_native_app_glue.c
Dosyayı görüntüle @
76bdcb53
...
...
@@ -22,6 +22,7 @@
#include <unistd.h>
#include <sys/resource.h>
#include "osl/detail/android-bootstrap.h"
#include "osl/detail/android_native_app_glue.h"
#include <android/log.h>
...
...
@@ -143,6 +144,12 @@ void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) {
pthread_cond_broadcast
(
&
android_app
->
cond
);
pthread_mutex_unlock
(
&
android_app
->
mutex
);
break
;
case
APP_CMD_WINDOW_REDRAW_NEEDED
:
LOGI
(
"APP_CMD_WINDOW_REDRAW_NEEDED - post
\n
"
);
pthread_mutex_lock
(
&
android_app
->
mutex
);
pthread_cond_broadcast
(
&
android_app
->
cond
);
pthread_mutex_unlock
(
&
android_app
->
mutex
);
break
;
case
APP_CMD_SAVE_STATE
:
LOGI
(
"APP_CMD_SAVE_STATE
\n
"
);
...
...
@@ -303,6 +310,17 @@ static void android_app_set_window(struct android_app* android_app, ANativeWindo
pthread_mutex_unlock
(
&
android_app
->
mutex
);
}
static
void
android_app_window_redraw_needed
(
struct
android_app
*
android_app
,
ANativeWindow
*
window
)
{
pthread_mutex_lock
(
&
android_app
->
mutex
);
if
(
window
!=
NULL
)
{
android_app_write_cmd
(
android_app
,
APP_CMD_WINDOW_REDRAW_NEEDED
);
}
while
(
android_app
->
window
!=
android_app
->
pendingWindow
)
{
pthread_cond_wait
(
&
android_app
->
cond
,
&
android_app
->
mutex
);
}
pthread_mutex_unlock
(
&
android_app
->
mutex
);
}
static
void
android_app_set_activity_state
(
struct
android_app
*
android_app
,
int8_t
cmd
)
{
pthread_mutex_lock
(
&
android_app
->
mutex
);
android_app_write_cmd
(
android_app
,
cmd
);
...
...
@@ -404,6 +422,11 @@ static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* wi
android_app_set_window
((
struct
android_app
*
)
activity
->
instance
,
NULL
);
}
static
void
onNativeWindowRedrawNeeded
(
ANativeActivity
*
activity
,
ANativeWindow
*
window
)
{
LOGI
(
"onNativeWindowRedrawNeeded: %p -- %p
\n
"
,
activity
,
window
);
android_app_window_redraw_needed
((
struct
android_app
*
)
activity
->
instance
,
window
);
}
static
void
onInputQueueCreated
(
ANativeActivity
*
activity
,
AInputQueue
*
queue
)
{
LOGI
(
"InputQueueCreated: %p -- %p
\n
"
,
activity
,
queue
);
android_app_set_input
((
struct
android_app
*
)
activity
->
instance
,
queue
);
...
...
@@ -428,6 +451,7 @@ __attribute__ ((visibility("default"))) void ANativeActivity_onCreate(ANativeAct
activity
->
callbacks
->
onWindowFocusChanged
=
onWindowFocusChanged
;
activity
->
callbacks
->
onNativeWindowCreated
=
onNativeWindowCreated
;
activity
->
callbacks
->
onNativeWindowDestroyed
=
onNativeWindowDestroyed
;
activity
->
callbacks
->
onNativeWindowRedrawNeeded
=
onNativeWindowRedrawNeeded
;
activity
->
callbacks
->
onInputQueueCreated
=
onInputQueueCreated
;
activity
->
callbacks
->
onInputQueueDestroyed
=
onInputQueueDestroyed
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment