mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-12 14:30:42 -08:00
Disable hardware acceleration on Android
It serves no purpose and causes tearing. Uploading the bitmap to the GPU takes about as long as it does to incrementally update the surface in software. * java/AndroidManifest.xml.in: Disable hardware acceleration. * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): Make lastClosedMenu static. * java/org/gnu/emacs/EmacsDialog.java (toAlertDialog): Enable hardware acceleration within alert dialogs. * java/org/gnu/emacs/EmacsSurfaceView.java (onDraw): Describe why hardware acceleration is disabled. * java/org/gnu/emacs/EmacsWindow.java (run): Remove redundant call.
This commit is contained in:
parent
4e2fda28ed
commit
140755f2cf
5 changed files with 39 additions and 4 deletions
|
|
@ -152,7 +152,7 @@ public final class EmacsDialog implements DialogInterface.OnDismissListener
|
|||
toAlertDialog (Context context)
|
||||
{
|
||||
AlertDialog dialog;
|
||||
int size, styleId;
|
||||
int size, styleId, flag;
|
||||
int[] attrs;
|
||||
EmacsButton button;
|
||||
EmacsDialogButtonLayout layout;
|
||||
|
|
@ -160,6 +160,7 @@ public final class EmacsDialog implements DialogInterface.OnDismissListener
|
|||
ViewGroup.LayoutParams layoutParams;
|
||||
Theme theme;
|
||||
TypedArray attributes;
|
||||
Window window;
|
||||
|
||||
size = buttons.size ();
|
||||
styleId = -1;
|
||||
|
|
@ -273,6 +274,17 @@ public final class EmacsDialog implements DialogInterface.OnDismissListener
|
|||
}
|
||||
}
|
||||
|
||||
/* Make sure the dialog is hardware accelerated. Hardware
|
||||
acceleration is disabled for dialogs by default, because they
|
||||
aren't enabled in EmacsActivity either. */
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
{
|
||||
flag = WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
|
||||
window = dialog.getWindow ();
|
||||
window.addFlags (flag);
|
||||
}
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue