| 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 #include "cc/ipc/render_pass_struct_traits.h" | 5 #include "cc/ipc/render_pass_struct_traits.h" |
| 6 | 6 |
| 7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
| 8 #include "cc/ipc/shared_quad_state_struct_traits.h" | 8 #include "cc/ipc/shared_quad_state_struct_traits.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 bool StructTraits<cc::mojom::RenderPass, std::unique_ptr<cc::RenderPass>>::Read( | 13 bool StructTraits<cc::mojom::RenderPassDataView, |
| 14 cc::mojom::RenderPassDataView data, | 14 std::unique_ptr<cc::RenderPass>>:: |
| 15 std::unique_ptr<cc::RenderPass>* out) { | 15 Read(cc::mojom::RenderPassDataView data, |
| 16 std::unique_ptr<cc::RenderPass>* out) { |
| 16 *out = cc::RenderPass::Create(); | 17 *out = cc::RenderPass::Create(); |
| 17 if (!data.ReadId(&(*out)->id) || !data.ReadOutputRect(&(*out)->output_rect) || | 18 if (!data.ReadId(&(*out)->id) || !data.ReadOutputRect(&(*out)->output_rect) || |
| 18 !data.ReadDamageRect(&(*out)->damage_rect) || | 19 !data.ReadDamageRect(&(*out)->damage_rect) || |
| 19 !data.ReadTransformToRootTarget(&(*out)->transform_to_root_target)) { | 20 !data.ReadTransformToRootTarget(&(*out)->transform_to_root_target)) { |
| 20 return false; | 21 return false; |
| 21 } | 22 } |
| 22 (*out)->has_transparent_background = data.has_transparent_background(); | 23 (*out)->has_transparent_background = data.has_transparent_background(); |
| 23 | 24 |
| 24 mojo::ArrayDataView<cc::mojom::DrawQuadDataView> quads; | 25 mojo::ArrayDataView<cc::mojom::DrawQuadDataView> quads; |
| 25 data.GetQuadListDataView(&quads); | 26 data.GetQuadListDataView(&quads); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 48 return false; | 49 return false; |
| 49 } | 50 } |
| 50 quad->shared_quad_state = last_sqs; | 51 quad->shared_quad_state = last_sqs; |
| 51 if (!quad->shared_quad_state) | 52 if (!quad->shared_quad_state) |
| 52 return false; | 53 return false; |
| 53 } | 54 } |
| 54 return true; | 55 return true; |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace mojo | 58 } // namespace mojo |
| OLD | NEW |