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

Commit 802667b2 authored by Bo Liu's avatar Bo Liu Committed by Android (Google) Code Review
Browse files

Merge "Add invokeFunctor call to ViewRootImpl"

parents 812ad226 ae738a7a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ public class GLRenderer extends HardwareRenderer {
    }

    @Override
    public void invokeFunctor(long functor, boolean waitForCompletion) {
    void invokeFunctor(long functor, boolean waitForCompletion) {
        boolean needsContext = !isEnabled() || checkRenderContext() == SURFACE_STATE_ERROR;
        boolean hasContext = !needsContext;

+1 −1
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ public abstract class HardwareRenderer {
     *                          has invoked. If false, the functor may be invoked
     *                          asynchronously.
     */
    public abstract void invokeFunctor(long functor, boolean waitForCompletion);
    abstract void invokeFunctor(long functor, boolean waitForCompletion);

    /**
     * Initializes the hardware renderer for the specified surface and setup the
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ public class ThreadedRenderer extends HardwareRenderer {
    }

    @Override
    public void invokeFunctor(long functor, boolean waitForCompletion) {
    void invokeFunctor(long functor, boolean waitForCompletion) {
        nInvokeFunctor(mNativeProxy, functor, waitForCompletion);
    }

+8 −0
Original line number Diff line number Diff line
@@ -678,6 +678,14 @@ public final class ViewRootImpl implements ViewParent,
        }
    }

    public boolean invokeFunctor(long functor, boolean waitForCompletion) {
        if (mAttachInfo.mHardwareRenderer == null || !mAttachInfo.mHardwareRenderer.isEnabled()) {
            return false;
        }
        mAttachInfo.mHardwareRenderer.invokeFunctor(functor, waitForCompletion);
        return true;
    }

    private void enableHardwareAcceleration(WindowManager.LayoutParams attrs) {
        mAttachInfo.mHardwareAccelerated = false;
        mAttachInfo.mHardwareAccelerationRequested = false;