diff options
author | ericrk <ericrk@chromium.org> | 2015-08-20 02:28:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-20 09:28:57 +0000 |
commit | 368be3bcc347ae4093a7e7cbb2a04ca346878d8c (patch) | |
tree | 15a2ec2e7074df51936d156a4c8c6a3d5faee98b /ui | |
parent | 92c8231b78efd1048d10e54b3c01d18647cdd1fc (diff) | |
download | chromium_src-368be3bcc347ae4093a7e7cbb2a04ca346878d8c.zip chromium_src-368be3bcc347ae4093a7e7cbb2a04ca346878d8c.tar.gz chromium_src-368be3bcc347ae4093a7e7cbb2a04ca346878d8c.tar.bz2 |
Small refactor before actually dumping GLImageIOSurface.
Adds an additional helper template to GenericSharedMemoryId to allow
it to be used as a hash key as the first element of a pair. This is
very common throughout the GpuMemoryBuffer / GLImage system, where
objects are frequently keyed off of <GenericSharedMemoryId, ClientId>.
BUG=514914
Review URL: https://codereview.chromium.org/1284353003
Cr-Commit-Position: refs/heads/master@{#344463}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/generic_shared_memory_id.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/gfx/generic_shared_memory_id.h b/ui/gfx/generic_shared_memory_id.h index 9aa226f..02bba13 100644 --- a/ui/gfx/generic_shared_memory_id.h +++ b/ui/gfx/generic_shared_memory_id.h @@ -49,6 +49,15 @@ struct hash<gfx::GenericSharedMemoryId> { return BASE_HASH_NAMESPACE::hash<int>()(key.id); } }; + +template <typename Second> +struct hash<std::pair<gfx::GenericSharedMemoryId, Second>> { + size_t operator()( + const std::pair<gfx::GenericSharedMemoryId, Second>& pair) const { + return base::HashPair(pair.first.id, pair.second); + } +}; + } // namespace BASE_HASH_NAMESPACE #endif // UI_GFX_GENERIC_SHARED_MEMORY_ID_H_ |