| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 // Make sure we don't clobber with an older version | 278 // Make sure we don't clobber with an older version |
| 279 if (!definition.IsOlderThan(group_ref->version)) | 279 if (!definition.IsOlderThan(group_ref->version)) |
| 280 return; | 280 return; |
| 281 | 281 |
| 282 // Also don't push redundant updates. Note that it would break the | 282 // Also don't push redundant updates. Note that it would break the |
| 283 // versioning. | 283 // versioning. |
| 284 if (definition.Matches(texture)) | 284 if (definition.Matches(texture)) |
| 285 return; | 285 return; |
| 286 | 286 |
| 287 DCHECK_IMPLIES(gl_image, image_buffer.get()); | 287 DCHECK(!gl_image || image_buffer.get()); |
| 288 if (gl_image && !image_buffer->IsClient(gl_image)) { | 288 if (gl_image && !image_buffer->IsClient(gl_image)) { |
| 289 LOG(ERROR) << "MailboxSync: Incompatible attachment"; | 289 LOG(ERROR) << "MailboxSync: Incompatible attachment"; |
| 290 return; | 290 return; |
| 291 } | 291 } |
| 292 | 292 |
| 293 group->SetDefinition(TextureDefinition(texture, ++group_ref->version, | 293 group->SetDefinition(TextureDefinition(texture, ++group_ref->version, |
| 294 gl_image ? image_buffer : NULL)); | 294 gl_image ? image_buffer : NULL)); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void MailboxManagerSync::PushTextureUpdates(uint32 sync_point) { | 297 void MailboxManagerSync::PushTextureUpdates(uint32 sync_point) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 327 if (!needs_update.empty()) { | 327 if (!needs_update.empty()) { |
| 328 ScopedUpdateTexture scoped_update_texture; | 328 ScopedUpdateTexture scoped_update_texture; |
| 329 for (const TextureUpdatePair& pair : needs_update) { | 329 for (const TextureUpdatePair& pair : needs_update) { |
| 330 pair.second.UpdateTexture(pair.first); | 330 pair.second.UpdateTexture(pair.first); |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace gles2 | 335 } // namespace gles2 |
| 336 } // namespace gpu | 336 } // namespace gpu |
| OLD | NEW |