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

Commit ae738a7a authored by Bo Liu's avatar Bo Liu
Browse files

Add invokeFunctor call to ViewRootImpl

BUG: 13961296

Change-Id: Ief8eea0b4c79a64ea76d75daaec176f1b8438581
parent 6d50c3ff
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;