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 #ifndef CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ | 5 #ifndef CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ |
6 #define CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ | 6 #define CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "cc/ipc/transferable_resource.mojom-shared.h" | 8 #include "cc/ipc/transferable_resource.mojom-shared.h" |
9 #include "cc/resources/transferable_resource.h" | 9 #include "cc/resources/transferable_resource.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 static bool is_software(const cc::TransferableResource& resource) { | 43 static bool is_software(const cc::TransferableResource& resource) { |
44 return resource.is_software; | 44 return resource.is_software; |
45 } | 45 } |
46 | 46 |
47 static bool is_overlay_candidate(const cc::TransferableResource& resource) { | 47 static bool is_overlay_candidate(const cc::TransferableResource& resource) { |
48 return resource.is_overlay_candidate; | 48 return resource.is_overlay_candidate; |
49 } | 49 } |
50 | 50 |
| 51 static bool is_backed_by_surface_texture( |
| 52 const cc::TransferableResource& resource) { |
| 53 #if defined(OS_ANDROID) |
| 54 // TransferableResource has this in an #ifdef, but mojo doesn't let us. |
| 55 // TODO(https://crbug.com/671901) |
| 56 return resource.is_backed_by_surface_texture; |
| 57 #else |
| 58 return false; |
| 59 #endif |
| 60 } |
| 61 |
| 62 static bool wants_promotion_hint(const cc::TransferableResource& resource) { |
| 63 #if defined(OS_ANDROID) |
| 64 // TransferableResource has this in an #ifdef, but mojo doesn't let us. |
| 65 // TODO(https://crbug.com/671901) |
| 66 return resource.wants_promotion_hint; |
| 67 #else |
| 68 return false; |
| 69 #endif |
| 70 } |
| 71 |
51 static bool Read(cc::mojom::TransferableResourceDataView data, | 72 static bool Read(cc::mojom::TransferableResourceDataView data, |
52 cc::TransferableResource* out); | 73 cc::TransferableResource* out); |
53 }; | 74 }; |
54 | 75 |
55 } // namespace mojo | 76 } // namespace mojo |
56 | 77 |
57 #endif // CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ | 78 #endif // CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ |
OLD | NEW |