Get rid of the extended themes.
We now decide whether to use a bitmap background based on whether the
window's drawing is hardware accelerated. To do this, there is a new
"state_accelerated" that state list drawables can be parameterized on,
and the standard window background uses this to select a solid color
or bitmap drawable as appropriate.
Introduces a little hackery to have wm preview windows pretend like
they are hardware accelerated even if they aren't, so the preview looks
closer to the actual app.
Also Add a DialogWhenLarge variation for the light theme.
Change-Id: I215a79d5df65ba3eed52ab363cade9d8218a6588
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index e04916f..1972692 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -467,19 +467,25 @@
}
private void enableHardwareAcceleration(WindowManager.LayoutParams attrs) {
- // 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) {
- // Try to enable hardware acceleration if requested
- if (attrs != null &&
- (attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0) {
+ mAttachInfo.mHardwareAccelerated = false;
+ mAttachInfo.mHardwareAccelerationRequested = false;
+
+ // Try to enable hardware acceleration if requested
+ if (attrs != null &&
+ (attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0) {
+ // 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 translucent = attrs.format != PixelFormat.OPAQUE;
if (mAttachInfo.mHardwareRenderer != null) {
mAttachInfo.mHardwareRenderer.destroy(true);
}
mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent);
- mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareRenderer != null;
+ mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested
+ = mAttachInfo.mHardwareRenderer != null;
+ } else if (HardwareRenderer.isAvailable()) {
+ mAttachInfo.mHardwareAccelerationRequested = true;
}
}
}