| 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 "content/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 make_context_current_, | 437 make_context_current_, |
| 438 io_task_runner_)); | 438 io_task_runner_)); |
| 439 } | 439 } |
| 440 return decoder; | 440 return decoder; |
| 441 } | 441 } |
| 442 #endif | 442 #endif |
| 443 | 443 |
| 444 #if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) | 444 #if (defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)) || defined(OS_MACOSX) |
| 445 void GpuVideoDecodeAccelerator::BindImage(uint32_t client_texture_id, | 445 void GpuVideoDecodeAccelerator::BindImage(uint32_t client_texture_id, |
| 446 uint32_t texture_target, | 446 uint32_t texture_target, |
| 447 scoped_refptr<gl::GLImage> image) { | 447 scoped_refptr<gl::GLImage> image, |
| 448 bool can_bind_to_sampler) { |
| 448 gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder(); | 449 gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder(); |
| 449 gpu::gles2::TextureManager* texture_manager = | 450 gpu::gles2::TextureManager* texture_manager = |
| 450 command_decoder->GetContextGroup()->texture_manager(); | 451 command_decoder->GetContextGroup()->texture_manager(); |
| 451 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id); | 452 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id); |
| 452 if (ref) { | 453 if (ref) { |
| 453 texture_manager->SetLevelImage(ref, texture_target, 0, image.get(), | 454 texture_manager->SetLevelImage(ref, texture_target, 0, image.get(), |
| 454 gpu::gles2::Texture::BOUND); | 455 can_bind_to_sampler |
| 456 ? gpu::gles2::Texture::BOUND |
| 457 : gpu::gles2::Texture::UNBOUND); |
| 455 } | 458 } |
| 456 } | 459 } |
| 457 #endif | 460 #endif |
| 458 | 461 |
| 459 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 462 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 460 scoped_ptr<media::VideoDecodeAccelerator> | 463 scoped_ptr<media::VideoDecodeAccelerator> |
| 461 GpuVideoDecodeAccelerator::CreateVaapiVDA() { | 464 GpuVideoDecodeAccelerator::CreateVaapiVDA() { |
| 462 return make_scoped_ptr<media::VideoDecodeAccelerator>( | 465 return make_scoped_ptr<media::VideoDecodeAccelerator>( |
| 463 new VaapiVideoDecodeAccelerator( | 466 new VaapiVideoDecodeAccelerator( |
| 464 make_context_current_, | 467 make_context_current_, |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; | 628 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; |
| 626 GLenum target = texture_ref->texture()->target(); | 629 GLenum target = texture_ref->texture()->target(); |
| 627 gpu::gles2::TextureManager* texture_manager = | 630 gpu::gles2::TextureManager* texture_manager = |
| 628 stub_->decoder()->GetContextGroup()->texture_manager(); | 631 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 629 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 632 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
| 630 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 633 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 631 uncleared_textures_.erase(it); | 634 uncleared_textures_.erase(it); |
| 632 } | 635 } |
| 633 | 636 |
| 634 } // namespace content | 637 } // namespace content |
| OLD | NEW |