diff options
| author | Po Lu | 2023-02-10 19:06:38 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-10 19:06:38 +0800 |
| commit | 664140fc26240726f6ec9babe7deb633dd8c0bd2 (patch) | |
| tree | a48db09f688e9ed21199954cae812227d883da8b /java | |
| parent | a1941cd7a7dc9a6f6b7239ec7d4bd3bdf5d55fc9 (diff) | |
| download | emacs-664140fc26240726f6ec9babe7deb633dd8c0bd2.tar.gz emacs-664140fc26240726f6ec9babe7deb633dd8c0bd2.zip | |
Fix buffer swapping on Android 7.1 and earlier
* java/org/gnu/emacs/EmacsSurfaceView.java
(reconfigureFrontBuffer): Don't use function only present on
Android 8.0 and later.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsSurfaceView.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/java/org/gnu/emacs/EmacsSurfaceView.java b/java/org/gnu/emacs/EmacsSurfaceView.java index e9bae623930..2d80be0881a 100644 --- a/java/org/gnu/emacs/EmacsSurfaceView.java +++ b/java/org/gnu/emacs/EmacsSurfaceView.java | |||
| @@ -79,10 +79,16 @@ public class EmacsSurfaceView extends View | |||
| 79 | 79 | ||
| 80 | if (bitmap != null && frontBuffer == null) | 80 | if (bitmap != null && frontBuffer == null) |
| 81 | { | 81 | { |
| 82 | frontBuffer = Bitmap.createBitmap (bitmap.getWidth (), | 82 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) |
| 83 | bitmap.getHeight (), | 83 | frontBuffer = Bitmap.createBitmap (bitmap.getWidth (), |
| 84 | Bitmap.Config.ARGB_8888, | 84 | bitmap.getHeight (), |
| 85 | false); | 85 | Bitmap.Config.ARGB_8888, |
| 86 | false); | ||
| 87 | else | ||
| 88 | frontBuffer = Bitmap.createBitmap (bitmap.getWidth (), | ||
| 89 | bitmap.getHeight (), | ||
| 90 | Bitmap.Config.ARGB_8888); | ||
| 91 | |||
| 86 | bitmapCanvas = new Canvas (frontBuffer); | 92 | bitmapCanvas = new Canvas (frontBuffer); |
| 87 | 93 | ||
| 88 | /* And copy over the bitmap contents. */ | 94 | /* And copy over the bitmap contents. */ |