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

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

Issue 1963263002: Fix Mac resize, delete more Mac code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 4 years, 7 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 RenderThreadImpl::current()->EstablishGpuChannelSync( 523 RenderThreadImpl::current()->EstablishGpuChannelSync(
524 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE); 524 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE);
525 if (!channel) 525 if (!channel)
526 return false; 526 return false;
527 527
528 std::vector<int32_t> attribs(1, PP_GRAPHICS3DATTRIB_NONE); 528 std::vector<int32_t> attribs(1, PP_GRAPHICS3DATTRIB_NONE);
529 command_buffer_ = channel->CreateCommandBuffer( 529 command_buffer_ = channel->CreateCommandBuffer(
530 gpu::kNullSurfaceHandle, gfx::Size(), nullptr, 530 gpu::kNullSurfaceHandle, gfx::Size(), nullptr,
531 gpu::GpuChannelHost::kDefaultStreamId, 531 gpu::GpuChannelHost::kDefaultStreamId,
532 gpu::GpuChannelHost::kDefaultStreamPriority, attribs, GURL::EmptyGURL(), 532 gpu::GpuChannelHost::kDefaultStreamPriority, attribs, GURL::EmptyGURL(),
533 gfx::PreferIntegratedGpu); 533 gfx::PreferIntegratedGpu, base::ThreadTaskRunnerHandle::Get());
534 if (!command_buffer_) { 534 if (!command_buffer_) {
535 Close(); 535 Close();
536 return false; 536 return false;
537 } 537 }
538 538
539 command_buffer_->SetGpuControlClient(this); 539 command_buffer_->SetGpuControlClient(this);
540 540
541 return true; 541 return true;
542 } 542 }
543 543
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 } 677 }
678 678
679 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { 679 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) {
680 DCHECK(RenderThreadImpl::current()); 680 DCHECK(RenderThreadImpl::current());
681 DCHECK_GE(buffer_id, 0); 681 DCHECK_GE(buffer_id, 0);
682 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); 682 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size()));
683 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); 683 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory());
684 } 684 }
685 685
686 } // namespace content 686 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698