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

Side by Side Diff: content/renderer/pepper/pepper_video_encoder_host.cc

Issue 2107783003: Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fix Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer/pepper/pepper_video_encoder_host.h" 5 #include "content/renderer/pepper/pepper_video_encoder_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 522
523 // There is no guarantee that we have a 3D context to work with. So 523 // There is no guarantee that we have a 3D context to work with. So
524 // we create a dummy command buffer to communicate with the gpu process. 524 // we create a dummy command buffer to communicate with the gpu process.
525 scoped_refptr<gpu::GpuChannelHost> channel = 525 scoped_refptr<gpu::GpuChannelHost> channel =
526 RenderThreadImpl::current()->EstablishGpuChannelSync( 526 RenderThreadImpl::current()->EstablishGpuChannelSync(
527 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE); 527 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE);
528 if (!channel) 528 if (!channel)
529 return false; 529 return false;
530 530
531 command_buffer_ = gpu::CommandBufferProxyImpl::Create( 531 command_buffer_ = gpu::CommandBufferProxyImpl::Create(
532 std::move(channel), gpu::kNullSurfaceHandle, gfx::Size(), nullptr, 532 std::move(channel), gpu::kNullSurfaceHandle, nullptr,
533 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, 533 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL,
534 gpu::gles2::ContextCreationAttribHelper(), GURL::EmptyGURL(), 534 gpu::gles2::ContextCreationAttribHelper(), GURL::EmptyGURL(),
535 gl::PreferIntegratedGpu, base::ThreadTaskRunnerHandle::Get()); 535 base::ThreadTaskRunnerHandle::Get());
536 if (!command_buffer_) { 536 if (!command_buffer_) {
537 Close(); 537 Close();
538 return false; 538 return false;
539 } 539 }
540 540
541 command_buffer_->SetGpuControlClient(this); 541 command_buffer_->SetGpuControlClient(this);
542 542
543 return true; 543 return true;
544 } 544 }
545 545
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 } 679 }
680 680
681 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { 681 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) {
682 DCHECK(RenderThreadImpl::current()); 682 DCHECK(RenderThreadImpl::current());
683 DCHECK_GE(buffer_id, 0); 683 DCHECK_GE(buffer_id, 0);
684 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); 684 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size()));
685 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); 685 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory());
686 } 686 }
687 687
688 } // namespace content 688 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.cc ('k') | content/renderer/pepper/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698