diff options
| author | Po Lu <luangruo@yahoo.com> | 2023-02-10 18:57:51 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2023-02-10 18:57:51 +0800 |
| commit | a1941cd7a7dc9a6f6b7239ec7d4bd3bdf5d55fc9 (patch) | |
| tree | abbb940a86dfc835ff22ec40d5387ea4a20a9e55 /java/org/gnu/emacs/EmacsCopyArea.java | |
| parent | 60270d8ee30ee15b5ed74ac211b7cb35c58ad3f3 (diff) | |
Update Android port
* doc/emacs/android.texi (Android Windowing): Remove yet another
limitation.
* java/debug.sh: Make this work on systems which prohibit
attaching to app processes from adbd.
* java/org/gnu/emacs/EmacsCopyArea.java (perform): Avoid
creating copies whenever possible.
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView):
Remove SurfaceView based implementation and use manual double
buffering with invalidate instead.
* java/org/gnu/emacs/EmacsView.java (EmacsView, handleDirtyBitmap)
(raise, lower, onDetachedFromWindow): Adjust accordingly.
* java/org/gnu/emacs/EmacsWindow.java (windowUpdated): Remove
function.
* src/sfntfont.c (sfntfont_open): Set font->max_width correctly.
Diffstat (limited to 'java/org/gnu/emacs/EmacsCopyArea.java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsCopyArea.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/java/org/gnu/emacs/EmacsCopyArea.java b/java/org/gnu/emacs/EmacsCopyArea.java index f8974e17c2e..11dc22e0456 100644 --- a/java/org/gnu/emacs/EmacsCopyArea.java +++ b/java/org/gnu/emacs/EmacsCopyArea.java @@ -110,11 +110,25 @@ public class EmacsCopyArea if (gc.clip_mask == null) { - bitmap = Bitmap.createBitmap (srcBitmap, - src_x, src_y, width, - height); - canvas.drawBitmap (bitmap, null, rect, paint); - bitmap.recycle (); + if (source == destination) + { + /* Create a copy of the bitmap, since Android can't handle + overlapping copies. */ + bitmap = Bitmap.createBitmap (srcBitmap, + src_x, src_y, width, + height); + canvas.drawBitmap (bitmap, null, rect, paint); + bitmap.recycle (); + } + else + { + /* But here the bitmaps are known to not overlap, so avoid + that extra consing overhead. */ + + srcRect = new Rect (src_x, src_y, src_x + width, + src_y + height); + canvas.drawBitmap (srcBitmap, null, rect, paint); + } } else { |
