Iterate step of launch & iterate

Bug: 18052916

Tweaked colors, merged some categories
Reduced significance of fast frames
Increased visual weight of janky frames

Change-Id: I5b4e86164c4d51debad7de0e0f8715dda34c7a60
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 @@
         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)];