aboutsummaryrefslogtreecommitdiffstats
path: root/src/android.c
diff options
context:
space:
mode:
authorPo Lu2024-04-23 14:30:38 +0800
committerPo Lu2024-04-23 14:30:38 +0800
commitb9c191d690fd5d1480858469df23cc4509996fae (patch)
tree2e0536607f1442a99e88e39af8d24c51bab45aeb /src/android.c
parent63765a74f15ef22109750414ec3025c8a40039f0 (diff)
downloademacs-b9c191d690fd5d1480858469df23cc4509996fae.tar.gz
emacs-b9c191d690fd5d1480858469df23cc4509996fae.zip
Implement face stipples on Android
* .gitignore: * java/Makefile.in: Fix typos. * java/org/gnu/emacs/EmacsFillRectangle.java (perform): Call blitOpaqueStipple if filling an unobscured rectangle with an opaque stipple. * java/org/gnu/emacs/EmacsGC.java (EmacsGC) <tileObject>: New field. (markDirty): Synchronize the current stipple with tileObject. (prepareStipple, blitOpaqueStipple): New functions. * java/org/gnu/emacs/EmacsService.java (EmacsService) <resources>: New static field. (onCreate): Set it. * src/android.c (android_create_bitmap_from_data): Correct order of arguments to android_create_pixmap_from_bitmap_data. (HAS_BUILTIN_TRAP): Delete macro. (emacs_abort): Always induce backtraces by means of a NULL pointer deference. * src/dispextern.h (Emacs_GC, Emacs_Rectangle, GCForeground) (GCBackground, GCFillStyle, GCStipple, FillOpaqueStipple) [HAVE_ANDROID]: Define to their Android counterparts rather than simulating their existence. * src/epaths.in: Set bitmap path to /assets/bitmaps on Android. * src/image.c (image_bitmap_pixmap): Also enable when HAVE_ANDROID. * src/sfntfont-android.c (sfntfont_android_put_glyphs): Assert that this is never called to draw a stippled background. * src/xfaces.c (x_create_gc) [HAVE_ANDROID]: Redefine as wrapper around android_create_gc. (prepare_face_for_display) [HAVE_ANDROID]: Enable stipples.
Diffstat (limited to 'src/android.c')
-rw-r--r--src/android.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/android.c b/src/android.c
index 7a7eadc946a..e44b58c5973 100644
--- a/src/android.c
+++ b/src/android.c
@@ -4882,8 +4882,8 @@ android_pixmap
4882android_create_bitmap_from_data (char *bits, unsigned int width, 4882android_create_bitmap_from_data (char *bits, unsigned int width,
4883 unsigned int height) 4883 unsigned int height)
4884{ 4884{
4885 return android_create_pixmap_from_bitmap_data (bits, 1, 0, 4885 return android_create_pixmap_from_bitmap_data (bits, width, height,
4886 width, height, 1); 4886 1, 0, 1);
4887} 4887}
4888 4888
4889struct android_image * 4889struct android_image *
@@ -5994,40 +5994,22 @@ android_toggle_on_screen_keyboard (android_window window, bool show)
5994 5994
5995 5995
5996 5996
5997#if defined __clang_major__ && __clang_major__ < 5
5998# define HAS_BUILTIN_TRAP 0
5999#elif 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
6000# define HAS_BUILTIN_TRAP 1
6001#elif defined __has_builtin
6002# define HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
6003#else /* !__has_builtin */
6004# define HAS_BUILTIN_TRAP 0
6005#endif /* defined __clang_major__ && __clang_major__ < 5 */
6006
6007/* emacs_abort implementation for Android. This logs a stack 5997/* emacs_abort implementation for Android. This logs a stack
6008 trace. */ 5998 trace. */
6009 5999
6010void 6000void
6011emacs_abort (void) 6001emacs_abort (void)
6012{ 6002{
6013#ifndef HAS_BUILTIN_TRAP
6014 volatile char *foo; 6003 volatile char *foo;
6015#endif /* !HAS_BUILTIN_TRAP */
6016 6004
6017 __android_log_print (ANDROID_LOG_FATAL, __func__, 6005 __android_log_print (ANDROID_LOG_FATAL, __func__,
6018 "emacs_abort called, please review the following" 6006 "emacs_abort called, please review the following"
6019 " stack trace"); 6007 " stack trace");
6020 6008
6021#ifndef HAS_BUILTIN_TRAP
6022 /* Induce a NULL pointer dereference to make debuggerd generate a 6009 /* Induce a NULL pointer dereference to make debuggerd generate a
6023 tombstone. */ 6010 tombstone. */
6024 foo = NULL; 6011 foo = NULL;
6025 *foo = '\0'; 6012 *foo = '\0';
6026#else /* HAS_BUILTIN_TRAP */
6027 /* Crash through __builtin_trap instead. This appears to more
6028 uniformly elicit crash reports from debuggerd. */
6029 __builtin_trap ();
6030#endif /* !HAS_BUILTIN_TRAP */
6031 6013
6032 abort (); 6014 abort ();
6033} 6015}