summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2011-03-09 19:38:07 -0800
committerJim Miller <jaggies@google.com>2011-03-10 17:20:21 -0800
commit1b365921e88b14857d8e0826e221c371d25f6cb2 (patch)
tree306f6a22f2267fe3b2affd6ab3b961b5cdf3ae3f /core/java/android/view
parent2fc7976399e5f0f4c6e1dae528df727e7dcbdc8e (diff)
downloadframeworks_base-1b365921e88b14857d8e0826e221c371d25f6cb2.zip
frameworks_base-1b365921e88b14857d8e0826e221c371d25f6cb2.tar.gz
frameworks_base-1b365921e88b14857d8e0826e221c371d25f6cb2.tar.bz2
Fix 3201849: Enable hardware acceleration in LockScreen WaveView [DO NOT MERGE]
Change-Id: I07bbed7843857158cd2c1ffd9b184bde7fd5860d
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/ViewRoot.java16
-rw-r--r--core/java/android/view/WindowManager.java11
2 files changed, 22 insertions, 5 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.