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