mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-27 15:52:00 -08:00
Update Android port
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView): Document member variables. (onDraw): Use separate Paint object on the UI thread. * src/textconv.c (really_commit_text, really_set_composing_text) (really_delete_surrounding_text): Run modification hooks when deleting text.
This commit is contained in:
parent
5abc977bbb
commit
24f25fc2f8
2 changed files with 31 additions and 10 deletions
|
|
@ -38,19 +38,40 @@ import java.lang.ref.WeakReference;
|
|||
public final class EmacsSurfaceView extends View
|
||||
{
|
||||
private static final String TAG = "EmacsSurfaceView";
|
||||
|
||||
/* The EmacsView representing the window that this surface is
|
||||
displaying. */
|
||||
private EmacsView view;
|
||||
|
||||
/* The complete buffer contents at the time of the last draw. */
|
||||
private Bitmap frontBuffer;
|
||||
|
||||
/* Canvas representing the front buffer. */
|
||||
private Canvas bitmapCanvas;
|
||||
|
||||
/* Reference to the last bitmap copied to the front buffer. */
|
||||
private WeakReference<Bitmap> bitmap;
|
||||
private Paint bitmapPaint;
|
||||
|
||||
/* Paint objects used on the main and UI threads, respectively. */
|
||||
private static final Paint bitmapPaint, uiThreadPaint;
|
||||
|
||||
static
|
||||
{
|
||||
/* Create two different Paint objects; one is used on the main
|
||||
thread for buffer swaps, while the other is used from the UI
|
||||
thread in `onDraw'. This is necessary because Paint objects
|
||||
are not thread-safe, even if their uses are interlocked. */
|
||||
|
||||
bitmapPaint = new Paint ();
|
||||
uiThreadPaint = new Paint ();
|
||||
};
|
||||
|
||||
public
|
||||
EmacsSurfaceView (final EmacsView view)
|
||||
EmacsSurfaceView (EmacsView view)
|
||||
{
|
||||
super (view.getContext ());
|
||||
|
||||
this.view = view;
|
||||
this.bitmapPaint = new Paint ();
|
||||
this.bitmap = new WeakReference<Bitmap> (null);
|
||||
}
|
||||
|
||||
|
|
@ -161,6 +182,6 @@ public final class EmacsSurfaceView extends View
|
|||
now. */
|
||||
|
||||
if (frontBuffer != null)
|
||||
canvas.drawBitmap (frontBuffer, 0f, 0f, bitmapPaint);
|
||||
canvas.drawBitmap (frontBuffer, 0f, 0f, uiThreadPaint);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue