OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 Mailbox mailbox; | 57 Mailbox mailbox; |
58 }; | 58 }; |
59 | 59 |
60 static bool TargetNameLess(const TargetName& lhs, const TargetName& rhs); | 60 static bool TargetNameLess(const TargetName& lhs, const TargetName& rhs); |
61 | 61 |
62 // This is a bidirectional map between mailbox and textures. We can have | 62 // This is a bidirectional map between mailbox and textures. We can have |
63 // multiple mailboxes per texture, but one texture per mailbox. We keep an | 63 // multiple mailboxes per texture, but one texture per mailbox. We keep an |
64 // iterator in the MailboxToTextureMap to be able to manage changes to | 64 // iterator in the MailboxToTextureMap to be able to manage changes to |
65 // the TextureToMailboxMap efficiently. | 65 // the TextureToMailboxMap efficiently. |
66 typedef std::multimap<Texture*, TargetName> TextureToMailboxMap; | 66 typedef std::multimap<Texture*, TargetName> TextureToMailboxMap; |
67 typedef std::map< | 67 typedef std::map<TargetName, |
68 TargetName, | 68 TextureToMailboxMap::iterator, |
69 TextureToMailboxMap::iterator, | 69 std::pointer_to_binary_function<const TargetName&, |
70 std::pointer_to_binary_function< | 70 const TargetName&, |
71 const TargetName&, const TargetName&, bool> > MailboxToTextureMap; | 71 bool> > MailboxToTextureMap; |
72 | 72 |
73 MailboxToTextureMap mailbox_to_textures_; | 73 MailboxToTextureMap mailbox_to_textures_; |
74 TextureToMailboxMap textures_to_mailboxes_; | 74 TextureToMailboxMap textures_to_mailboxes_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(MailboxManager); | 76 DISALLOW_COPY_AND_ASSIGN(MailboxManager); |
77 }; | 77 }; |
78 } // namespage gles2 | 78 } // namespage gles2 |
79 } // namespace gpu | 79 } // namespace gpu |
80 | 80 |
81 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 81 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
82 | 82 |
83 | |
OLD | NEW |