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/transferable_resource_struct_traits.h" | 5 #include "cc/ipc/transferable_resource_struct_traits.h" |
6 #include "gpu/ipc/common/mailbox_holder_struct_traits.h" | 6 #include "gpu/ipc/common/mailbox_holder_struct_traits.h" |
7 #include "gpu/ipc/common/mailbox_struct_traits.h" | 7 #include "gpu/ipc/common/mailbox_struct_traits.h" |
8 #include "gpu/ipc/common/sync_token_struct_traits.h" | 8 #include "gpu/ipc/common/sync_token_struct_traits.h" |
9 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" | 9 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 | 12 |
13 // static | 13 // static |
14 bool StructTraits<cc::mojom::TransferableResourceDataView, | 14 bool StructTraits<cc::mojom::TransferableResourceDataView, |
15 cc::TransferableResource>:: | 15 cc::TransferableResource>:: |
16 Read(cc::mojom::TransferableResourceDataView data, | 16 Read(cc::mojom::TransferableResourceDataView data, |
17 cc::TransferableResource* out) { | 17 cc::TransferableResource* out) { |
18 if (!data.ReadSize(&out->size) || | 18 if (!data.ReadSize(&out->size) || |
19 !data.ReadMailboxHolder(&out->mailbox_holder)) | 19 !data.ReadMailboxHolder(&out->mailbox_holder)) |
20 return false; | 20 return false; |
21 out->id = data.id(); | 21 out->id = data.id(); |
22 out->format = static_cast<cc::ResourceFormat>(data.format()); | 22 out->format = static_cast<cc::ResourceFormat>(data.format()); |
| 23 out->buffer_format = static_cast<gfx::BufferFormat>(data.buffer_format()); |
23 out->filter = data.filter(); | 24 out->filter = data.filter(); |
24 out->read_lock_fences_enabled = data.read_lock_fences_enabled(); | 25 out->read_lock_fences_enabled = data.read_lock_fences_enabled(); |
25 out->is_software = data.is_software(); | 26 out->is_software = data.is_software(); |
26 out->is_overlay_candidate = data.is_overlay_candidate(); | 27 out->is_overlay_candidate = data.is_overlay_candidate(); |
27 #if defined(OS_ANDROID) | 28 #if defined(OS_ANDROID) |
28 out->is_backed_by_surface_texture = data.is_backed_by_surface_texture(); | 29 out->is_backed_by_surface_texture = data.is_backed_by_surface_texture(); |
29 out->wants_promotion_hint = data.wants_promotion_hint(); | 30 out->wants_promotion_hint = data.wants_promotion_hint(); |
30 #endif | 31 #endif |
31 return true; | 32 return true; |
32 } | 33 } |
33 | 34 |
34 } // namespace mojo | 35 } // namespace mojo |
OLD | NEW |