| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (!stub) { | 67 if (!stub) { |
| 68 DLOG(ERROR) << "Stub is gone; won't BindImage()."; | 68 DLOG(ERROR) << "Stub is gone; won't BindImage()."; |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 gpu::gles2::GLES2Decoder* command_decoder = stub->decoder(); | 72 gpu::gles2::GLES2Decoder* command_decoder = stub->decoder(); |
| 73 gpu::gles2::TextureManager* texture_manager = | 73 gpu::gles2::TextureManager* texture_manager = |
| 74 command_decoder->GetContextGroup()->texture_manager(); | 74 command_decoder->GetContextGroup()->texture_manager(); |
| 75 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id); | 75 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id); |
| 76 if (ref) { | 76 if (ref) { |
| 77 texture_manager->SetLevelImage(ref, texture_target, 0, image.get(), | 77 texture_manager->SetLevelImage(ref, texture_target, 0, 0, image.get(), |
| 78 can_bind_to_sampler | 78 can_bind_to_sampler |
| 79 ? gpu::gles2::Texture::BOUND | 79 ? gpu::gles2::Texture::BOUND |
| 80 : gpu::gles2::Texture::UNBOUND); | 80 : gpu::gles2::Texture::UNBOUND); |
| 81 } | 81 } |
| 82 | 82 |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 #endif | 85 #endif |
| 86 | 86 |
| 87 static base::WeakPtr<gpu::gles2::GLES2Decoder> GetGLES2Decoder( | 87 static base::WeakPtr<gpu::gles2::GLES2Decoder> GetGLES2Decoder( |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 507 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
| 508 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); | 508 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); |
| 509 auto it = uncleared_textures_.find(picture.picture_buffer_id()); | 509 auto it = uncleared_textures_.find(picture.picture_buffer_id()); |
| 510 if (it == uncleared_textures_.end()) | 510 if (it == uncleared_textures_.end()) |
| 511 return; // the texture has been cleared | 511 return; // the texture has been cleared |
| 512 | 512 |
| 513 for (auto texture_ref : it->second) { | 513 for (auto texture_ref : it->second) { |
| 514 GLenum target = texture_ref->texture()->target(); | 514 GLenum target = texture_ref->texture()->target(); |
| 515 gpu::gles2::TextureManager* texture_manager = | 515 gpu::gles2::TextureManager* texture_manager = |
| 516 stub_->decoder()->GetContextGroup()->texture_manager(); | 516 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 517 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 517 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0, 0)); |
| 518 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 518 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, 0, true); |
| 519 } | 519 } |
| 520 uncleared_textures_.erase(it); | 520 uncleared_textures_.erase(it); |
| 521 } | 521 } |
| 522 | 522 |
| 523 } // namespace media | 523 } // namespace media |
| OLD | NEW |