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

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/gpu_channel_host.cc
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index d0ceecd26211e2c255ad48504a0c40dd459782a7..f7f5d823eedb84285f08f16f93c8b609bcd80793 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -35,39 +35,24 @@ scoped_refptr<GpuChannelHost> GpuChannelHost::Create(
GpuChannelHostFactory* factory,
const gpu::GPUInfo& gpu_info,
const IPC::ChannelHandle& channel_handle,
- base::WaitableEvent* shutdown_event) {
+ base::WaitableEvent* shutdown_event,
+ cc::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
DCHECK(factory->IsMainThread());
- scoped_refptr<GpuChannelHost> host = new GpuChannelHost(factory, gpu_info);
+ scoped_refptr<GpuChannelHost> host =
+ new GpuChannelHost(factory, gpu_info, gpu_memory_buffer_manager);
host->Connect(channel_handle, shutdown_event);
return host;
}
-// static
-bool GpuChannelHost::IsValidGpuMemoryBuffer(
- gfx::GpuMemoryBufferHandle handle) {
- switch (handle.type) {
- case gfx::SHARED_MEMORY_BUFFER:
-#if defined(OS_MACOSX)
- case gfx::IO_SURFACE_BUFFER:
-#endif
-#if defined(OS_ANDROID)
- case gfx::SURFACE_TEXTURE_BUFFER:
-#endif
-#if defined(USE_X11)
- case gfx::X11_PIXMAP_BUFFER:
-#endif
- return true;
- default:
- return false;
- }
-}
-
-GpuChannelHost::GpuChannelHost(GpuChannelHostFactory* factory,
- const gpu::GPUInfo& gpu_info)
+GpuChannelHost::GpuChannelHost(
+ GpuChannelHostFactory* factory,
+ const gpu::GPUInfo& gpu_info,
+ cc::GpuMemoryBufferManager* gpu_memory_buffer_manager)
: factory_(factory),
- gpu_info_(gpu_info) {
+ gpu_info_(gpu_info),
+ gpu_memory_buffer_manager_(gpu_memory_buffer_manager) {
next_transfer_buffer_id_.GetNext();
- next_gpu_memory_buffer_id_.GetNext();
+ next_image_id_.GetNext();
next_route_id_.GetNext();
}
@@ -326,8 +311,8 @@ gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess(
}
}
-int32 GpuChannelHost::ReserveGpuMemoryBufferId() {
- return next_gpu_memory_buffer_id_.GetNext();
+int32 GpuChannelHost::ReserveImageId() {
+ return next_image_id_.GetNext();
}
int32 GpuChannelHost::GenerateRouteID() {
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.h ('k') | content/common/gpu/client/gpu_memory_buffer_factory_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698