| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SYNC_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_SYNC_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_SYNC_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_SYNC_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 friend class base::RefCounted<TextureGroup>; | 65 friend class base::RefCounted<TextureGroup>; |
| 66 ~TextureGroup(); | 66 ~TextureGroup(); |
| 67 | 67 |
| 68 typedef std::vector<std::pair<MailboxManagerSync*, Texture*>> TextureList; | 68 typedef std::vector<std::pair<MailboxManagerSync*, Texture*>> TextureList; |
| 69 std::vector<Mailbox> names_; | 69 std::vector<Mailbox> names_; |
| 70 TextureList textures_; | 70 TextureList textures_; |
| 71 TextureDefinition definition_; | 71 TextureDefinition definition_; |
| 72 | 72 |
| 73 typedef std::map<Mailbox, scoped_refptr<TextureGroup>> | 73 typedef std::map<Mailbox, scoped_refptr<TextureGroup>> |
| 74 MailboxToGroupMap; | 74 MailboxToGroupMap; |
| 75 static base::LazyInstance<MailboxToGroupMap> mailbox_to_group_; | 75 static base::LazyInstance<MailboxToGroupMap>::DestructorAtExit |
| 76 mailbox_to_group_; |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 struct TextureGroupRef { | 79 struct TextureGroupRef { |
| 79 TextureGroupRef(unsigned version, TextureGroup* group); | 80 TextureGroupRef(unsigned version, TextureGroup* group); |
| 80 TextureGroupRef(const TextureGroupRef& other); | 81 TextureGroupRef(const TextureGroupRef& other); |
| 81 ~TextureGroupRef(); | 82 ~TextureGroupRef(); |
| 82 unsigned version; | 83 unsigned version; |
| 83 scoped_refptr<TextureGroup> group; | 84 scoped_refptr<TextureGroup> group; |
| 84 }; | 85 }; |
| 85 static void UpdateDefinitionLocked(TextureBase* texture, | 86 static void UpdateDefinitionLocked(TextureBase* texture, |
| 86 TextureGroupRef* group_ref); | 87 TextureGroupRef* group_ref); |
| 87 | 88 |
| 88 typedef std::map<Texture*, TextureGroupRef> TextureToGroupMap; | 89 typedef std::map<Texture*, TextureGroupRef> TextureToGroupMap; |
| 89 TextureToGroupMap texture_to_group_; | 90 TextureToGroupMap texture_to_group_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(MailboxManagerSync); | 92 DISALLOW_COPY_AND_ASSIGN(MailboxManagerSync); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespage gles2 | 95 } // namespage gles2 |
| 95 } // namespace gpu | 96 } // namespace gpu |
| 96 | 97 |
| 97 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_SYNC_H_ | 98 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_SYNC_H_ |
| 98 | 99 |
| OLD | NEW |