diff options
| author | 2011-01-13 18:38:45 -0800 | |
|---|---|---|
| committer | 2011-01-13 18:38:45 -0800 | |
| commit | 501053a16dd8b24664856cab5551b246550d1ce5 (patch) | |
| tree | 08c5402dfea179cf56b9f569a9bcbd7dc91889c1 | |
| parent | 1e3a431d07cc0a307c6441e9ae1b17d3bf42323e (diff) | |
Move the main thread check to the appropriate place.
Change-Id: Ic9bcf209e9398ea05b293a8cc31ac7f234b9de16
| -rw-r--r-- | core/java/android/view/ViewRoot.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index d480bbc5e300..ad9e68633958 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -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 |