summaryrefslogtreecommitdiff
path: root/java/org/gnu/emacs/EmacsView.java
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-05-20 10:26:28 +0800
committerPo Lu <luangruo@yahoo.com>2023-05-20 10:26:28 +0800
commit181453285c67783ebf8eb269dc19fdb0e563af62 (patch)
treeffe493fffa5106ba44d544350bf4627a047c1656 /java/org/gnu/emacs/EmacsView.java
parentb434d2e1e4c658a8210a421089c30d904dacf6eb (diff)
Update Android port
* java/org/gnu/emacs/EmacsView.java (swapBuffers): Restore missing damage rect code. (onDetachedFromWindow): Remove redundant synchronization.
Diffstat (limited to 'java/org/gnu/emacs/EmacsView.java')
-rw-r--r--java/org/gnu/emacs/EmacsView.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java
index 10c1af9e19a..124ea5301bb 100644
--- a/java/org/gnu/emacs/EmacsView.java
+++ b/java/org/gnu/emacs/EmacsView.java
@@ -356,16 +356,23 @@ public final class EmacsView extends ViewGroup
damageRect = null;
+ /* Now see if there is a damage region. */
+
synchronized (damageRegion)
{
if (damageRegion.isEmpty ())
return;
+ /* And extract and clear the damage region. */
+
+ damageRect = damageRegion.getBounds ();
+ damageRegion.setEmpty ();
+
bitmap = getBitmap ();
/* Transfer the bitmap to the surface view, then invalidate
it. */
- surfaceView.setBitmap (bitmap, damageRect);
+ surfaceView.setBitmap (bitmap, damageRect);
}
}
@@ -545,20 +552,17 @@ public final class EmacsView extends ViewGroup
{
isAttachedToWindow = false;
- synchronized (this)
- {
- /* Recycle the bitmap and call GC. */
+ /* Recycle the bitmap and call GC. */
- if (bitmap != null)
- bitmap.recycle ();
+ if (bitmap != null)
+ bitmap.recycle ();
- bitmap = null;
- canvas = null;
- surfaceView.setBitmap (null, null);
+ bitmap = null;
+ canvas = null;
+ surfaceView.setBitmap (null, null);
- /* Collect the bitmap storage; it could be large. */
- Runtime.getRuntime ().gc ();
- }
+ /* Collect the bitmap storage; it could be large. */
+ Runtime.getRuntime ().gc ();
super.onDetachedFromWindow ();
}