| OLD | NEW |
| 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 #include "cc/ipc/compositor_frame_metadata_struct_traits.h" | 5 #include "cc/ipc/compositor_frame_metadata_struct_traits.h" |
| 6 #include "cc/ipc/selection_struct_traits.h" | 6 #include "cc/ipc/selection_struct_traits.h" |
| 7 #include "cc/ipc/surface_id_struct_traits.h" | 7 #include "cc/ipc/surface_id_struct_traits.h" |
| 8 #include "ui/events/mojo/latency_info_struct_traits.h" | 8 #include "ui/events/mojo/latency_info_struct_traits.h" |
| 9 #include "ui/gfx/mojo/selection_bound_struct_traits.h" | 9 #include "ui/gfx/mojo/selection_bound_struct_traits.h" |
| 10 | 10 |
| 11 namespace mojo { | 11 namespace mojo { |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 bool StructTraits<cc::mojom::CompositorFrameMetadata, | 14 bool StructTraits<cc::mojom::CompositorFrameMetadataDataView, |
| 15 cc::CompositorFrameMetadata>:: | 15 cc::CompositorFrameMetadata>:: |
| 16 Read(cc::mojom::CompositorFrameMetadataDataView data, | 16 Read(cc::mojom::CompositorFrameMetadataDataView data, |
| 17 cc::CompositorFrameMetadata* out) { | 17 cc::CompositorFrameMetadata* out) { |
| 18 out->device_scale_factor = data.device_scale_factor(); | 18 out->device_scale_factor = data.device_scale_factor(); |
| 19 if (!data.ReadRootScrollOffset(&out->root_scroll_offset)) | 19 if (!data.ReadRootScrollOffset(&out->root_scroll_offset)) |
| 20 return false; | 20 return false; |
| 21 | 21 |
| 22 out->page_scale_factor = data.page_scale_factor(); | 22 out->page_scale_factor = data.page_scale_factor(); |
| 23 if (!data.ReadScrollableViewportSize(&out->scrollable_viewport_size) || | 23 if (!data.ReadScrollableViewportSize(&out->scrollable_viewport_size) || |
| 24 !data.ReadRootLayerSize(&out->root_layer_size)) { | 24 !data.ReadRootLayerSize(&out->root_layer_size)) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 out->bottom_controls_shown_ratio = data.bottom_controls_shown_ratio(); | 38 out->bottom_controls_shown_ratio = data.bottom_controls_shown_ratio(); |
| 39 | 39 |
| 40 out->root_background_color = data.root_background_color(); | 40 out->root_background_color = data.root_background_color(); |
| 41 return data.ReadSelection(&out->selection) && | 41 return data.ReadSelection(&out->selection) && |
| 42 data.ReadLatencyInfo(&out->latency_info) && | 42 data.ReadLatencyInfo(&out->latency_info) && |
| 43 data.ReadSatisfiesSequences(&out->satisfies_sequences) && | 43 data.ReadSatisfiesSequences(&out->satisfies_sequences) && |
| 44 data.ReadReferencedSurfaces(&out->referenced_surfaces); | 44 data.ReadReferencedSurfaces(&out->referenced_surfaces); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace mojo | 47 } // namespace mojo |
| OLD | NEW |