aboutsummaryrefslogtreecommitdiffstats
path: root/java/org/gnu/emacs/EmacsCopyArea.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/org/gnu/emacs/EmacsCopyArea.java')
-rw-r--r--java/org/gnu/emacs/EmacsCopyArea.java24
1 files changed, 19 insertions, 5 deletions
diff --git a/java/org/gnu/emacs/EmacsCopyArea.java b/java/org/gnu/emacs/EmacsCopyArea.java
index f8974e17c2e..11dc22e0456 100644
--- a/java/org/gnu/emacs/EmacsCopyArea.java
+++ b/java/org/gnu/emacs/EmacsCopyArea.java
@@ -110,11 +110,25 @@ public class EmacsCopyArea
110 110
111 if (gc.clip_mask == null) 111 if (gc.clip_mask == null)
112 { 112 {
113 bitmap = Bitmap.createBitmap (srcBitmap, 113 if (source == destination)
114 src_x, src_y, width, 114 {
115 height); 115 /* Create a copy of the bitmap, since Android can't handle
116 canvas.drawBitmap (bitmap, null, rect, paint); 116 overlapping copies. */
117 bitmap.recycle (); 117 bitmap = Bitmap.createBitmap (srcBitmap,
118 src_x, src_y, width,
119 height);
120 canvas.drawBitmap (bitmap, null, rect, paint);
121 bitmap.recycle ();
122 }
123 else
124 {
125 /* But here the bitmaps are known to not overlap, so avoid
126 that extra consing overhead. */
127
128 srcRect = new Rect (src_x, src_y, src_x + width,
129 src_y + height);
130 canvas.drawBitmap (srcBitmap, null, rect, paint);
131 }
118 } 132 }
119 else 133 else
120 { 134 {