Optimize damage region tracking under Android
* java/org/gnu/emacs/EmacsDrawLine.java (perform): * java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Call damageRect with integer coordinates in lieu of consing a new Rect. * java/org/gnu/emacs/EmacsDrawable.java (damageRect) <IIII>: Declare a new variant of damageRect, accepting four integers designating the extents of the damage rectangle. * java/org/gnu/emacs/EmacsPixmap.java (damageRect) <IIII>: New stub. * java/org/gnu/emacs/EmacsView.java (damageRect) <IIII>: Implement this overloaded variant of damageRect. * java/org/gnu/emacs/EmacsWindow.java (damageRect): Ditto. * src/android.c (android_init_emacs_drawable) (android_init_emacs_window): Move search for `damageRect' to android_init_emacs_window. (android_damage_window): Call IIII variant of `damageRect' to avoid consing a new rectangle. Ameliorate dynamic method dispatch overhead.
This commit is contained in:
@@ -437,6 +437,16 @@ public final class EmacsView extends ViewGroup
|
||||
damageRegion.union (damageRect);
|
||||
}
|
||||
|
||||
/* This function enables damage to be recorded without consing a new
|
||||
Rect object. */
|
||||
|
||||
public void
|
||||
damageRect (int left, int top, int right, int bottom)
|
||||
{
|
||||
EmacsService.checkEmacsThread ();
|
||||
damageRegion.op (left, top, right, bottom, Region.Op.UNION);
|
||||
}
|
||||
|
||||
/* This method is called from both the UI thread and the Emacs
|
||||
thread. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user