diff options
| author | Po Lu | 2023-05-20 10:26:28 +0800 |
|---|---|---|
| committer | Po Lu | 2023-05-20 10:26:28 +0800 |
| commit | 181453285c67783ebf8eb269dc19fdb0e563af62 (patch) | |
| tree | ffe493fffa5106ba44d544350bf4627a047c1656 /java | |
| parent | b434d2e1e4c658a8210a421089c30d904dacf6eb (diff) | |
| download | emacs-181453285c67783ebf8eb269dc19fdb0e563af62.tar.gz emacs-181453285c67783ebf8eb269dc19fdb0e563af62.zip | |
Update Android port
* java/org/gnu/emacs/EmacsView.java (swapBuffers): Restore
missing damage rect code.
(onDetachedFromWindow): Remove redundant synchronization.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsView.java | 28 |
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 | |||
| 356 | 356 | ||
| 357 | damageRect = null; | 357 | damageRect = null; |
| 358 | 358 | ||
| 359 | /* Now see if there is a damage region. */ | ||
| 360 | |||
| 359 | synchronized (damageRegion) | 361 | synchronized (damageRegion) |
| 360 | { | 362 | { |
| 361 | if (damageRegion.isEmpty ()) | 363 | if (damageRegion.isEmpty ()) |
| 362 | return; | 364 | return; |
| 363 | 365 | ||
| 366 | /* And extract and clear the damage region. */ | ||
| 367 | |||
| 368 | damageRect = damageRegion.getBounds (); | ||
| 369 | damageRegion.setEmpty (); | ||
| 370 | |||
| 364 | bitmap = getBitmap (); | 371 | bitmap = getBitmap (); |
| 365 | 372 | ||
| 366 | /* Transfer the bitmap to the surface view, then invalidate | 373 | /* Transfer the bitmap to the surface view, then invalidate |
| 367 | it. */ | 374 | it. */ |
| 368 | surfaceView.setBitmap (bitmap, damageRect); | 375 | surfaceView.setBitmap (bitmap, damageRect); |
| 369 | } | 376 | } |
| 370 | } | 377 | } |
| 371 | 378 | ||
| @@ -545,20 +552,17 @@ public final class EmacsView extends ViewGroup | |||
| 545 | { | 552 | { |
| 546 | isAttachedToWindow = false; | 553 | isAttachedToWindow = false; |
| 547 | 554 | ||
| 548 | synchronized (this) | 555 | /* Recycle the bitmap and call GC. */ |
| 549 | { | ||
| 550 | /* Recycle the bitmap and call GC. */ | ||
| 551 | 556 | ||
| 552 | if (bitmap != null) | 557 | if (bitmap != null) |
| 553 | bitmap.recycle (); | 558 | bitmap.recycle (); |
| 554 | 559 | ||
| 555 | bitmap = null; | 560 | bitmap = null; |
| 556 | canvas = null; | 561 | canvas = null; |
| 557 | surfaceView.setBitmap (null, null); | 562 | surfaceView.setBitmap (null, null); |
| 558 | 563 | ||
| 559 | /* Collect the bitmap storage; it could be large. */ | 564 | /* Collect the bitmap storage; it could be large. */ |
| 560 | Runtime.getRuntime ().gc (); | 565 | Runtime.getRuntime ().gc (); |
| 561 | } | ||
| 562 | 566 | ||
| 563 | super.onDetachedFromWindow (); | 567 | super.onDetachedFromWindow (); |
| 564 | } | 568 | } |