| 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_manager_sync.h" | 5 #include "gpu/command_buffer/service/mailbox_manager_sync.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // The texture is already known under this name. | 232 // The texture is already known under this name. |
| 233 return; | 233 return; |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| 237 if (group_for_mailbox) { | 237 if (group_for_mailbox) { |
| 238 // Unlink the mailbox from its current group. | 238 // Unlink the mailbox from its current group. |
| 239 group_for_mailbox->RemoveName(mailbox); | 239 group_for_mailbox->RemoveName(mailbox); |
| 240 } | 240 } |
| 241 | 241 |
| 242 if (!texture) |
| 243 return; |
| 244 |
| 242 if (group_for_texture) { | 245 if (group_for_texture) { |
| 243 group_for_texture->AddName(mailbox); | 246 group_for_texture->AddName(mailbox); |
| 244 } else { | 247 } else { |
| 245 // This is a new texture, so create a new group. | 248 // This is a new texture, so create a new group. |
| 246 texture->SetMailboxManager(this); | 249 texture->SetMailboxManager(this); |
| 247 TextureDefinition definition; | 250 TextureDefinition definition; |
| 248 if (!SkipTextureWorkarounds(texture)) { | 251 if (!SkipTextureWorkarounds(texture)) { |
| 249 base::AutoUnlock unlock(g_lock.Get()); | 252 base::AutoUnlock unlock(g_lock.Get()); |
| 250 definition = TextureDefinition(texture, kNewTextureVersion, NULL); | 253 definition = TextureDefinition(texture, kNewTextureVersion, NULL); |
| 251 } | 254 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 335 |
| 333 if (!needs_update.empty()) { | 336 if (!needs_update.empty()) { |
| 334 for (const TextureUpdatePair& pair : needs_update) { | 337 for (const TextureUpdatePair& pair : needs_update) { |
| 335 pair.second.UpdateTexture(pair.first); | 338 pair.second.UpdateTexture(pair.first); |
| 336 } | 339 } |
| 337 } | 340 } |
| 338 } | 341 } |
| 339 | 342 |
| 340 } // namespace gles2 | 343 } // namespace gles2 |
| 341 } // namespace gpu | 344 } // namespace gpu |
| OLD | NEW |