1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-07 08:00:48 -08:00

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:
Po Lu 2023-09-18 10:59:55 +08:00
parent 514b70d5a0
commit 4e46df9651
7 changed files with 49 additions and 26 deletions

View file

@ -29,7 +29,6 @@ public final class EmacsDrawLine
perform (EmacsDrawable drawable, EmacsGC gc,
int x, int y, int x2, int y2)
{
Rect rect;
Canvas canvas;
Paint paint;
int x0, x1, y0, y1;
@ -48,7 +47,6 @@ public final class EmacsDrawLine
/* And the clip rectangle. */
paint = gc.gcPaint;
rect = new Rect (x0, y0, x1, y1);
canvas = drawable.lockCanvas (gc);
if (canvas == null)
@ -74,6 +72,6 @@ public final class EmacsDrawLine
/* DrawLine with clip mask not implemented; it is not used by
Emacs. */
drawable.damageRect (rect);
drawable.damageRect (x0, y0, x1, y1);
}
}