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

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

Merge "Add a callback for rendernode parentcount=0" into nyc-dev

parents 4c0dbb5b 44b49f07
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -763,6 +763,16 @@ public class RenderNode {
        return nGetDebugSize(mNativeRenderNode);
    }

    /**
     * Called by native when the passed displaylist is removed from the draw tree
     */
    void onRenderNodeDetached() {
        discardDisplayList();
        if (mOwningView != null) {
            mOwningView.onRenderNodeDetached(this);
        }
    }

    ///////////////////////////////////////////////////////////////////////////
    // Animations
    ///////////////////////////////////////////////////////////////////////////
@@ -795,7 +805,9 @@ public class RenderNode {
    // Native methods
    ///////////////////////////////////////////////////////////////////////////

    private static native long nCreate(String name);
    // Intentionally not static because it acquires a reference to 'this'
    private native long nCreate(String name);

    private static native void nDestroyRenderNode(long renderNode);
    private static native void nSetDisplayList(long renderNode, long newData);

+4 −2
Original line number Diff line number Diff line
@@ -794,7 +794,8 @@ public final class ThreadedRenderer {
        }

        final long[] frameInfo = choreographer.mFrameInfo.mFrameInfo;
        int syncResult = nSyncAndDrawFrame(mNativeProxy, frameInfo, frameInfo.length);
        int syncResult = nSyncAndDrawFrame(mNativeProxy, frameInfo, frameInfo.length,
                mRootNode.mNativeRenderNode);
        if ((syncResult & SYNC_LOST_SURFACE_REWARD_IF_FOUND) != 0) {
            setEnabled(false);
            attachInfo.mViewRootImpl.mSurface.release();
@@ -993,7 +994,8 @@ public final class ThreadedRenderer {
    private static native void nSetLightCenter(long nativeProxy,
            float lightX, float lightY, float lightZ);
    private static native void nSetOpaque(long nativeProxy, boolean opaque);
    private static native int nSyncAndDrawFrame(long nativeProxy, long[] frameInfo, int size);
    private static native int nSyncAndDrawFrame(long nativeProxy, long[] frameInfo, int size,
            long rootRenderNode);
    private static native void nDestroy(long nativeProxy, long rootRenderNode);
    private static native void nRegisterAnimatingRenderNode(long rootRenderNode, long animatingNode);

+7 −0
Original line number Diff line number Diff line
@@ -16008,6 +16008,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
    }
    /**
     * Called when the passed RenderNode is removed from the draw tree
     * @hide
     */
    public void onRenderNodeDetached(RenderNode renderNode) {
    }
    /**
     * <p>Calling this method is equivalent to calling <code>getDrawingCache(false)</code>.</p>
     *
+1 −1
Original line number Diff line number Diff line
@@ -774,7 +774,7 @@ public final class ViewRootImpl implements ViewParent,
     *                          has invoked. If false, the functor may be invoked
     *                          asynchronously.
     */
    public void invokeFunctor(long functor, boolean waitForCompletion) {
    public static void invokeFunctor(long functor, boolean waitForCompletion) {
        ThreadedRenderer.invokeFunctor(functor, waitForCompletion);
    }

+1 −2
Original line number Diff line number Diff line
@@ -86,8 +86,7 @@ public final class WebViewDelegate {
     */
    public void invokeDrawGlFunctor(View containerView, long nativeDrawGLFunctor,
            boolean waitForCompletion) {
        ViewRootImpl viewRootImpl = containerView.getViewRootImpl();
        viewRootImpl.invokeFunctor(nativeDrawGLFunctor, waitForCompletion);
        ViewRootImpl.invokeFunctor(nativeDrawGLFunctor, waitForCompletion);
    }

    /**
Loading