am 5b907be8: Merge "Move the main thread check to the appropriate place." into honeycomb

* commit '5b907be8f5c387e7580a8e43935250adabc408c8':
  Move the main thread check to the appropriate place.
This commit is contained in:
Romain Guy
2011-01-13 18:38:25 -08:00
committed by Android Git Automerger

View File

@@ -486,16 +486,16 @@ public final class ViewRoot extends Handler implements ViewParent,
mAttachInfo.mHardwareAccelerated = false;
mAttachInfo.mHardwareAccelerationRequested = false;
// 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 acceleration "
+ "outside of the main thread, aborting");
return;
}
// Try to enable hardware acceleration if requested
if (attrs != null &&
(attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0) {
// 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 acceleration "
+ "outside of the main thread, aborting");
return;
}
// 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