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_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ | 5 #ifndef CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ |
6 #define CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ | 6 #define CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "cc/ipc/shared_quad_state.mojom.h" | 8 #include "cc/ipc/shared_quad_state.mojom.h" |
9 #include "cc/quads/shared_quad_state.h" | 9 #include "cc/quads/shared_quad_state.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 | 12 |
13 template <> | 13 template <> |
14 struct StructTraits<cc::mojom::SharedQuadState, cc::SharedQuadState> { | 14 struct StructTraits<cc::mojom::SharedQuadState, cc::SharedQuadState> { |
15 static const gfx::Transform& quad_to_target_transform( | 15 static const gfx::Transform& quad_to_target_transform( |
16 const cc::SharedQuadState& sqs) { | 16 const cc::SharedQuadState& sqs) { |
17 return sqs.quad_to_target_transform; | 17 return sqs.quad_to_target_transform; |
18 } | 18 } |
19 | 19 |
20 static gfx::Size quad_layer_bounds(const cc::SharedQuadState& sqs) { | 20 static const gfx::Size& quad_layer_bounds(const cc::SharedQuadState& sqs) { |
21 return sqs.quad_layer_bounds; | 21 return sqs.quad_layer_bounds; |
22 } | 22 } |
23 | 23 |
24 static gfx::Rect visible_quad_layer_rect(const cc::SharedQuadState& sqs) { | 24 static const gfx::Rect& visible_quad_layer_rect( |
| 25 const cc::SharedQuadState& sqs) { |
25 return sqs.visible_quad_layer_rect; | 26 return sqs.visible_quad_layer_rect; |
26 } | 27 } |
27 | 28 |
28 static gfx::Rect clip_rect(const cc::SharedQuadState& sqs) { | 29 static const gfx::Rect& clip_rect(const cc::SharedQuadState& sqs) { |
29 return sqs.clip_rect; | 30 return sqs.clip_rect; |
30 } | 31 } |
31 | 32 |
32 static bool is_clipped(const cc::SharedQuadState& sqs) { | 33 static bool is_clipped(const cc::SharedQuadState& sqs) { |
33 return sqs.is_clipped; | 34 return sqs.is_clipped; |
34 } | 35 } |
35 | 36 |
36 static float opacity(const cc::SharedQuadState& sqs) { return sqs.opacity; } | 37 static float opacity(const cc::SharedQuadState& sqs) { return sqs.opacity; } |
37 | 38 |
38 static uint32_t blend_mode(const cc::SharedQuadState& sqs) { | 39 static uint32_t blend_mode(const cc::SharedQuadState& sqs) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 static bool Read(cc::mojom::SharedQuadStateListDataView data, | 106 static bool Read(cc::mojom::SharedQuadStateListDataView data, |
106 cc::SharedQuadStateList* out) { | 107 cc::SharedQuadStateList* out) { |
107 SharedQuadStateListArray sqs_array = {out}; | 108 SharedQuadStateListArray sqs_array = {out}; |
108 return data.ReadSharedQuadStates(&sqs_array); | 109 return data.ReadSharedQuadStates(&sqs_array); |
109 } | 110 } |
110 }; | 111 }; |
111 | 112 |
112 } // namespace mojo | 113 } // namespace mojo |
113 | 114 |
114 #endif // CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ | 115 #endif // CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ |
OLD | NEW |