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