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

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

Issue 2092843002: Implement CompositorFrame Struct Traits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed dcheng's comments Created 4 years, 5 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_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_ 5 #ifndef CC_IPC_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_
6 #define CC_IPC_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_ 6 #define CC_IPC_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_
7 7
8 #include "cc/ipc/compositor_frame_metadata.mojom.h" 8 #include "cc/ipc/compositor_frame_metadata.mojom.h"
9 #include "cc/output/compositor_frame_metadata.h" 9 #include "cc/output/compositor_frame_metadata.h"
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 const cc::CompositorFrameMetadata& metadata) { 86 const cc::CompositorFrameMetadata& metadata) {
87 return metadata.satisfies_sequences; 87 return metadata.satisfies_sequences;
88 } 88 }
89 89
90 static const std::vector<cc::SurfaceId>& referenced_surfaces( 90 static const std::vector<cc::SurfaceId>& referenced_surfaces(
91 const cc::CompositorFrameMetadata& metadata) { 91 const cc::CompositorFrameMetadata& metadata) {
92 return metadata.referenced_surfaces; 92 return metadata.referenced_surfaces;
93 } 93 }
94 94
95 static bool Read(cc::mojom::CompositorFrameMetadataDataView data, 95 static bool Read(cc::mojom::CompositorFrameMetadataDataView data,
96 cc::CompositorFrameMetadata* out) { 96 cc::CompositorFrameMetadata* out);
97 out->device_scale_factor = data.device_scale_factor();
98 if (!data.ReadRootScrollOffset(&out->root_scroll_offset))
99 return false;
100
101 out->page_scale_factor = data.page_scale_factor();
102 if (!data.ReadScrollableViewportSize(&out->scrollable_viewport_size) ||
103 !data.ReadRootLayerSize(&out->root_layer_size)) {
104 return false;
105 }
106
107 out->min_page_scale_factor = data.min_page_scale_factor();
108 out->max_page_scale_factor = data.max_page_scale_factor();
109 out->root_overflow_x_hidden = data.root_overflow_x_hidden();
110 out->root_overflow_y_hidden = data.root_overflow_y_hidden();
111 if (!data.ReadLocationBarOffset(&out->location_bar_offset) ||
112 !data.ReadLocationBarContentTranslation(
113 &out->location_bar_content_translation)) {
114 return false;
115 }
116
117 out->root_background_color = data.root_background_color();
118 if (!data.ReadSelection(&out->selection) ||
119 !data.ReadLatencyInfo(&out->latency_info) ||
120 !data.ReadSatisfiesSequences(&out->satisfies_sequences) ||
121 !data.ReadReferencedSurfaces(&out->referenced_surfaces)) {
122 return false;
123 }
124 return true;
125 }
126 }; 97 };
127 98
128 } // namespace mojo 99 } // namespace mojo
129 100
130 #endif // CC_IPC_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_ 101 #endif // CC_IPC_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « cc/ipc/compositor_frame_metadata.typemap ('k') | cc/ipc/compositor_frame_metadata_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698