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

Commit bbd924fa authored by John Reck's avatar John Reck Committed by Android Git Automerger
Browse files

am 85189c5d: Merge "Fence on draws that are reported"

* commit '85189c5d':
  Fence on draws that are reported
parents 839ddd74 85189c5d
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -1226,6 +1226,11 @@ public class GLRenderer extends HardwareRenderer {
    }
    }
    private static native void nSetDisplayListData(long displayList, long newData);
    private static native void nSetDisplayListData(long displayList, long newData);


    @Override
    void fence() {
        // Everything is immediate, so this is a no-op
    }

    private RenderNode buildDisplayList(View view, HardwareCanvas canvas) {
    private RenderNode buildDisplayList(View view, HardwareCanvas canvas) {
        if (mDrawDelta <= 0) {
        if (mDrawDelta <= 0) {
            return view.mRenderNode;
            return view.mRenderNode;
+5 −0
Original line number Original line Diff line number Diff line
@@ -575,6 +575,11 @@ public abstract class HardwareRenderer {


    abstract void setDisplayListData(long displayList, long newData);
    abstract void setDisplayListData(long displayList, long newData);


    /**
     * Blocks until all previously queued work has completed.
     */
    abstract void fence();

    /**
    /**
     * Describes a series of frames that should be drawn on screen as a graph.
     * Describes a series of frames that should be drawn on screen as a graph.
     * Each frame is composed of 1 or more elements.
     * Each frame is composed of 1 or more elements.
+7 −0
Original line number Original line Diff line number Diff line
@@ -244,6 +244,11 @@ public class ThreadedRenderer extends HardwareRenderer {
    void setName(String name) {
    void setName(String name) {
    }
    }


    @Override
    void fence() {
        nFence(mNativeProxy);
    }

    @Override
    @Override
    protected void finalize() throws Throwable {
    protected void finalize() throws Throwable {
        try {
        try {
@@ -277,4 +282,6 @@ public class ThreadedRenderer extends HardwareRenderer {
    private static native long nCreateTextureLayer(long nativeProxy);
    private static native long nCreateTextureLayer(long nativeProxy);
    private static native boolean nCopyLayerInto(long nativeProxy, long layer, long bitmap);
    private static native boolean nCopyLayerInto(long nativeProxy, long layer, long bitmap);
    private static native void nDestroyLayer(long nativeProxy, long layer);
    private static native void nDestroyLayer(long nativeProxy, long layer);

    private static native void nFence(long nativeProxy);
}
}
+3 −0
Original line number Original line Diff line number Diff line
@@ -2259,6 +2259,9 @@ public final class ViewRootImpl implements ViewParent,


        if (mReportNextDraw) {
        if (mReportNextDraw) {
            mReportNextDraw = false;
            mReportNextDraw = false;
            if (mAttachInfo.mHardwareRenderer != null) {
                mAttachInfo.mHardwareRenderer.fence();
            }


            if (LOCAL_LOGV) {
            if (LOCAL_LOGV) {
                Log.v(TAG, "FINISHED DRAWING: " + mWindowAttributes.getTitle());
                Log.v(TAG, "FINISHED DRAWING: " + mWindowAttributes.getTitle());
+7 −0
Original line number Original line Diff line number Diff line
@@ -182,6 +182,12 @@ static void android_view_ThreadedRenderer_destroyLayer(JNIEnv* env, jobject claz
    proxy->destroyLayer(layer);
    proxy->destroyLayer(layer);
}
}


static void android_view_ThreadedRenderer_fence(JNIEnv* env, jobject clazz,
        jlong proxyPtr) {
    RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr);
    proxy->fence();
}

#endif
#endif


// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
@@ -209,6 +215,7 @@ static JNINativeMethod gMethods[] = {
    { "nCreateTextureLayer", "(J)J", (void*) android_view_ThreadedRenderer_createTextureLayer },
    { "nCreateTextureLayer", "(J)J", (void*) android_view_ThreadedRenderer_createTextureLayer },
    { "nCopyLayerInto", "(JJJ)Z", (void*) android_view_ThreadedRenderer_copyLayerInto },
    { "nCopyLayerInto", "(JJJ)Z", (void*) android_view_ThreadedRenderer_copyLayerInto },
    { "nDestroyLayer", "(JJ)V", (void*) android_view_ThreadedRenderer_destroyLayer },
    { "nDestroyLayer", "(JJ)V", (void*) android_view_ThreadedRenderer_destroyLayer },
    { "nFence", "(J)V", (void*) android_view_ThreadedRenderer_fence },
#endif
#endif
};
};


Loading