Change swap chain stuffed detection logic

bug:29771461
bug:29413700
bug:30181577

Changes frame interval gap detection to look for wider gaps, as they
were incorrectly firing all the time.

Also adds a 500ms minimum gap between frames dropped because of stuffed
swap chain, to prevent dropping too often.

Change-Id: If16ed637d54bf37015704be102c5c2e3731a0824
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index b0d980b..3eef29b 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -208,6 +208,9 @@
     RingBuffer<SwapHistory, 3> mSwapHistory;
     int64_t mFrameNumber = -1;
 
+    // last vsync for a dropped frame due to stuffed queue
+    nsecs_t mLastDropVsync = 0;
+
     bool mOpaque;
 #if HWUI_NEW_OPS
     BakedOpRenderer::LightInfo mLightInfo;