diff options
author | Jim Miller <jaggies@google.com> | 2011-03-10 22:59:57 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-10 22:59:57 -0800 |
commit | 352987e0889b6fa8862f489bc31ba7e9de8d1cbe (patch) | |
tree | 31fce34f0ba40f3b2e9e863a31f1cc7719257b35 /core | |
parent | f1093dfd7b15c7f33341a4062987c906c061d65f (diff) | |
parent | 1b365921e88b14857d8e0826e221c371d25f6cb2 (diff) | |
download | frameworks_base-352987e0889b6fa8862f489bc31ba7e9de8d1cbe.zip frameworks_base-352987e0889b6fa8862f489bc31ba7e9de8d1cbe.tar.gz frameworks_base-352987e0889b6fa8862f489bc31ba7e9de8d1cbe.tar.bz2 |
Merge "Fix 3201849: Enable hardware acceleration in LockScreen WaveView [DO NOT MERGE]" into honeycomb-mr1
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/ViewRoot.java | 16 | ||||
-rw-r--r-- | core/java/android/view/WindowManager.java | 11 | ||||
-rw-r--r-- | core/java/com/android/internal/widget/WaveView.java | 2 |
3 files changed, 23 insertions, 6 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index 11908bb..a53c6d0 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -498,15 +498,21 @@ public final class ViewRoot extends Handler implements ViewParent, mAttachInfo.mHardwareAccelerationRequested = false; // Try to enable hardware acceleration if requested - if (attrs != null && - (attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0) { + final boolean hardwareAccelerated = + (attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0; + + if (attrs != null && hardwareAccelerated) { // Only enable hardware acceleration if we are not in the system process // The window manager creates ViewRoots to display animated preview windows // of launching apps and we don't want those to be hardware accelerated - if (!HardwareRenderer.sRendererDisabled) { + + final boolean systemHwAccelerated = + (attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED_SYSTEM) != 0; + + if (!HardwareRenderer.sRendererDisabled || systemHwAccelerated) { // Don't enable hardware acceleration when we're not on the main thread - if (Looper.getMainLooper() != Looper.myLooper()) { - Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware " + if (!systemHwAccelerated && Looper.getMainLooper() != Looper.myLooper()) { + Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware " + "acceleration outside of the main thread, aborting"); return; } diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index ca932e9..8a18aaf 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -665,6 +665,17 @@ public interface WindowManager extends ViewManager { * XML attribute is set to true on an activity or on the application.</p> */ public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000; + + /** + * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows + * that need hardware acceleration (e.g. LockScreen), where hardware acceleration + * is generally disabled. This flag must be specified in addition to + * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system + * windows. + * + * @hide + */ + public static final int FLAG_HARDWARE_ACCELERATED_SYSTEM = 0x02000000; // ----- HIDDEN FLAGS. // These start at the high bit and go down. diff --git a/core/java/com/android/internal/widget/WaveView.java b/core/java/com/android/internal/widget/WaveView.java index d6f2e1a..288865f 100644 --- a/core/java/com/android/internal/widget/WaveView.java +++ b/core/java/com/android/internal/widget/WaveView.java @@ -40,7 +40,7 @@ import com.android.internal.R; public class WaveView extends View implements ValueAnimator.AnimatorUpdateListener { private static final String TAG = "WaveView"; private static final boolean DBG = false; - private static final int WAVE_COUNT = 5; // default wave count + private static final int WAVE_COUNT = 20; // default wave count private static final long VIBRATE_SHORT = 20; // msec private static final long VIBRATE_LONG = 20; // msec |