| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 | 271 |
| 272 void MailboxManagerSync::UpdateDefinitionLocked( | 272 void MailboxManagerSync::UpdateDefinitionLocked( |
| 273 Texture* texture, | 273 Texture* texture, |
| 274 TextureGroupRef* group_ref) { | 274 TextureGroupRef* group_ref) { |
| 275 g_lock.Get().AssertAcquired(); | 275 g_lock.Get().AssertAcquired(); |
| 276 | 276 |
| 277 if (SkipTextureWorkarounds(texture)) | 277 if (SkipTextureWorkarounds(texture)) |
| 278 return; | 278 return; |
| 279 | 279 |
| 280 gl::GLImage* image = texture->GetLevelImage(texture->target(), 0); | 280 gl::GLImage* image = texture->GetLevelImage(texture->target(), 0, 0); |
| 281 TextureGroup* group = group_ref->group.get(); | 281 TextureGroup* group = group_ref->group.get(); |
| 282 const TextureDefinition& definition = group->GetDefinition(); | 282 const TextureDefinition& definition = group->GetDefinition(); |
| 283 scoped_refptr<NativeImageBuffer> image_buffer = definition.image(); | 283 scoped_refptr<NativeImageBuffer> image_buffer = definition.image(); |
| 284 | 284 |
| 285 // Make sure we don't clobber with an older version | 285 // Make sure we don't clobber with an older version |
| 286 if (!definition.IsOlderThan(group_ref->version)) | 286 if (!definition.IsOlderThan(group_ref->version)) |
| 287 return; | 287 return; |
| 288 | 288 |
| 289 // Also don't push redundant updates. Note that it would break the | 289 // Also don't push redundant updates. Note that it would break the |
| 290 // versioning. | 290 // versioning. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 if (!needs_update.empty()) { | 333 if (!needs_update.empty()) { |
| 334 for (const TextureUpdatePair& pair : needs_update) { | 334 for (const TextureUpdatePair& pair : needs_update) { |
| 335 pair.second.UpdateTexture(pair.first); | 335 pair.second.UpdateTexture(pair.first); |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace gles2 | 340 } // namespace gles2 |
| 341 } // namespace gpu | 341 } // namespace gpu |
| OLD | NEW |