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

Side by Side Diff: cc/ipc/begin_frame_args_struct_traits.h

Issue 2591013004: [cc] Add and use BeginFrameAck for DidFinishFrame. (Closed)
Patch Set: make time advancement explicit in DisplaySchedulerTests. Created 3 years, 11 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/ipc/begin_frame_args.typemap ('k') | cc/ipc/cc_param_traits_macros.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ 5 #ifndef CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_
6 #define CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ 6 #define CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_
7 7
8 #include "cc/ipc/begin_frame_args.mojom-shared.h" 8 #include "cc/ipc/begin_frame_args.mojom-shared.h"
9 #include "cc/output/begin_frame_args.h" 9 #include "cc/output/begin_frame_args.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 out->source_id = data.source_id(); 50 out->source_id = data.source_id();
51 out->sequence_number = data.sequence_number(); 51 out->sequence_number = data.sequence_number();
52 out->type = 52 out->type =
53 static_cast<cc::BeginFrameArgs::BeginFrameArgsType>(data.type()); 53 static_cast<cc::BeginFrameArgs::BeginFrameArgsType>(data.type());
54 out->on_critical_path = data.on_critical_path(); 54 out->on_critical_path = data.on_critical_path();
55 return true; 55 return true;
56 } 56 }
57 }; 57 };
58 58
59 template <>
60 struct StructTraits<cc::mojom::BeginFrameAckDataView, cc::BeginFrameAck> {
61 static uint64_t sequence_number(const cc::BeginFrameAck& ack) {
62 return ack.sequence_number;
63 }
64
65 static uint64_t latest_confirmed_sequence_number(
66 const cc::BeginFrameAck& ack) {
67 return ack.latest_confirmed_sequence_number;
68 }
69
70 static uint32_t source_id(const cc::BeginFrameAck& ack) {
71 return ack.source_id;
72 }
73
74 static uint32_t remaining_frames(const cc::BeginFrameAck& ack) {
75 return ack.remaining_frames;
76 }
77
78 static bool has_damage(const cc::BeginFrameAck& ack) {
79 return ack.has_damage;
80 }
81
82 static bool Read(cc::mojom::BeginFrameAckDataView data,
83 cc::BeginFrameAck* out) {
dcheng 2017/01/05 06:49:54 Nit: Read() methods should generally out-of-lined,
Eric Seckler 2017/01/06 16:08:51 will do when we add it back in a later CL :)
84 out->source_id = data.source_id();
85 out->sequence_number = data.sequence_number();
86 out->latest_confirmed_sequence_number =
87 data.latest_confirmed_sequence_number();
88 out->remaining_frames = data.remaining_frames();
89 out->has_damage = data.has_damage();
90 return true;
91 }
92 };
93
59 } // namespace mojo 94 } // namespace mojo
60 95
61 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ 96 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « cc/ipc/begin_frame_args.typemap ('k') | cc/ipc/cc_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698