Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 1401423003: Re-land: ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase fix Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/command_line.h" 10 #include "base/command_line.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 return decoder.Pass(); 334 return decoder.Pass();
335 } 335 }
336 336
337 void GpuVideoDecodeAccelerator::BindImage(uint32 client_texture_id, 337 void GpuVideoDecodeAccelerator::BindImage(uint32 client_texture_id,
338 uint32 texture_target, 338 uint32 texture_target,
339 scoped_refptr<gfx::GLImage> image) { 339 scoped_refptr<gfx::GLImage> image) {
340 gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder(); 340 gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder();
341 gpu::gles2::TextureManager* texture_manager = 341 gpu::gles2::TextureManager* texture_manager =
342 command_decoder->GetContextGroup()->texture_manager(); 342 command_decoder->GetContextGroup()->texture_manager();
343 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id); 343 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id);
344 if (ref) 344 if (ref) {
345 texture_manager->SetLevelImage(ref, texture_target, 0, image.get()); 345 texture_manager->SetLevelImage(ref, texture_target, 0, image.get(),
346 gpu::gles2::Texture::BOUND);
347 }
346 } 348 }
347 349
348 scoped_ptr<media::VideoDecodeAccelerator> 350 scoped_ptr<media::VideoDecodeAccelerator>
349 GpuVideoDecodeAccelerator::CreateVaapiVDA() { 351 GpuVideoDecodeAccelerator::CreateVaapiVDA() {
350 scoped_ptr<media::VideoDecodeAccelerator> decoder; 352 scoped_ptr<media::VideoDecodeAccelerator> decoder;
351 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 353 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
352 decoder.reset(new VaapiVideoDecodeAccelerator( 354 decoder.reset(new VaapiVideoDecodeAccelerator(
353 make_context_current_, base::Bind(&GpuVideoDecodeAccelerator::BindImage, 355 make_context_current_, base::Bind(&GpuVideoDecodeAccelerator::BindImage,
354 base::Unretained(this)))); 356 base::Unretained(this))));
355 #endif 357 #endif
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 return stub_->channel()->Send(message); 620 return stub_->channel()->Send(message);
619 } 621 }
620 622
621 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 623 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
622 bool succeeded) { 624 bool succeeded) {
623 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 625 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
624 Send(message); 626 Send(message);
625 } 627 }
626 628
627 } // namespace content 629 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698