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