| 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 #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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 static bool root_overflow_x_hidden( | 50 static bool root_overflow_x_hidden( |
| 51 const cc::CompositorFrameMetadata& metadata) { | 51 const cc::CompositorFrameMetadata& metadata) { |
| 52 return metadata.root_overflow_x_hidden; | 52 return metadata.root_overflow_x_hidden; |
| 53 } | 53 } |
| 54 | 54 |
| 55 static bool root_overflow_y_hidden( | 55 static bool root_overflow_y_hidden( |
| 56 const cc::CompositorFrameMetadata& metadata) { | 56 const cc::CompositorFrameMetadata& metadata) { |
| 57 return metadata.root_overflow_y_hidden; | 57 return metadata.root_overflow_y_hidden; |
| 58 } | 58 } |
| 59 | 59 |
| 60 static gfx::Vector2dF location_bar_offset( | 60 static gfx::Vector2dF top_bar_translate( |
| 61 const cc::CompositorFrameMetadata& metadata) { | 61 const cc::CompositorFrameMetadata& metadata) { |
| 62 return metadata.location_bar_offset; | 62 return metadata.top_bar_translate; |
| 63 } | 63 } |
| 64 | 64 |
| 65 static gfx::Vector2dF location_bar_content_translation( | 65 static gfx::Vector2dF top_bar_shown( |
| 66 const cc::CompositorFrameMetadata& metadata) { | 66 const cc::CompositorFrameMetadata& metadata) { |
| 67 return metadata.location_bar_content_translation; | 67 return metadata.top_bar_shown; |
| 68 } |
| 69 |
| 70 static gfx::Vector2dF bottom_bar_translate( |
| 71 const cc::CompositorFrameMetadata& metadata) { |
| 72 return metadata.bottom_bar_translate; |
| 73 } |
| 74 |
| 75 static gfx::Vector2dF bottom_bar_shown( |
| 76 const cc::CompositorFrameMetadata& metadata) { |
| 77 return metadata.bottom_bar_shown; |
| 68 } | 78 } |
| 69 | 79 |
| 70 static uint32_t root_background_color( | 80 static uint32_t root_background_color( |
| 71 const cc::CompositorFrameMetadata& metadata) { | 81 const cc::CompositorFrameMetadata& metadata) { |
| 72 return metadata.root_background_color; | 82 return metadata.root_background_color; |
| 73 } | 83 } |
| 74 | 84 |
| 75 static const cc::Selection<gfx::SelectionBound>& selection( | 85 static const cc::Selection<gfx::SelectionBound>& selection( |
| 76 const cc::CompositorFrameMetadata& metadata) { | 86 const cc::CompositorFrameMetadata& metadata) { |
| 77 return metadata.selection; | 87 return metadata.selection; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 101 out->page_scale_factor = data.page_scale_factor(); | 111 out->page_scale_factor = data.page_scale_factor(); |
| 102 if (!data.ReadScrollableViewportSize(&out->scrollable_viewport_size) || | 112 if (!data.ReadScrollableViewportSize(&out->scrollable_viewport_size) || |
| 103 !data.ReadRootLayerSize(&out->root_layer_size)) { | 113 !data.ReadRootLayerSize(&out->root_layer_size)) { |
| 104 return false; | 114 return false; |
| 105 } | 115 } |
| 106 | 116 |
| 107 out->min_page_scale_factor = data.min_page_scale_factor(); | 117 out->min_page_scale_factor = data.min_page_scale_factor(); |
| 108 out->max_page_scale_factor = data.max_page_scale_factor(); | 118 out->max_page_scale_factor = data.max_page_scale_factor(); |
| 109 out->root_overflow_x_hidden = data.root_overflow_x_hidden(); | 119 out->root_overflow_x_hidden = data.root_overflow_x_hidden(); |
| 110 out->root_overflow_y_hidden = data.root_overflow_y_hidden(); | 120 out->root_overflow_y_hidden = data.root_overflow_y_hidden(); |
| 111 if (!data.ReadLocationBarOffset(&out->location_bar_offset) || | 121 if (!data.ReadTopBarTranslate(&out->top_bar_translate) || |
| 112 !data.ReadLocationBarContentTranslation( | 122 !data.ReadTopBarShown(&out->top_bar_shown)) { |
| 113 &out->location_bar_content_translation)) { | |
| 114 return false; | 123 return false; |
| 115 } | 124 } |
| 116 | 125 |
| 117 out->root_background_color = data.root_background_color(); | 126 out->root_background_color = data.root_background_color(); |
| 118 if (!data.ReadSelection(&out->selection) || | 127 if (!data.ReadSelection(&out->selection) || |
| 119 !data.ReadLatencyInfo(&out->latency_info) || | 128 !data.ReadLatencyInfo(&out->latency_info) || |
| 120 !data.ReadSatisfiesSequences(&out->satisfies_sequences) || | 129 !data.ReadSatisfiesSequences(&out->satisfies_sequences) || |
| 121 !data.ReadReferencedSurfaces(&out->referenced_surfaces)) { | 130 !data.ReadReferencedSurfaces(&out->referenced_surfaces)) { |
| 122 return false; | 131 return false; |
| 123 } | 132 } |
| 124 return true; | 133 return true; |
| 125 } | 134 } |
| 126 }; | 135 }; |
| 127 | 136 |
| 128 } // namespace mojo | 137 } // namespace mojo |
| 129 | 138 |
| 130 #endif // CC_IPC_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_ | 139 #endif // CC_IPC_COMPOSITOR_FRAME_METADATA_STRUCT_TRAITS_H_ |
| OLD | NEW |