summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/TimeLord.cpp
diff options
context:
space:
mode:
authorAdy Abraham <adyabr@google.com>2020-10-05 17:59:09 -0700
committerAdy Abraham <adyabr@google.com>2020-10-09 11:17:32 -0700
commitdfb13985aff33cda393ffefc0db3103443f3be49 (patch)
tree25f497b88843c109e7ba08aa8a442d0a23336bc9 /libs/hwui/renderthread/TimeLord.cpp
parent6057df4f9e36765965fa787c0670ed6ac964138e (diff)
pass frame deadline to Choreographer
Pass the frame deadline calculated by SF to Choreographer so hwui would be able to improve its stats by knowing if a frame is likely to be late. Bug: 169858174 Test: manual Change-Id: Ib9fd93638b54f08d8dc72fa6b023e2dd7c276dc7
Diffstat (limited to 'libs/hwui/renderthread/TimeLord.cpp')
-rw-r--r--libs/hwui/renderthread/TimeLord.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/TimeLord.cpp b/libs/hwui/renderthread/TimeLord.cpp
index 7dc36c449568..abb633028363 100644
--- a/libs/hwui/renderthread/TimeLord.cpp
+++ b/libs/hwui/renderthread/TimeLord.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
#include "TimeLord.h"
+#include <limits>
namespace android {
namespace uirenderer {
@@ -22,12 +23,15 @@ namespace renderthread {
TimeLord::TimeLord() : mFrameIntervalNanos(milliseconds_to_nanoseconds(16)),
mFrameTimeNanos(0),
mFrameIntendedTimeNanos(0),
- mFrameVsyncId(-1) {}
+ mFrameVsyncId(-1),
+ mFrameDeadline(std::numeric_limits<int64_t>::max()){}
-bool TimeLord::vsyncReceived(nsecs_t vsync, nsecs_t intendedVsync, int64_t vsyncId) {
+bool TimeLord::vsyncReceived(nsecs_t vsync, nsecs_t intendedVsync, int64_t vsyncId,
+ int64_t frameDeadline) {
if (intendedVsync > mFrameIntendedTimeNanos) {
mFrameIntendedTimeNanos = intendedVsync;
mFrameVsyncId = vsyncId;
+ mFrameDeadline = frameDeadline;
}
if (vsync > mFrameTimeNanos) {