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

Commit ea83503e authored by Romain Guy's avatar Romain Guy
Browse files

Don't create hw layers when there's no hw context.

Bug #5093805

Change-Id: Ia58b3381c83b9a200e80020e5c1b9c337ad6c35c
parent a7ffaee2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -54,7 +54,10 @@ abstract class GLES20Layer extends HardwareLayer {

    @Override
    void destroy() {
        if (mFinalizer != null) mFinalizer.destroy();
        if (mFinalizer != null) {
            mFinalizer.destroy();
            mFinalizer = null;
        }
        mLayer = 0;
    }

+2 −1
Original line number Diff line number Diff line
@@ -9676,7 +9676,8 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
     * @return A HardwareLayer ready to render, or null if an error occurred.
     */
    HardwareLayer getHardwareLayer() {
        if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) {
        if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null ||
                !mAttachInfo.mHardwareRenderer.isEnabled()) {
            return null;
        }

+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import android.util.Log;
import android.util.SparseArray;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;
+7 −3
Original line number Diff line number Diff line
@@ -1537,7 +1537,8 @@ public final class ViewRootImpl extends Handler implements ViewParent,
            }
        }

        boolean cancelDraw = attachInfo.mTreeObserver.dispatchOnPreDraw();
        boolean cancelDraw = attachInfo.mTreeObserver.dispatchOnPreDraw() ||
                viewVisibility != View.VISIBLE;

        if (!cancelDraw && !newSurface) {
            if (mPendingTransitions != null && mPendingTransitions.size() > 0) {
@@ -1591,10 +1592,13 @@ public final class ViewRootImpl extends Handler implements ViewParent,
            if (fullRedrawNeeded) {
                mFullRedrawNeeded = true;
            }
            
            if (viewVisibility == View.VISIBLE) {
                // Try again
                scheduleTraversals();
            }
        }
    }

    public void requestTransparentRegion(View child) {
        // the test below should not fail unless someone is messing with us