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

Unified Diff: cc/scheduler/frame_rate_controller.cc

Issue 27710005: cc: Use HighResNow as timebase if it is fast and reliable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add missing include Created 7 years, 2 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
« no previous file with comments | « cc/scheduler/delay_based_time_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/frame_rate_controller.cc
diff --git a/cc/scheduler/frame_rate_controller.cc b/cc/scheduler/frame_rate_controller.cc
index 47c27ed3f8e41c42753bab991df299a05330aaa9..ab5af653bd43b33ddbbec6e8c8de1ebb59f79594 100644
--- a/cc/scheduler/frame_rate_controller.cc
+++ b/cc/scheduler/frame_rate_controller.cc
@@ -11,6 +11,7 @@
#include "base/single_thread_task_runner.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "cc/scheduler/time_source.h"
+#include "ui/gfx/frame_time.h"
namespace cc {
@@ -96,6 +97,9 @@ void FrameRateController::SetMaxSwapsPending(int max_swaps_pending) {
void FrameRateController::SetTimebaseAndInterval(base::TimeTicks timebase,
base::TimeDelta interval) {
+ if (!gfx::FrameTime::TimestampsAreHighRes())
+ timebase = base::TimeTicks();
piman 2013/10/23 00:03:45 mmh, aren't we losing functionality here? Should w
brianderson 2013/10/23 13:04:43 The problem is that the DWM API's on Windows only
piman 2013/10/23 23:45:08 If 0 is ok, then can we make the producer of the t
brianderson 2013/10/24 11:26:52 Sounds good. I will change the patch.
+
interval_ = interval;
if (is_time_source_throttling_)
time_source_->SetTimebaseAndInterval(timebase, interval);
@@ -165,7 +169,7 @@ base::TimeTicks FrameRateController::LastTickTime() {
if (is_time_source_throttling_)
return time_source_->LastTickTime();
- return base::TimeTicks::Now();
+ return gfx::FrameTime::Now();
}
} // namespace cc
« no previous file with comments | « cc/scheduler/delay_based_time_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698