Merge "Fix to show the correct HW accel background in the preview window."
This commit is contained in:
committed by
Android (Google) Code Review
commit
6ff0037792
@@ -575,7 +575,6 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
|
|
||||||
if (hardwareAccelerated) {
|
if (hardwareAccelerated) {
|
||||||
if (!HardwareRenderer.isAvailable()) {
|
if (!HardwareRenderer.isAvailable()) {
|
||||||
mAttachInfo.mHardwareAccelerationRequested = true;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,6 +600,13 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent);
|
mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent);
|
||||||
mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested
|
mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested
|
||||||
= mAttachInfo.mHardwareRenderer != null;
|
= mAttachInfo.mHardwareRenderer != null;
|
||||||
|
} else {
|
||||||
|
// We would normally have enabled hardware acceleration, but
|
||||||
|
// haven't because we are in the system process. We still want
|
||||||
|
// what is drawn on the screen to behave as if it is accelerated,
|
||||||
|
// so that our preview starting windows visually match what will
|
||||||
|
// actually be drawn by the app.
|
||||||
|
mAttachInfo.mHardwareAccelerationRequested = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,9 +118,10 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
|
|||||||
File changedFile = new File(WALLPAPER_DIR, path);
|
File changedFile = new File(WALLPAPER_DIR, path);
|
||||||
if (WALLPAPER_FILE.equals(changedFile)) {
|
if (WALLPAPER_FILE.equals(changedFile)) {
|
||||||
notifyCallbacksLocked();
|
notifyCallbacksLocked();
|
||||||
if (mWallpaperComponent == null ||
|
if (mWallpaperComponent == null || mImageWallpaperPending) {
|
||||||
mWallpaperComponent.equals(mImageWallpaperComponent)) {
|
mImageWallpaperPending = false;
|
||||||
bindWallpaperComponentLocked(mWallpaperComponent, true);
|
bindWallpaperComponentLocked(mImageWallpaperComponent, true);
|
||||||
|
saveSettingsLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,7 +134,12 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
|
|||||||
|
|
||||||
int mWidth = -1;
|
int mWidth = -1;
|
||||||
int mHeight = -1;
|
int mHeight = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client is currently writing a new image wallpaper.
|
||||||
|
*/
|
||||||
|
boolean mImageWallpaperPending;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource name if using a picture from the wallpaper gallery
|
* Resource name if using a picture from the wallpaper gallery
|
||||||
*/
|
*/
|
||||||
@@ -343,6 +349,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
|
|||||||
}
|
}
|
||||||
final long ident = Binder.clearCallingIdentity();
|
final long ident = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
|
mImageWallpaperPending = false;
|
||||||
bindWallpaperComponentLocked(null, false);
|
bindWallpaperComponentLocked(null, false);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// This can happen if the default wallpaper component doesn't
|
// This can happen if the default wallpaper component doesn't
|
||||||
@@ -433,9 +440,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
|
|||||||
try {
|
try {
|
||||||
ParcelFileDescriptor pfd = updateWallpaperBitmapLocked(name);
|
ParcelFileDescriptor pfd = updateWallpaperBitmapLocked(name);
|
||||||
if (pfd != null) {
|
if (pfd != null) {
|
||||||
// Bind the wallpaper to an ImageWallpaper
|
mImageWallpaperPending = true;
|
||||||
bindWallpaperComponentLocked(mImageWallpaperComponent, false);
|
|
||||||
saveSettingsLocked();
|
|
||||||
}
|
}
|
||||||
return pfd;
|
return pfd;
|
||||||
} finally {
|
} finally {
|
||||||
@@ -463,6 +468,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
final long ident = Binder.clearCallingIdentity();
|
final long ident = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
|
mImageWallpaperPending = false;
|
||||||
bindWallpaperComponentLocked(name, false);
|
bindWallpaperComponentLocked(name, false);
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(ident);
|
Binder.restoreCallingIdentity(ident);
|
||||||
|
|||||||
Reference in New Issue
Block a user