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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 512 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
513 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); | 513 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); |
514 auto it = uncleared_textures_.find(picture.picture_buffer_id()); | 514 auto it = uncleared_textures_.find(picture.picture_buffer_id()); |
515 if (it == uncleared_textures_.end()) | 515 if (it == uncleared_textures_.end()) |
516 return; // the texture has been cleared | 516 return; // the texture has been cleared |
517 | 517 |
518 for (auto texture_ref : it->second) { | 518 for (auto texture_ref : it->second) { |
519 GLenum target = texture_ref->texture()->target(); | 519 GLenum target = texture_ref->texture()->target(); |
520 gpu::gles2::TextureManager* texture_manager = | 520 gpu::gles2::TextureManager* texture_manager = |
521 stub_->decoder()->GetContextGroup()->texture_manager(); | 521 stub_->decoder()->GetContextGroup()->texture_manager(); |
522 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 522 |
523 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 523 // External textures are a special case and expected to already be cleared. |
| 524 if (target == GL_TEXTURE_EXTERNAL_OES) { |
| 525 DCHECK(texture_ref->texture()->IsLevelCleared(target, 0)); |
| 526 } else { |
| 527 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
| 528 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 529 } |
524 } | 530 } |
525 uncleared_textures_.erase(it); | 531 uncleared_textures_.erase(it); |
526 } | 532 } |
527 | 533 |
528 } // namespace media | 534 } // namespace media |
OLD | NEW |