Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6b13534 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Only enable GL rendering on the main thread." into honeycomb

parents e1c99a1f 4f6aff38
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ import javax.microedition.khronos.opengles.GL;
 * @hide
 */
public abstract class HardwareRenderer {
    private static final String LOG_TAG = "HardwareRenderer";
    static final String LOG_TAG = "HardwareRenderer";

    /**
     * A process can set this flag to false to prevent the use of hardware
+8 −1
Original line number Diff line number Diff line
@@ -486,6 +486,13 @@ 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) {