From 0500b3cfda5192efc09d6d4344b0c6c785c0a815 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 1 Nov 2011 15:28:43 -0700 Subject: Some optimizations. - Don't try to create a thumbnail bitmap on the client side. This wastes 64k, and isn't needed since we are doing screenshots. - Optimize View to put all of the callback pointers out of line. Added a couple new APIs so these don't need to be protected/public. - Lazily create ViewGroup's cache paint. - Change FrameworkPerf app to not use HW accel drawing, to give better comparison with GB. Change-Id: Iec56d02459820d74a4cc9c7ec9c1856563c82c7b --- core/java/android/widget/TextView.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/java/android/widget/TextView.java') diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 9257534..a8680d4 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -271,7 +271,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private static final int SIGNED = 2; private static final int DECIMAL = 4; - class Drawables { + static class Drawables { final Rect mCompoundRect = new Rect(); Drawable mDrawableTop, mDrawableBottom, mDrawableLeft, mDrawableRight, mDrawableStart, mDrawableEnd; @@ -304,7 +304,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private int mMarqueeRepeatLimit = 3; - class InputContentType { + static class InputContentType { int imeOptions = EditorInfo.IME_NULL; String privateImeOptions; CharSequence imeActionLabel; @@ -315,7 +315,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } InputContentType mInputContentType; - class InputMethodState { + static class InputMethodState { Rect mCursorRectInWindow = new Rect(); RectF mTmpRectF = new RectF(); float[] mTmpOffset = new float[2]; @@ -5363,7 +5363,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // don't let it be inserted into the text. if ((event.getFlags() & KeyEvent.FLAG_EDITOR_ACTION) != 0 || shouldAdvanceFocusOnEnter()) { - if (mOnClickListener != null) { + if (hasOnClickListeners()) { return 0; } return -1; @@ -5497,7 +5497,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * call performClick(), but that won't do anything in * this case.) */ - if (mOnClickListener == null) { + if (hasOnClickListeners()) { if (mMovement != null && mText instanceof Editable && mLayout != null && onCheckIsTextEditor()) { InputMethodManager imm = InputMethodManager.peekInstance(); @@ -5535,7 +5535,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * call performClick(), but that won't do anything in * this case.) */ - if (mOnClickListener == null) { + if (hasOnClickListeners()) { View v = focusSearch(FOCUS_DOWN); if (v != null) { -- cgit v1.1