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 #include "gpu/command_buffer/service/mailbox_synchronizer.h" | 5 #include "gpu/command_buffer/service/mailbox_synchronizer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "gpu/command_buffer/service/mailbox_manager.h" | 8 #include "gpu/command_buffer/service/mailbox_manager.h" |
9 #include "gpu/command_buffer/service/texture_manager.h" | 9 #include "gpu/command_buffer/service/texture_manager.h" |
10 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 } else { | 168 } else { |
169 linked_ptr<TextureGroup> group = make_linked_ptr(new TextureGroup( | 169 linked_ptr<TextureGroup> group = make_linked_ptr(new TextureGroup( |
170 TextureDefinition(target_name.target, texture, 1, NULL))); | 170 TextureDefinition(target_name.target, texture, 1, NULL))); |
171 | 171 |
172 // Unlink other textures from this mailbox in case the name is not new. | 172 // Unlink other textures from this mailbox in case the name is not new. |
173 ReassociateMailboxLocked(target_name, group.get()); | 173 ReassociateMailboxLocked(target_name, group.get()); |
174 textures_.insert(std::make_pair(texture, TextureVersion(group))); | 174 textures_.insert(std::make_pair(texture, TextureVersion(group))); |
175 } | 175 } |
176 } | 176 } |
| 177 // Make sure all write fences are flushed. |
| 178 glFlush(); |
177 } | 179 } |
178 | 180 |
179 void MailboxSynchronizer::UpdateTextureLocked(Texture* texture, | 181 void MailboxSynchronizer::UpdateTextureLocked(Texture* texture, |
180 TextureVersion& texture_version) { | 182 TextureVersion& texture_version) { |
181 lock_.AssertAcquired(); | 183 lock_.AssertAcquired(); |
182 gfx::GLImage* gl_image = texture->GetLevelImage(texture->target(), 0); | 184 gfx::GLImage* gl_image = texture->GetLevelImage(texture->target(), 0); |
183 TextureGroup* group = texture_version.group.get(); | 185 TextureGroup* group = texture_version.group.get(); |
184 scoped_refptr<NativeImageBuffer> image_buffer = group->definition.image(); | 186 scoped_refptr<NativeImageBuffer> image_buffer = group->definition.image(); |
185 | 187 |
186 // Make sure we don't clobber with an older version | 188 // Make sure we don't clobber with an older version |
(...skipping 30 matching lines...) Expand all Loading... |
217 definition.IsOlderThan(it->second.version)) | 219 definition.IsOlderThan(it->second.version)) |
218 continue; | 220 continue; |
219 it->second.version = definition.version(); | 221 it->second.version = definition.version(); |
220 definition.UpdateTexture(texture); | 222 definition.UpdateTexture(texture); |
221 } | 223 } |
222 } | 224 } |
223 } | 225 } |
224 | 226 |
225 } // namespace gles2 | 227 } // namespace gles2 |
226 } // namespace gpu | 228 } // namespace gpu |
OLD | NEW |