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

Side by Side Diff: cc/output/begin_frame_args.cc

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: Rebase; Avoid double activate; Fix OutputSurface init and page scroll delta; Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/begin_frame_args.h" 5 #include "cc/output/begin_frame_args.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 BeginFrameArgs::BeginFrameArgs() 9 BeginFrameArgs::BeginFrameArgs()
10 : frame_time(base::TimeTicks()), 10 : frame_time(base::TimeTicks()),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 BeginFrameArgs BeginFrameArgs::CreateExpiredForTesting() { 44 BeginFrameArgs BeginFrameArgs::CreateExpiredForTesting() {
45 base::TimeTicks now = base::TimeTicks::Now(); 45 base::TimeTicks now = base::TimeTicks::Now();
46 return BeginFrameArgs(now, 46 return BeginFrameArgs(now,
47 now - DefaultInterval(), 47 now - DefaultInterval(),
48 DefaultInterval()); 48 DefaultInterval());
49 } 49 }
50 50
51 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() { 51 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() {
52 // Using a large deadline adjustment will effectively revert BeginFrame 52 return base::TimeDelta::FromMicroseconds(-16666/3);
53 // scheduling to the hard vsync scheduling we used to have.
54 return base::TimeDelta::FromSeconds(-1);
55 } 53 }
56 54
57 base::TimeDelta BeginFrameArgs::DefaultInterval() { 55 base::TimeDelta BeginFrameArgs::DefaultInterval() {
58 return base::TimeDelta::FromMicroseconds(16666); 56 return base::TimeDelta::FromMicroseconds(16666);
59 } 57 }
60 58
61 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() { 59 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() {
62 return base::TimeDelta::FromMicroseconds(4444); 60 return base::TimeDelta::FromMicroseconds(4444);
63 } 61 }
64 62
65 63
64 void BeginFrameArgs::AdjustDeadline(base::TimeDelta delta) {
65 #if defined(OS_ANDROID)
66 deadline += delta;
67 #else
68 deadline = base::TimeTicks();
69 #endif
70 }
71
72
66 } // namespace cc 73 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698