| 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_QUADS_STRUCT_TRAITS_H_ | 5 #ifndef CC_IPC_QUADS_STRUCT_TRAITS_H_ |
| 6 #define CC_IPC_QUADS_STRUCT_TRAITS_H_ | 6 #define CC_IPC_QUADS_STRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "cc/ipc/filter_operation_struct_traits.h" | 8 #include "cc/ipc/filter_operation_struct_traits.h" |
| 9 #include "cc/ipc/filter_operations_struct_traits.h" | 9 #include "cc/ipc/filter_operations_struct_traits.h" |
| 10 #include "cc/ipc/quads.mojom-shared.h" | 10 #include "cc/ipc/quads.mojom-shared.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 cc::RenderPassDrawQuad::MaterialCast(&input); | 151 cc::RenderPassDrawQuad::MaterialCast(&input); |
| 152 return quad->mask_uv_scale; | 152 return quad->mask_uv_scale; |
| 153 } | 153 } |
| 154 | 154 |
| 155 static const gfx::Size& mask_texture_size(const cc::DrawQuad& input) { | 155 static const gfx::Size& mask_texture_size(const cc::DrawQuad& input) { |
| 156 const cc::RenderPassDrawQuad* quad = | 156 const cc::RenderPassDrawQuad* quad = |
| 157 cc::RenderPassDrawQuad::MaterialCast(&input); | 157 cc::RenderPassDrawQuad::MaterialCast(&input); |
| 158 return quad->mask_texture_size; | 158 return quad->mask_texture_size; |
| 159 } | 159 } |
| 160 | 160 |
| 161 static const cc::FilterOperations& filters(const cc::DrawQuad& input) { | |
| 162 const cc::RenderPassDrawQuad* quad = | |
| 163 cc::RenderPassDrawQuad::MaterialCast(&input); | |
| 164 return quad->filters; | |
| 165 } | |
| 166 | |
| 167 static const gfx::Vector2dF& filters_scale(const cc::DrawQuad& input) { | 161 static const gfx::Vector2dF& filters_scale(const cc::DrawQuad& input) { |
| 168 const cc::RenderPassDrawQuad* quad = | 162 const cc::RenderPassDrawQuad* quad = |
| 169 cc::RenderPassDrawQuad::MaterialCast(&input); | 163 cc::RenderPassDrawQuad::MaterialCast(&input); |
| 170 return quad->filters_scale; | 164 return quad->filters_scale; |
| 171 } | 165 } |
| 172 | 166 |
| 173 static const gfx::PointF& filters_origin(const cc::DrawQuad& input) { | 167 static const gfx::PointF& filters_origin(const cc::DrawQuad& input) { |
| 174 const cc::RenderPassDrawQuad* quad = | 168 const cc::RenderPassDrawQuad* quad = |
| 175 cc::RenderPassDrawQuad::MaterialCast(&input); | 169 cc::RenderPassDrawQuad::MaterialCast(&input); |
| 176 return quad->filters_origin; | 170 return quad->filters_origin; |
| 177 } | 171 } |
| 178 | 172 |
| 179 static const cc::FilterOperations& background_filters( | |
| 180 const cc::DrawQuad& input) { | |
| 181 const cc::RenderPassDrawQuad* quad = | |
| 182 cc::RenderPassDrawQuad::MaterialCast(&input); | |
| 183 return quad->background_filters; | |
| 184 } | |
| 185 | |
| 186 static bool Read(cc::mojom::RenderPassQuadStateDataView data, | 173 static bool Read(cc::mojom::RenderPassQuadStateDataView data, |
| 187 cc::DrawQuad* out); | 174 cc::DrawQuad* out); |
| 188 }; | 175 }; |
| 189 | 176 |
| 190 template <> | 177 template <> |
| 191 struct StructTraits<cc::mojom::SolidColorQuadStateDataView, cc::DrawQuad> { | 178 struct StructTraits<cc::mojom::SolidColorQuadStateDataView, cc::DrawQuad> { |
| 192 static uint32_t color(const cc::DrawQuad& input) { | 179 static uint32_t color(const cc::DrawQuad& input) { |
| 193 const cc::SolidColorDrawQuad* quad = | 180 const cc::SolidColorDrawQuad* quad = |
| 194 cc::SolidColorDrawQuad::MaterialCast(&input); | 181 cc::SolidColorDrawQuad::MaterialCast(&input); |
| 195 return quad->color; | 182 return quad->color; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 dq.shared_quad_state = current_sqs; | 464 dq.shared_quad_state = current_sqs; |
| 478 return dq; | 465 return dq; |
| 479 } | 466 } |
| 480 | 467 |
| 481 static size_t GetSize(const cc::QuadList& input) { return input.size(); } | 468 static size_t GetSize(const cc::QuadList& input) { return input.size(); } |
| 482 }; | 469 }; |
| 483 | 470 |
| 484 } // namespace mojo | 471 } // namespace mojo |
| 485 | 472 |
| 486 #endif // CC_IPC_QUADS_STRUCT_TRAITS_H_ | 473 #endif // CC_IPC_QUADS_STRUCT_TRAITS_H_ |
| OLD | NEW |