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

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

Issue 1165853002: Pipe impl_latency_takes_priority_ to the RenderScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 6 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
« no previous file with comments | « cc/output/begin_frame_args.h ('k') | cc/output/begin_frame_args_unittest.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/trace_event/trace_event_argument.h" 7 #include "base/trace_event/trace_event_argument.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 const char* BeginFrameArgs::TypeToString(BeginFrameArgsType type) { 11 const char* BeginFrameArgs::TypeToString(BeginFrameArgsType type) {
12 switch (type) { 12 switch (type) {
13 case BeginFrameArgs::INVALID: 13 case BeginFrameArgs::INVALID:
14 return "INVALID"; 14 return "INVALID";
15 case BeginFrameArgs::NORMAL: 15 case BeginFrameArgs::NORMAL:
16 return "NORMAL"; 16 return "NORMAL";
17 case BeginFrameArgs::MISSED: 17 case BeginFrameArgs::MISSED:
18 return "MISSED"; 18 return "MISSED";
19 case BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX: 19 case BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX:
20 return "BEGIN_FRAME_ARGS_TYPE_MAX"; 20 return "BEGIN_FRAME_ARGS_TYPE_MAX";
21 } 21 }
22 NOTREACHED(); 22 NOTREACHED();
23 return "???"; 23 return "???";
24 } 24 }
25 25
26 BeginFrameArgs::BeginFrameArgs() 26 BeginFrameArgs::BeginFrameArgs()
27 : frame_time(base::TimeTicks()), 27 : frame_time(base::TimeTicks()),
28 deadline(base::TimeTicks()), 28 deadline(base::TimeTicks()),
29 interval(base::TimeDelta::FromMicroseconds(-1)), 29 interval(base::TimeDelta::FromMicroseconds(-1)),
30 type(BeginFrameArgs::INVALID) { 30 type(BeginFrameArgs::INVALID),
31 on_critical_path(true) {
31 } 32 }
32 33
33 BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time, 34 BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time,
34 base::TimeTicks deadline, 35 base::TimeTicks deadline,
35 base::TimeDelta interval, 36 base::TimeDelta interval,
36 BeginFrameArgs::BeginFrameArgsType type) 37 BeginFrameArgs::BeginFrameArgsType type)
37 : frame_time(frame_time), 38 : frame_time(frame_time),
38 deadline(deadline), 39 deadline(deadline),
39 interval(interval), 40 interval(interval),
40 type(type) { 41 type(type),
42 on_critical_path(true) {
41 } 43 }
42 44
43 BeginFrameArgs BeginFrameArgs::Create(BeginFrameArgs::CreationLocation location, 45 BeginFrameArgs BeginFrameArgs::Create(BeginFrameArgs::CreationLocation location,
44 base::TimeTicks frame_time, 46 base::TimeTicks frame_time,
45 base::TimeTicks deadline, 47 base::TimeTicks deadline,
46 base::TimeDelta interval, 48 base::TimeDelta interval,
47 BeginFrameArgs::BeginFrameArgsType type) { 49 BeginFrameArgs::BeginFrameArgsType type) {
48 DCHECK_NE(type, BeginFrameArgs::INVALID); 50 DCHECK_NE(type, BeginFrameArgs::INVALID);
49 DCHECK_NE(type, BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX); 51 DCHECK_NE(type, BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX);
50 #ifdef NDEBUG 52 #ifdef NDEBUG
(...skipping 15 matching lines...) Expand all
66 68
67 void BeginFrameArgs::AsValueInto(base::trace_event::TracedValue* state) const { 69 void BeginFrameArgs::AsValueInto(base::trace_event::TracedValue* state) const {
68 state->SetString("type", "BeginFrameArgs"); 70 state->SetString("type", "BeginFrameArgs");
69 state->SetString("subtype", TypeToString(type)); 71 state->SetString("subtype", TypeToString(type));
70 state->SetDouble("frame_time_us", frame_time.ToInternalValue()); 72 state->SetDouble("frame_time_us", frame_time.ToInternalValue());
71 state->SetDouble("deadline_us", deadline.ToInternalValue()); 73 state->SetDouble("deadline_us", deadline.ToInternalValue());
72 state->SetDouble("interval_us", interval.InMicroseconds()); 74 state->SetDouble("interval_us", interval.InMicroseconds());
73 #ifndef NDEBUG 75 #ifndef NDEBUG
74 state->SetString("created_from", created_from.ToString()); 76 state->SetString("created_from", created_from.ToString());
75 #endif 77 #endif
78 state->SetBoolean("on_critical_path", on_critical_path);
76 } 79 }
77 80
78 // This is a hard-coded deadline adjustment that assumes 60Hz, to be used in 81 // This is a hard-coded deadline adjustment that assumes 60Hz, to be used in
79 // cases where a good estimated draw time is not known. Using 1/3 of the vsync 82 // cases where a good estimated draw time is not known. Using 1/3 of the vsync
80 // as the default adjustment gives the Browser the last 1/3 of a frame to 83 // as the default adjustment gives the Browser the last 1/3 of a frame to
81 // produce output, the Renderer Impl thread the middle 1/3 of a frame to produce 84 // produce output, the Renderer Impl thread the middle 1/3 of a frame to produce
82 // ouput, and the Renderer Main thread the first 1/3 of a frame to produce 85 // ouput, and the Renderer Main thread the first 1/3 of a frame to produce
83 // output. 86 // output.
84 base::TimeDelta BeginFrameArgs::DefaultEstimatedParentDrawTime() { 87 base::TimeDelta BeginFrameArgs::DefaultEstimatedParentDrawTime() {
85 return base::TimeDelta::FromMicroseconds(16666 / 3); 88 return base::TimeDelta::FromMicroseconds(16666 / 3);
86 } 89 }
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 } // namespace cc 95 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/begin_frame_args.h ('k') | cc/output/begin_frame_args_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698