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

Side by Side Diff: content/common/gpu/gpu_channel_manager.cc

Issue 302603004: Plumb GpuMemoryBuffer allocation to GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/gpu_channel_manager.h" 5 #include "content/common/gpu/gpu_channel_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 #include "content/common/gpu/gpu_memory_manager.h" 10 #include "content/common/gpu/gpu_memory_manager.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { 104 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
105 bool handled = true; 105 bool handled = true;
106 IPC_BEGIN_MESSAGE_MAP(GpuChannelManager, msg) 106 IPC_BEGIN_MESSAGE_MAP(GpuChannelManager, msg)
107 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) 107 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel)
108 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) 108 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel)
109 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, 109 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer,
110 OnCreateViewCommandBuffer) 110 OnCreateViewCommandBuffer)
111 IPC_MESSAGE_HANDLER(GpuMsg_CreateImage, OnCreateImage) 111 IPC_MESSAGE_HANDLER(GpuMsg_CreateImage, OnCreateImage)
112 IPC_MESSAGE_HANDLER(GpuMsg_AllocateGpuMemoryBuffer,
113 OnAllocateGpuMemoryBuffer)
112 IPC_MESSAGE_HANDLER(GpuMsg_DeleteImage, OnDeleteImage) 114 IPC_MESSAGE_HANDLER(GpuMsg_DeleteImage, OnDeleteImage)
113 IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader) 115 IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader)
114 IPC_MESSAGE_UNHANDLED(handled = false) 116 IPC_MESSAGE_UNHANDLED(handled = false)
115 IPC_END_MESSAGE_MAP() 117 IPC_END_MESSAGE_MAP()
116 return handled; 118 return handled;
117 } 119 }
118 120
119 bool GpuChannelManager::Send(IPC::Message* msg) { return router_->Send(msg); } 121 bool GpuChannelManager::Send(IPC::Message* msg) { return router_->Send(msg); }
120 122
121 void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) { 123 void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Check if operation has a pending sync point. 253 // Check if operation has a pending sync point.
252 if (image_operations_.front()->sync_point) 254 if (image_operations_.front()->sync_point)
253 return; 255 return;
254 256
255 image_operations_.front()->callback.Run(); 257 image_operations_.front()->callback.Run();
256 delete image_operations_.front(); 258 delete image_operations_.front();
257 image_operations_.pop_front(); 259 image_operations_.pop_front();
258 } 260 }
259 } 261 }
260 262
263 void GpuChannelManager::OnAllocateGpuMemoryBuffer(
264 const gfx::GpuMemoryBufferParams& params) {
265 NOTIMPLEMENTED();
266
267 gfx::GpuMemoryBufferHandle handle;
268 Send(new GpuHostMsg_GpuMemoryBufferAllocated(handle));
269 }
270
261 void GpuChannelManager::OnLoadedShader(std::string program_proto) { 271 void GpuChannelManager::OnLoadedShader(std::string program_proto) {
262 if (program_cache()) 272 if (program_cache())
263 program_cache()->LoadProgram(program_proto); 273 program_cache()->LoadProgram(program_proto);
264 } 274 }
265 275
266 bool GpuChannelManager::HandleMessagesScheduled() { 276 bool GpuChannelManager::HandleMessagesScheduled() {
267 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); 277 for (GpuChannelMap::iterator iter = gpu_channels_.begin();
268 iter != gpu_channels_.end(); ++iter) { 278 iter != gpu_channels_.end(); ++iter) {
269 if (iter->second->handle_messages_scheduled()) 279 if (iter->second->handle_messages_scheduled())
270 return true; 280 return true;
(...skipping 28 matching lines...) Expand all
299 309
300 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { 310 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
301 if (!default_offscreen_surface_.get()) { 311 if (!default_offscreen_surface_.get()) {
302 default_offscreen_surface_ = 312 default_offscreen_surface_ =
303 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); 313 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
304 } 314 }
305 return default_offscreen_surface_.get(); 315 return default_offscreen_surface_.get();
306 } 316 }
307 317
308 } // namespace content 318 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698