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

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

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « cc/output/begin_frame_args.h ('k') | cc/output/renderer_pixeltest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/debug/trace_event_argument.h" 7 #include "base/debug/trace_event_argument.h"
8 #include "ui/gfx/frame_time.h" 8 #include "ui/gfx/frame_time.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 const char* BeginFrameArgs::TypeToString(BeginFrameArgsType type) { 12 const char* BeginFrameArgs::TypeToString(BeginFrameArgsType type) {
13 switch (type) { 13 switch (type) {
14 case BeginFrameArgs::INVALID: 14 case BeginFrameArgs::INVALID:
15 return "INVALID"; 15 return "INVALID";
16 case BeginFrameArgs::NORMAL: 16 case BeginFrameArgs::NORMAL:
17 return "NORMAL"; 17 return "NORMAL";
18 case BeginFrameArgs::SYNCHRONOUS: 18 case BeginFrameArgs::SYNCHRONOUS:
19 return "SYNCHRONOUS"; 19 return "SYNCHRONOUS";
20 case BeginFrameArgs::MISSED: 20 case BeginFrameArgs::MISSED:
21 return "MISSED"; 21 return "MISSED";
22 case BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX:
23 return "BEGIN_FRAME_ARGS_TYPE_MAX";
22 } 24 }
23 NOTREACHED(); 25 NOTREACHED();
24 return "???"; 26 return "???";
25 } 27 }
26 28
27 BeginFrameArgs::BeginFrameArgs() 29 BeginFrameArgs::BeginFrameArgs()
28 : frame_time(base::TimeTicks()), 30 : frame_time(base::TimeTicks()),
29 deadline(base::TimeTicks()), 31 deadline(base::TimeTicks()),
30 interval(base::TimeDelta::FromMicroseconds(-1)), 32 interval(base::TimeDelta::FromMicroseconds(-1)),
31 type(BeginFrameArgs::INVALID) { 33 type(BeginFrameArgs::INVALID) {
32 } 34 }
33 35
34 BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time, 36 BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time,
35 base::TimeTicks deadline, 37 base::TimeTicks deadline,
36 base::TimeDelta interval, 38 base::TimeDelta interval,
37 BeginFrameArgs::BeginFrameArgsType type) 39 BeginFrameArgs::BeginFrameArgsType type)
38 : frame_time(frame_time), 40 : frame_time(frame_time),
39 deadline(deadline), 41 deadline(deadline),
40 interval(interval), 42 interval(interval),
41 type(type) { 43 type(type) {
42 } 44 }
43 45
44 BeginFrameArgs BeginFrameArgs::Create(BeginFrameArgs::CreationLocation location, 46 BeginFrameArgs BeginFrameArgs::Create(BeginFrameArgs::CreationLocation location,
45 base::TimeTicks frame_time, 47 base::TimeTicks frame_time,
46 base::TimeTicks deadline, 48 base::TimeTicks deadline,
47 base::TimeDelta interval, 49 base::TimeDelta interval,
48 BeginFrameArgs::BeginFrameArgsType type) { 50 BeginFrameArgs::BeginFrameArgsType type) {
49 DCHECK_NE(type, BeginFrameArgs::INVALID); 51 DCHECK_NE(type, BeginFrameArgs::INVALID);
52 DCHECK_NE(type, BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX);
50 #ifdef NDEBUG 53 #ifdef NDEBUG
51 return BeginFrameArgs(frame_time, deadline, interval, type); 54 return BeginFrameArgs(frame_time, deadline, interval, type);
52 #else 55 #else
53 BeginFrameArgs args = BeginFrameArgs(frame_time, deadline, interval, type); 56 BeginFrameArgs args = BeginFrameArgs(frame_time, deadline, interval, type);
54 args.created_from = location; 57 args.created_from = location;
55 return args; 58 return args;
56 #endif 59 #endif
57 } 60 }
58 61
59 scoped_refptr<base::debug::ConvertableToTraceFormat> BeginFrameArgs::AsValue() 62 scoped_refptr<base::debug::ConvertableToTraceFormat> BeginFrameArgs::AsValue()
(...skipping 27 matching lines...) Expand all
87 90
88 base::TimeDelta BeginFrameArgs::DefaultInterval() { 91 base::TimeDelta BeginFrameArgs::DefaultInterval() {
89 return base::TimeDelta::FromMicroseconds(16666); 92 return base::TimeDelta::FromMicroseconds(16666);
90 } 93 }
91 94
92 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() { 95 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() {
93 return base::TimeDelta::FromMicroseconds(4444); 96 return base::TimeDelta::FromMicroseconds(4444);
94 } 97 }
95 98
96 } // namespace cc 99 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/begin_frame_args.h ('k') | cc/output/renderer_pixeltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698