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

Commit 63e2c088 authored by Chet Haase's avatar Chet Haase Committed by Android (Google) Code Review
Browse files

Merge "Fix for using HARDWARE layers on unaccelerated views."

parents 36aad417 6f33e81a
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -8876,6 +8876,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility


        // Destroy any previous software drawing cache if needed
        // Destroy any previous software drawing cache if needed
        switch (mLayerType) {
        switch (mLayerType) {
            case LAYER_TYPE_HARDWARE:
                if (mHardwareLayer != null) {
                    mHardwareLayer.destroy();
                    mHardwareLayer = null;
                }
                // fall through - unaccelerated views may use software layer mechanism instead
            case LAYER_TYPE_SOFTWARE:
            case LAYER_TYPE_SOFTWARE:
                if (mDrawingCache != null) {
                if (mDrawingCache != null) {
                    mDrawingCache.recycle();
                    mDrawingCache.recycle();
@@ -8887,12 +8893,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
                    mUnscaledDrawingCache = null;
                    mUnscaledDrawingCache = null;
                }
                }
                break;
                break;
            case LAYER_TYPE_HARDWARE:
                if (mHardwareLayer != null) {
                    mHardwareLayer.destroy();
                    mHardwareLayer = null;
                }
                break;
            default:
            default:
                break;
                break;
        }
        }