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::RenderPassDataView, | 13 bool StructTraits<cc::mojom::RenderPassDataView, |
14 std::unique_ptr<cc::RenderPass>>:: | 14 std::unique_ptr<cc::RenderPass>>:: |
15 Read(cc::mojom::RenderPassDataView data, | 15 Read(cc::mojom::RenderPassDataView data, |
16 std::unique_ptr<cc::RenderPass>* out) { | 16 std::unique_ptr<cc::RenderPass>* out) { |
17 *out = cc::RenderPass::Create(); | 17 *out = cc::RenderPass::Create(); |
18 if (!data.ReadOutputRect(&(*out)->output_rect) || | 18 if (!data.ReadOutputRect(&(*out)->output_rect) || |
19 !data.ReadDamageRect(&(*out)->damage_rect) || | 19 !data.ReadDamageRect(&(*out)->damage_rect) || |
20 !data.ReadTransformToRootTarget(&(*out)->transform_to_root_target)) { | 20 !data.ReadTransformToRootTarget(&(*out)->transform_to_root_target) || |
| 21 !data.ReadFilters(&(*out)->filters) || |
| 22 !data.ReadBackgroundFilters(&(*out)->background_filters)) { |
21 return false; | 23 return false; |
22 } | 24 } |
23 (*out)->id = data.id(); | 25 (*out)->id = data.id(); |
24 // RenderPass ids are never zero. | 26 // RenderPass ids are never zero. |
25 if (!(*out)->id) | 27 if (!(*out)->id) |
26 return false; | 28 return false; |
27 (*out)->has_transparent_background = data.has_transparent_background(); | 29 (*out)->has_transparent_background = data.has_transparent_background(); |
28 | 30 |
29 mojo::ArrayDataView<cc::mojom::DrawQuadDataView> quads; | 31 mojo::ArrayDataView<cc::mojom::DrawQuadDataView> quads; |
30 data.GetQuadListDataView(&quads); | 32 data.GetQuadListDataView(&quads); |
(...skipping 22 matching lines...) Expand all Loading... |
53 return false; | 55 return false; |
54 } | 56 } |
55 quad->shared_quad_state = last_sqs; | 57 quad->shared_quad_state = last_sqs; |
56 if (!quad->shared_quad_state) | 58 if (!quad->shared_quad_state) |
57 return false; | 59 return false; |
58 } | 60 } |
59 return true; | 61 return true; |
60 } | 62 } |
61 | 63 |
62 } // namespace mojo | 64 } // namespace mojo |
OLD | NEW |