| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/gpu/ipc/service/gpu_video_decode_accelerator.h" | 5 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 518 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
| 519 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); | 519 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); |
| 520 auto it = uncleared_textures_.find(picture.picture_buffer_id()); | 520 auto it = uncleared_textures_.find(picture.picture_buffer_id()); |
| 521 if (it == uncleared_textures_.end()) | 521 if (it == uncleared_textures_.end()) |
| 522 return; // the texture has been cleared | 522 return; // the texture has been cleared |
| 523 | 523 |
| 524 for (auto texture_ref : it->second) { | 524 for (auto texture_ref : it->second) { |
| 525 GLenum target = texture_ref->texture()->target(); | 525 GLenum target = texture_ref->texture()->target(); |
| 526 gpu::gles2::TextureManager* texture_manager = | 526 gpu::gles2::TextureManager* texture_manager = |
| 527 stub_->decoder()->GetContextGroup()->texture_manager(); | 527 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 528 | 528 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 529 // External textures are a special case and expected to already be cleared. | |
| 530 if (target == GL_TEXTURE_EXTERNAL_OES) { | |
| 531 DCHECK(texture_ref->texture()->IsLevelCleared(target, 0)); | |
| 532 } else { | |
| 533 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | |
| 534 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | |
| 535 } | |
| 536 } | 529 } |
| 537 uncleared_textures_.erase(it); | 530 uncleared_textures_.erase(it); |
| 538 } | 531 } |
| 539 | 532 |
| 540 } // namespace media | 533 } // namespace media |
| OLD | NEW |