Chromium Code Reviews| 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.h" | 10 #include "cc/ipc/quads.mojom.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 cc::YUVVideoDrawQuad::MaterialCast(&input); | 379 cc::YUVVideoDrawQuad::MaterialCast(&input); |
| 380 return quad->resource_offset; | 380 return quad->resource_offset; |
| 381 } | 381 } |
| 382 | 382 |
| 383 static float resource_multiplier(const cc::DrawQuad& input) { | 383 static float resource_multiplier(const cc::DrawQuad& input) { |
| 384 const cc::YUVVideoDrawQuad* quad = | 384 const cc::YUVVideoDrawQuad* quad = |
| 385 cc::YUVVideoDrawQuad::MaterialCast(&input); | 385 cc::YUVVideoDrawQuad::MaterialCast(&input); |
| 386 return quad->resource_multiplier; | 386 return quad->resource_multiplier; |
| 387 } | 387 } |
| 388 | 388 |
| 389 static float bits_per_channel(const cc::DrawQuad& input) { | |
|
dcheng
2016/07/28 01:54:26
Isn't this a uint32 / int?
| |
| 390 const cc::YUVVideoDrawQuad* quad = | |
| 391 cc::YUVVideoDrawQuad::MaterialCast(&input); | |
| 392 return quad->bits_per_channel; | |
| 393 } | |
| 394 | |
| 389 static bool Read(cc::mojom::YUVVideoQuadStateDataView data, | 395 static bool Read(cc::mojom::YUVVideoQuadStateDataView data, |
| 390 cc::DrawQuad* out); | 396 cc::DrawQuad* out); |
| 391 }; | 397 }; |
| 392 | 398 |
| 393 template <> | 399 template <> |
| 394 struct StructTraits<cc::mojom::DrawQuad, cc::DrawQuad> { | 400 struct StructTraits<cc::mojom::DrawQuad, cc::DrawQuad> { |
| 395 static cc::DrawQuad::Material material(const cc::DrawQuad& quad) { | 401 static cc::DrawQuad::Material material(const cc::DrawQuad& quad) { |
| 396 return quad.material; | 402 return quad.material; |
| 397 } | 403 } |
| 398 | 404 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 void* context); | 488 void* context); |
| 483 static QuadListArray quads(const cc::QuadList& quad_list) { | 489 static QuadListArray quads(const cc::QuadList& quad_list) { |
| 484 return {quad_list.size(), const_cast<cc::QuadList*>(&quad_list)}; | 490 return {quad_list.size(), const_cast<cc::QuadList*>(&quad_list)}; |
| 485 } | 491 } |
| 486 static bool Read(cc::mojom::QuadListDataView data, cc::QuadList* out); | 492 static bool Read(cc::mojom::QuadListDataView data, cc::QuadList* out); |
| 487 }; | 493 }; |
| 488 | 494 |
| 489 } // namespace mojo | 495 } // namespace mojo |
| 490 | 496 |
| 491 #endif // CC_IPC_QUADS_STRUCT_TRAITS_H_ | 497 #endif // CC_IPC_QUADS_STRUCT_TRAITS_H_ |
| OLD | NEW |