Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: ui/android/java/src/org/chromium/ui/VSyncMonitor.java

Issue 2222073002: Use the frame time from Choreographer for computeScroll animation time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make it work for real Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/android/java/src/org/chromium/ui/VSyncMonitor.java
diff --git a/ui/android/java/src/org/chromium/ui/VSyncMonitor.java b/ui/android/java/src/org/chromium/ui/VSyncMonitor.java
index 281ed143c3f9299d42878f97486f7119d7292708..d43b040159af1a6b456a4c8330c0f8f3c8b2e4a6 100644
--- a/ui/android/java/src/org/chromium/ui/VSyncMonitor.java
+++ b/ui/android/java/src/org/chromium/ui/VSyncMonitor.java
@@ -17,6 +17,7 @@ import org.chromium.base.TraceEvent;
*/
public class VSyncMonitor {
private static final long NANOSECONDS_PER_SECOND = 1000000000;
+ private static final long NANOSECONDS_PER_MILLISECOND = 1000000;
private static final long NANOSECONDS_PER_MICROSECOND = 1000;
private boolean mInsideVSync = false;
@@ -116,6 +117,13 @@ public class VSyncMonitor {
return mInsideVSync;
}
+ /**
+ * @return the last VSync frame time in milli seconds.
+ */
+ public long getCurrentFrameTimeMillis() {
+ return mGoodStartingPointNano / NANOSECONDS_PER_MILLISECOND;
+ }
+
private long getCurrentNanoTime() {
return System.nanoTime();
}

Powered by Google App Engine
This is Rietveld 408576698