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

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

Issue 2591013004: [cc] Add and use BeginFrameAck for DidFinishFrame. (Closed)
Patch Set: . Created 3 years, 12 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 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 source_id(const cc::BeginFrameAck& ack) {
62 return ack.source_id;
63 }
64
65 static uint64_t sequence_number(const cc::BeginFrameAck& ack) {
66 return ack.sequence_number;
67 }
68
69 static uint64_t latest_confirmed_frame(const cc::BeginFrameAck& ack) {
70 return ack.latest_confirmed_frame;
71 }
72
73 static uint32_t remaining_frames(const cc::BeginFrameAck& ack) {
74 return ack.remaining_frames;
75 }
76
77 static bool has_damage(const cc::BeginFrameAck& ack) {
78 return ack.has_damage;
79 }
80
81 static bool Read(cc::mojom::BeginFrameAckDataView data,
82 cc::BeginFrameAck* out) {
83 out->source_id = data.source_id();
84 out->sequence_number = data.sequence_number();
85 out->latest_confirmed_frame = data.latest_confirmed_frame();
86 out->remaining_frames = data.remaining_frames();
87 out->has_damage = data.has_damage();
88 return true;
89 }
90 };
91
59 } // namespace mojo 92 } // namespace mojo
60 93
61 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ 94 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698