summaryrefslogtreecommitdiffstats
path: root/libs/hwui/FrameInfo.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-06-04 21:54:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-04 21:54:18 +0000
commitdde606df7f20f5d14b9d1440f1bd80e8d0d3969c (patch)
treed81058d98e19512ad1969c361b41920a14115294 /libs/hwui/FrameInfo.h
parent3a4656e8874a7bfa11ff8c68dfca87b7f399ff36 (diff)
parent41300274cf8efde2ca95d3c767b214d1edb97f8d (diff)
downloadframeworks_base-dde606df7f20f5d14b9d1440f1bd80e8d0d3969c.zip
frameworks_base-dde606df7f20f5d14b9d1440f1bd80e8d0d3969c.tar.gz
frameworks_base-dde606df7f20f5d14b9d1440f1bd80e8d0d3969c.tar.bz2
Merge "Iterate step of launch & iterate" into mnc-dev
Diffstat (limited to 'libs/hwui/FrameInfo.h')
-rw-r--r--libs/hwui/FrameInfo.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/hwui/FrameInfo.h b/libs/hwui/FrameInfo.h
index 6815254..23339ce 100644
--- a/libs/hwui/FrameInfo.h
+++ b/libs/hwui/FrameInfo.h
@@ -116,16 +116,28 @@ public:
set(FrameInfoIndex::Flags) |= static_cast<uint64_t>(frameInfoFlag);
}
- int64_t operator[](FrameInfoIndex index) const {
+ inline int64_t operator[](FrameInfoIndex index) const {
if (index == FrameInfoIndex::NumIndexes) return 0;
return mFrameInfo[static_cast<int>(index)];
}
- int64_t operator[](int index) const {
+ inline int64_t operator[](int index) const {
if (index < 0 || index >= static_cast<int>(FrameInfoIndex::NumIndexes)) return 0;
return mFrameInfo[index];
}
+ inline int64_t duration(FrameInfoIndex start, FrameInfoIndex end) const {
+ int64_t endtime = mFrameInfo[static_cast<int>(end)];
+ int64_t starttime = mFrameInfo[static_cast<int>(start)];
+ int64_t gap = endtime - starttime;
+ gap = starttime > 0 ? gap : 0;
+ return gap > 0 ? gap : 0;
+ }
+
+ inline int64_t totalDuration() const {
+ return duration(FrameInfoIndex::IntendedVsync, FrameInfoIndex::FrameCompleted);
+ }
+
private:
inline int64_t& set(FrameInfoIndex index) {
return mFrameInfo[static_cast<int>(index)];