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 leta us. | |
dcheng
2016/12/07 03:34:50
Mind marking this with TODO(https://crbug.com/6719
liberato (no reviews please)
2016/12/07 17:38:29
done, + leta.
| |
55 return resource.is_backed_by_surface_texture; | |
56 #else | |
57 return false; | |
58 #endif | |
59 } | |
60 | |
61 static bool wants_promotion_hint(const cc::TransferableResource& resource) { | |
62 #if defined(OS_ANDROID) | |
63 // TransferableResource has this in an #ifdef, but mojo doesn't leta us. | |
64 return resource.wants_promotion_hint; | |
65 #else | |
66 return false; | |
67 #endif | |
68 } | |
69 | |
51 static bool Read(cc::mojom::TransferableResourceDataView data, | 70 static bool Read(cc::mojom::TransferableResourceDataView data, |
52 cc::TransferableResource* out); | 71 cc::TransferableResource* out); |
53 }; | 72 }; |
54 | 73 |
55 } // namespace mojo | 74 } // namespace mojo |
56 | 75 |
57 #endif // CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ | 76 #endif // CC_IPC_TRANSFERABLE_RESOURCE_STRUCT_TRAITS_H_ |
OLD | NEW |