]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix buffer swapping on Android 7.1 and earlier
authorPo Lu <luangruo@yahoo.com>
Fri, 10 Feb 2023 11:06:38 +0000 (19:06 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 10 Feb 2023 11:06:38 +0000 (19:06 +0800)
* java/org/gnu/emacs/EmacsSurfaceView.java
(reconfigureFrontBuffer): Don't use function only present on
Android 8.0 and later.

java/org/gnu/emacs/EmacsSurfaceView.java

index e9bae6239306bc938f1b8b0af298aca53d0afb82..2d80be0881add82f63751d12a6e936664e8b27f7 100644 (file)
@@ -79,10 +79,16 @@ public class EmacsSurfaceView extends View
 
     if (bitmap != null && frontBuffer == null)
       {
-       frontBuffer = Bitmap.createBitmap (bitmap.getWidth (),
-                                          bitmap.getHeight (),
-                                          Bitmap.Config.ARGB_8888,
-                                          false);
+       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
+         frontBuffer = Bitmap.createBitmap (bitmap.getWidth (),
+                                            bitmap.getHeight (),
+                                            Bitmap.Config.ARGB_8888,
+                                            false);
+       else
+         frontBuffer = Bitmap.createBitmap (bitmap.getWidth (),
+                                            bitmap.getHeight (),
+                                            Bitmap.Config.ARGB_8888);
+
        bitmapCanvas = new Canvas (frontBuffer);
 
        /* And copy over the bitmap contents.  */