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

Side by Side Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 2717213004: Move SharedBitmapManager implementation out of content/ (Closed)
Patch Set: rebase Created 3 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/renderer_gpu_video_accelerator_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/metrics/histogram_macros.h" 12 #include "base/metrics/histogram_macros.h"
13 #include "base/unguessable_token.h" 13 #include "base/unguessable_token.h"
14 #include "cc/output/context_provider.h" 14 #include "cc/output/context_provider.h"
15 #include "components/display_compositor/child/child_shared_bitmap_manager.h"
15 #include "content/child/child_thread_impl.h" 16 #include "content/child/child_thread_impl.h"
16 #include "content/renderer/render_thread_impl.h" 17 #include "content/renderer/render_thread_impl.h"
17 #include "gpu/command_buffer/client/gles2_interface.h" 18 #include "gpu/command_buffer/client/gles2_interface.h"
18 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" 19 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
19 #include "gpu/ipc/client/gpu_channel_host.h" 20 #include "gpu/ipc/client/gpu_channel_host.h"
20 #include "media/gpu/gpu_video_accelerator_util.h" 21 #include "media/gpu/gpu_video_accelerator_util.h"
21 #include "media/gpu/ipc/client/gpu_video_decode_accelerator_host.h" 22 #include "media/gpu/ipc/client/gpu_video_decode_accelerator_host.h"
22 #include "media/gpu/ipc/client/gpu_video_encode_accelerator_host.h" 23 #include "media/gpu/ipc/client/gpu_video_encode_accelerator_host.h"
23 #include "media/gpu/ipc/common/media_messages.h" 24 #include "media/gpu/ipc/common/media_messages.h"
24 #include "media/video/video_decode_accelerator.h" 25 #include "media/video/video_decode_accelerator.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> 299 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock>
299 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { 300 RendererGpuVideoAcceleratorFactories::GetGLContextLock() {
300 if (CheckContextLost()) 301 if (CheckContextLost())
301 return nullptr; 302 return nullptr;
302 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_); 303 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_);
303 } 304 }
304 305
305 std::unique_ptr<base::SharedMemory> 306 std::unique_ptr<base::SharedMemory>
306 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { 307 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) {
307 std::unique_ptr<base::SharedMemory> mem( 308 std::unique_ptr<base::SharedMemory> mem(
308 ChildThreadImpl::AllocateSharedMemory(size)); 309 display_compositor::ChildSharedBitmapManager::AllocateSharedMemory(size));
309 if (mem && !mem->Map(size)) 310 if (mem && !mem->Map(size))
310 return nullptr; 311 return nullptr;
311 return mem; 312 return mem;
312 } 313 }
313 314
314 scoped_refptr<base::SingleThreadTaskRunner> 315 scoped_refptr<base::SingleThreadTaskRunner>
315 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { 316 RendererGpuVideoAcceleratorFactories::GetTaskRunner() {
316 return task_runner_; 317 return task_runner_;
317 } 318 }
318 319
(...skipping 18 matching lines...) Expand all
337 context_provider_refptr_ = nullptr; 338 context_provider_refptr_ = nullptr;
338 } 339 }
339 340
340 scoped_refptr<ui::ContextProviderCommandBuffer> 341 scoped_refptr<ui::ContextProviderCommandBuffer>
341 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { 342 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() {
342 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 343 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
343 return context_provider_refptr_; 344 return context_provider_refptr_;
344 } 345 }
345 346
346 } // namespace content 347 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698