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.ReadId(&(*out)->id) || !data.ReadOutputRect(&(*out)->output_rect) || | 18 if (!data.ReadId(&(*out)->id) || !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)->has_transparent_background = data.has_transparent_background(); | 25 (*out)->has_transparent_background = data.has_transparent_background(); |
24 | 26 |
25 mojo::ArrayDataView<cc::mojom::DrawQuadDataView> quads; | 27 mojo::ArrayDataView<cc::mojom::DrawQuadDataView> quads; |
26 data.GetQuadListDataView(&quads); | 28 data.GetQuadListDataView(&quads); |
27 cc::SharedQuadState* last_sqs = nullptr; | 29 cc::SharedQuadState* last_sqs = nullptr; |
28 for (size_t i = 0; i < quads.size(); ++i) { | 30 for (size_t i = 0; i < quads.size(); ++i) { |
29 cc::mojom::DrawQuadDataView quad_data_view; | 31 cc::mojom::DrawQuadDataView quad_data_view; |
30 quads.GetDataView(i, &quad_data_view); | 32 quads.GetDataView(i, &quad_data_view); |
(...skipping 18 matching lines...) Expand all Loading... |
49 return false; | 51 return false; |
50 } | 52 } |
51 quad->shared_quad_state = last_sqs; | 53 quad->shared_quad_state = last_sqs; |
52 if (!quad->shared_quad_state) | 54 if (!quad->shared_quad_state) |
53 return false; | 55 return false; |
54 } | 56 } |
55 return true; | 57 return true; |
56 } | 58 } |
57 | 59 |
58 } // namespace mojo | 60 } // namespace mojo |
OLD | NEW |