Merge "gpuDrawTime should default to 0 when endTime is unknown"

This commit is contained in:
TreeHugger Robot
2020-10-16 06:28:59 +00:00
committed by Android (Google) Code Review

View File

@@ -158,7 +158,7 @@ public:
// GPU start time is approximated to the moment before swapBuffer is invoked.
// We could add an EGLSyncKHR fence at the beginning of the frame, but that is an overhead.
int64_t endTime = get(FrameInfoIndex::GpuCompleted);
return endTime > 0 ? endTime - get(FrameInfoIndex::SwapBuffers) : -1;
return endTime > 0 ? endTime - get(FrameInfoIndex::SwapBuffers) : 0;
}
inline int64_t& set(FrameInfoIndex index) { return mFrameInfo[static_cast<int>(index)]; }