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

Side by Side Diff: ui/gfx/generic_shared_memory_id.h

Issue 2819803002: Reorganize GUIDs for GPU memory buffers (Closed)
Patch Set: Address on reviews Created 3 years, 8 months 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 | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gfx/generic_shared_memory_id.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 UI_GFX_GENERIC_SHARED_MEMORY_ID_H_ 5 #ifndef UI_GFX_GENERIC_SHARED_MEMORY_ID_H_
6 #define UI_GFX_GENERIC_SHARED_MEMORY_ID_H_ 6 #define UI_GFX_GENERIC_SHARED_MEMORY_ID_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 bool operator<(const GenericSharedMemoryId& other) const { 36 bool operator<(const GenericSharedMemoryId& other) const {
37 return id < other.id; 37 return id < other.id;
38 } 38 }
39 }; 39 };
40 40
41 // Generates GUID which can be used to trace shared memory using its 41 // Generates GUID which can be used to trace shared memory using its
42 // GenericSharedMemoryId. 42 // GenericSharedMemoryId.
43 GFX_EXPORT base::trace_event::MemoryAllocatorDumpGuid 43 GFX_EXPORT base::trace_event::MemoryAllocatorDumpGuid
44 GetGenericSharedMemoryGUIDForTracing( 44 GetGenericSharedGpuMemoryGUIDForTracing(
45 uint64_t tracing_process_id, 45 uint64_t tracing_process_id,
46 GenericSharedMemoryId generic_shared_memory_id); 46 GenericSharedMemoryId generic_shared_memory_id);
47 47
48 } // namespace gfx 48 } // namespace gfx
49 49
50 namespace BASE_HASH_NAMESPACE { 50 namespace BASE_HASH_NAMESPACE {
51 51
52 template <> 52 template <>
53 struct hash<gfx::GenericSharedMemoryId> { 53 struct hash<gfx::GenericSharedMemoryId> {
54 size_t operator()(gfx::GenericSharedMemoryId key) const { 54 size_t operator()(gfx::GenericSharedMemoryId key) const {
55 return BASE_HASH_NAMESPACE::hash<int>()(key.id); 55 return BASE_HASH_NAMESPACE::hash<int>()(key.id);
56 } 56 }
57 }; 57 };
58 58
59 template <typename Second> 59 template <typename Second>
60 struct hash<std::pair<gfx::GenericSharedMemoryId, Second>> { 60 struct hash<std::pair<gfx::GenericSharedMemoryId, Second>> {
61 size_t operator()( 61 size_t operator()(
62 const std::pair<gfx::GenericSharedMemoryId, Second>& pair) const { 62 const std::pair<gfx::GenericSharedMemoryId, Second>& pair) const {
63 return base::HashInts(pair.first.id, pair.second); 63 return base::HashInts(pair.first.id, pair.second);
64 } 64 }
65 }; 65 };
66 66
67 } // namespace BASE_HASH_NAMESPACE 67 } // namespace BASE_HASH_NAMESPACE
68 68
69 #endif // UI_GFX_GENERIC_SHARED_MEMORY_ID_H_ 69 #endif // UI_GFX_GENERIC_SHARED_MEMORY_ID_H_
OLDNEW
« no previous file with comments | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gfx/generic_shared_memory_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698