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

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

Issue 1050923003: zero-copy: Clarify to allocate/destroy GpuMemoryBuffer on any thread and use it on the main thread o (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rephrase comment in gpu_channel_manager.cc Created 5 years, 8 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
« no previous file with comments | « no previous file | content/common/gpu/gpu_memory_buffer_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_buffer_factory.h" 10 #include "content/common/gpu/gpu_memory_buffer_factory.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 IPC_BEGIN_MESSAGE_MAP(GpuChannelManagerMessageFilter, message) 52 IPC_BEGIN_MESSAGE_MAP(GpuChannelManagerMessageFilter, message)
53 IPC_MESSAGE_HANDLER(GpuMsg_CreateGpuMemoryBuffer, OnCreateGpuMemoryBuffer) 53 IPC_MESSAGE_HANDLER(GpuMsg_CreateGpuMemoryBuffer, OnCreateGpuMemoryBuffer)
54 IPC_MESSAGE_UNHANDLED(handled = false) 54 IPC_MESSAGE_UNHANDLED(handled = false)
55 IPC_END_MESSAGE_MAP() 55 IPC_END_MESSAGE_MAP()
56 return handled; 56 return handled;
57 } 57 }
58 58
59 protected: 59 protected:
60 ~GpuChannelManagerMessageFilter() override {} 60 ~GpuChannelManagerMessageFilter() override {}
61 61
62 // GPU IO thread bounces off GpuMsg_CreateGpuMemoryBuffer message, because
63 // the UI thread in the browser process must remain fast at all times.
62 void OnCreateGpuMemoryBuffer( 64 void OnCreateGpuMemoryBuffer(
63 const GpuMsg_CreateGpuMemoryBuffer_Params& params) { 65 const GpuMsg_CreateGpuMemoryBuffer_Params& params) {
64 TRACE_EVENT2("gpu", 66 TRACE_EVENT2("gpu",
65 "GpuChannelManagerMessageFilter::OnCreateGpuMemoryBuffer", 67 "GpuChannelManagerMessageFilter::OnCreateGpuMemoryBuffer",
66 "id", params.id, "client_id", params.client_id); 68 "id", params.id, "client_id", params.client_id);
67 sender_->Send(new GpuHostMsg_GpuMemoryBufferCreated( 69 sender_->Send(new GpuHostMsg_GpuMemoryBufferCreated(
68 gpu_memory_buffer_factory_->CreateGpuMemoryBuffer( 70 gpu_memory_buffer_factory_->CreateGpuMemoryBuffer(
69 params.id, params.size, params.format, params.usage, 71 params.id, params.size, params.format, params.usage,
70 params.client_id, params.surface_handle))); 72 params.client_id, params.surface_handle)));
71 } 73 }
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 OnResourcesRelinquished(); 365 OnResourcesRelinquished();
364 #endif 366 #endif
365 } 367 }
366 } 368 }
367 369
368 void GpuChannelManager::OnResourcesRelinquished() { 370 void GpuChannelManager::OnResourcesRelinquished() {
369 Send(new GpuHostMsg_ResourcesRelinquished()); 371 Send(new GpuHostMsg_ResourcesRelinquished());
370 } 372 }
371 373
372 } // namespace content 374 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_memory_buffer_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698