summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/KeyboardView.java
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2013-08-02 00:25:05 +0900
committerKen Wakasa <kwakasa@google.com>2013-08-02 19:30:05 +0900
commit52876bbefd774e8647910f73a2e4c17ac4e6bf5c (patch)
tree1a834ba216c47b3d555a02f7ae43b4412f6eeb8c /java/src/com/android/inputmethod/keyboard/KeyboardView.java
parent82018f99727a104aa77ab4d48f8b9a9858479453 (diff)
Remove unnecessary setLayerType() calls
Calling up setLayerType(LAYER_TYPE_HARDWARE, ..) on non-HW accelerated devices was ending up with having a drawing cache in View that is not quite needed for PreviewPlacerView. bug: 8967766 Change-Id: Ic8e6eeaf536530ff5f23eb353b0a8e5ba96fa0e2
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyboardView.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 2a02682e5..96286559d 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -154,6 +154,12 @@ public class KeyboardView extends View {
Color.red(color), Color.green(color), Color.blue(color));
}
+ public void setHardwareAcceleratedDrawingEnabled(final boolean enabled) {
+ if (!enabled) return;
+ // TODO: Should use LAYER_TYPE_SOFTWARE when hardware acceleration is off?
+ setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ }
+
/**
* Attaches a keyboard to this view. The keyboard can be switched at any time and the
* view will re-layout itself to accommodate the keyboard.