Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: cc/ipc/transferable_resource_struct_traits.h

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: rebased Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/ipc/transferable_resource.mojom ('k') | cc/ipc/transferable_resource_struct_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « cc/ipc/transferable_resource.mojom ('k') | cc/ipc/transferable_resource_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698