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