From e68d565d0f9704145adbf781105f1ac9a90f0a98 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Thu, 1 Aug 2013 18:01:48 +0900 Subject: [PATCH] Deallocate offscreen buffer for non-HW-accel draw Follow up to I5bc980c4dc41bc304be3c190934c1f7c55c9d244 This frees up 800KB on occam_svelte when LatinIME is in background. Confirmed the performance effect in keyboard-bring up speed was unperceivable. bug: 8967766 Change-Id: I0fab179c61179564bd3a0349c9825e7d61f7e1f2 --- java/src/com/android/inputmethod/keyboard/KeyboardView.java | 4 ++++ .../com/android/inputmethod/keyboard/MainKeyboardView.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 254b20b87..2a02682e5 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -605,4 +605,8 @@ public class KeyboardView extends View { super.onDetachedFromWindow(); freeOffscreenBuffer(); } + + public void deallocateMemory() { + freeOffscreenBuffer(); + } } diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 98eed264f..aca92ed50 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -1322,7 +1322,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack } } + @Override public void deallocateMemory() { + super.deallocateMemory(); mGestureTrailsPreview.deallocateMemory(); } }