Merge "Deallocate gesture trail bitmap when unneeded"
commit
883bd364eb
|
@ -1370,4 +1370,8 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
drawIcon(canvas, mSpaceIcon, x, y, iconWidth, iconHeight);
|
drawIcon(canvas, mSpaceIcon, x, y, iconWidth, iconHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deallocateMemory() {
|
||||||
|
mGestureTrailsPreview.deallocateMemory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,12 @@ public final class GestureTrailsPreview extends AbstractDrawingPreview {
|
||||||
freeOffscreenBuffer();
|
freeOffscreenBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deallocateMemory() {
|
||||||
|
freeOffscreenBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
private void freeOffscreenBuffer() {
|
private void freeOffscreenBuffer() {
|
||||||
|
mOffscreenCanvas.setBitmap(null);
|
||||||
if (mOffscreenBuffer != null) {
|
if (mOffscreenBuffer != null) {
|
||||||
mOffscreenBuffer.recycle();
|
mOffscreenBuffer.recycle();
|
||||||
mOffscreenBuffer = null;
|
mOffscreenBuffer = null;
|
||||||
|
|
|
@ -894,6 +894,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
||||||
if (mainKeyboardView != null) {
|
if (mainKeyboardView != null) {
|
||||||
mainKeyboardView.cancelAllOngoingEvents();
|
mainKeyboardView.cancelAllOngoingEvents();
|
||||||
|
mainKeyboardView.deallocateMemory();
|
||||||
}
|
}
|
||||||
// Remove pending messages related to update suggestions
|
// Remove pending messages related to update suggestions
|
||||||
mHandler.cancelUpdateSuggestionStrip();
|
mHandler.cancelUpdateSuggestionStrip();
|
||||||
|
|
Loading…
Reference in New Issue