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

Commit 9e2a47d2 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Revert "Destroy DisplayLists on time""

parents 140dbc2e be34e8ee
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -360,7 +360,6 @@ public final class ThreadedRenderer {
    void destroy() {
        mInitialized = false;
        updateEnabledState(null);
        mRootNode.discardDisplayList();
        nDestroy(mNativeProxy, mRootNode.mNativeRenderNode);
    }

@@ -492,12 +491,20 @@ public final class ThreadedRenderer {
     */
    void destroyHardwareResources(View view) {
        destroyResources(view);
        mRootNode.discardDisplayList();
        nDestroyHardwareResources(mNativeProxy);
    }

    private static void destroyResources(View view) {
        view.destroyHardwareResources();

        if (view instanceof ViewGroup) {
            ViewGroup group = (ViewGroup) view;

            int count = group.getChildCount();
            for (int i = 0; i < count; i++) {
                destroyResources(group.getChildAt(i));
            }
        }
    }

    /**
+4 −8
Original line number Diff line number Diff line
@@ -16530,12 +16530,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        // safe to free its copy of the display list as it knows that we will
        // push an updated DisplayList if we try to draw again
        resetDisplayList();
        if (mOverlay != null) {
            mOverlay.getOverlayView().destroyHardwareResources();
        }
        if (mGhostView != null) {
            mGhostView.destroyHardwareResources();
        }
    }
    /**
@@ -16706,9 +16700,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    private void resetDisplayList() {
        if (mRenderNode.isValid()) {
            mRenderNode.discardDisplayList();
        }
        if (mBackgroundRenderNode != null) {
        if (mBackgroundRenderNode != null && mBackgroundRenderNode.isValid()) {
            mBackgroundRenderNode.discardDisplayList();
        }
    }
+0 −10
Original line number Diff line number Diff line
@@ -3433,16 +3433,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        super.dispatchDetachedFromWindow();
    }

    /** @hide */
    @Override
    protected void destroyHardwareResources() {
        super.destroyHardwareResources();
        int count = getChildCount();
        for (int i = 0; i < count; i++) {
            getChildAt(i).destroyHardwareResources();
        }
    }

    /**
     * @hide
     */
+0 −1
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ void onRenderNodeRemoved(JNIEnv* env, RenderNode* node) {
        return;
    }

    node->setStagingDisplayList(nullptr, nullptr);
    // Update the valid field, since native has already removed
    // the staging DisplayList
    env->SetBooleanField(jnode, gRenderNode_validFieldID, false);