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

Unified Diff: cc/output/output_surface.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: Fix DCHECK 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/output/begin_frame_args.cc ('k') | cc/output/output_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/output_surface.cc
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
index 774173a9773041265e8baab74eb64d7dcafb77a1..002a44a37eb3f2a5f3ceaa437d959f006402321b 100644
--- a/cc/output/output_surface.cc
+++ b/cc/output/output_surface.cc
@@ -25,6 +25,7 @@
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
+#include "ui/gfx/frame_time.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
@@ -95,9 +96,12 @@ void OutputSurface::InitializeBeginImplFrameEmulation(
bool throttle_frame_production,
base::TimeDelta interval) {
if (throttle_frame_production) {
- frame_rate_controller_.reset(
- new FrameRateController(
- DelayBasedTimeSource::Create(interval, task_runner)));
+ scoped_refptr<DelayBasedTimeSource> time_source;
+ if (gfx::FrameTime::TimestampsAreHighRes())
+ time_source = DelayBasedTimeSourceHighRes::Create(interval, task_runner);
+ else
+ time_source = DelayBasedTimeSource::Create(interval, task_runner);
+ frame_rate_controller_.reset(new FrameRateController(time_source));
} else {
frame_rate_controller_.reset(new FrameRateController(task_runner));
}
@@ -200,7 +204,7 @@ void OutputSurface::PostCheckForRetroactiveBeginImplFrame() {
void OutputSurface::CheckForRetroactiveBeginImplFrame() {
TRACE_EVENT0("cc", "OutputSurface::CheckForRetroactiveBeginImplFrame");
check_for_retroactive_begin_impl_frame_pending_ = false;
- if (base::TimeTicks::Now() < RetroactiveBeginImplFrameDeadline())
+ if (gfx::FrameTime::Now() < RetroactiveBeginImplFrameDeadline())
BeginImplFrame(skipped_begin_impl_frame_args_);
}
« no previous file with comments | « cc/output/begin_frame_args.cc ('k') | cc/output/output_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698