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/quads_struct_traits.h" | 5 #include "cc/ipc/quads_struct_traits.h" |
6 #include "ui/gfx/mojo/transform_struct_traits.h" | 6 #include "ui/gfx/mojo/transform_struct_traits.h" |
7 | 7 |
8 namespace mojo { | 8 namespace mojo { |
9 | 9 |
10 cc::DrawQuad* AllocateAndConstruct( | 10 cc::DrawQuad* AllocateAndConstruct( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 cc::RenderPassDrawQuad* quad = static_cast<cc::RenderPassDrawQuad*>(out); | 66 cc::RenderPassDrawQuad* quad = static_cast<cc::RenderPassDrawQuad*>(out); |
67 quad->resources.ids[cc::RenderPassDrawQuad::kMaskResourceIdIndex] = | 67 quad->resources.ids[cc::RenderPassDrawQuad::kMaskResourceIdIndex] = |
68 data.mask_resource_id(); | 68 data.mask_resource_id(); |
69 quad->resources.count = data.mask_resource_id() ? 1 : 0; | 69 quad->resources.count = data.mask_resource_id() ? 1 : 0; |
70 quad->render_pass_id = data.render_pass_id(); | 70 quad->render_pass_id = data.render_pass_id(); |
71 // RenderPass ids are never zero. | 71 // RenderPass ids are never zero. |
72 if (!quad->render_pass_id) | 72 if (!quad->render_pass_id) |
73 return false; | 73 return false; |
74 return data.ReadMaskUvScale(&quad->mask_uv_scale) && | 74 return data.ReadMaskUvScale(&quad->mask_uv_scale) && |
75 data.ReadMaskTextureSize(&quad->mask_texture_size) && | 75 data.ReadMaskTextureSize(&quad->mask_texture_size) && |
76 data.ReadFilters(&quad->filters) && | |
77 data.ReadFiltersScale(&quad->filters_scale) && | 76 data.ReadFiltersScale(&quad->filters_scale) && |
78 data.ReadFiltersOrigin(&quad->filters_origin) && | 77 data.ReadFiltersOrigin(&quad->filters_origin); |
79 data.ReadBackgroundFilters(&quad->background_filters); | |
80 } | 78 } |
81 | 79 |
82 // static | 80 // static |
83 bool StructTraits<cc::mojom::SolidColorQuadStateDataView, cc::DrawQuad>::Read( | 81 bool StructTraits<cc::mojom::SolidColorQuadStateDataView, cc::DrawQuad>::Read( |
84 cc::mojom::SolidColorQuadStateDataView data, | 82 cc::mojom::SolidColorQuadStateDataView data, |
85 cc::DrawQuad* out) { | 83 cc::DrawQuad* out) { |
86 cc::SolidColorDrawQuad* quad = static_cast<cc::SolidColorDrawQuad*>(out); | 84 cc::SolidColorDrawQuad* quad = static_cast<cc::SolidColorDrawQuad*>(out); |
87 quad->force_anti_aliasing_off = data.force_anti_aliasing_off(); | 85 quad->force_anti_aliasing_off = data.force_anti_aliasing_off(); |
88 quad->color = data.color(); | 86 quad->color = data.color(); |
89 return true; | 87 return true; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 cc::DrawQuad* out) { | 232 cc::DrawQuad* out) { |
235 if (!data.ReadRect(&out->rect) || !data.ReadOpaqueRect(&out->opaque_rect) || | 233 if (!data.ReadRect(&out->rect) || !data.ReadOpaqueRect(&out->opaque_rect) || |
236 !data.ReadVisibleRect(&out->visible_rect)) { | 234 !data.ReadVisibleRect(&out->visible_rect)) { |
237 return false; | 235 return false; |
238 } | 236 } |
239 out->needs_blending = data.needs_blending(); | 237 out->needs_blending = data.needs_blending(); |
240 return data.ReadDrawQuadState(out); | 238 return data.ReadDrawQuadState(out); |
241 } | 239 } |
242 | 240 |
243 } // namespace mojo | 241 } // namespace mojo |
OLD | NEW |