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

Side by Side Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 1389133002: content: Use type-parameterized tests for GpuMemoryBuffer implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add blankline Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/gpu/browser_gpu_memory_buffer_manager.h" 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "base/synchronization/waitable_event.h" 11 #include "base/synchronization/waitable_event.h"
12 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
13 #include "base/trace_event/process_memory_dump.h" 13 #include "base/trace_event/process_memory_dump.h"
14 #include "base/trace_event/trace_event.h" 14 #include "base/trace_event/trace_event.h"
15 #include "content/browser/gpu/gpu_process_host.h" 15 #include "content/browser/gpu/gpu_process_host.h"
16 #include "content/common/child_process_host_impl.h" 16 #include "content/common/child_process_host_impl.h"
17 #include "content/common/generic_shared_memory_id_generator.h" 17 #include "content/common/generic_shared_memory_id_generator.h"
18 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" 18 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
19 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" 19 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
20 #include "content/common/gpu/gpu_memory_buffer_factory_shared_memory.h" 20 #include "content/common/gpu/gpu_memory_buffer_factory.h"
21 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
22 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
23 #include "gpu/GLES2/gl2extchromium.h" 23 #include "gpu/GLES2/gl2extchromium.h"
24 #include "ui/gfx/buffer_format_util.h" 24 #include "ui/gfx/buffer_format_util.h"
25 #include "ui/gl/gl_switches.h" 25 #include "ui/gl/gl_switches.h"
26 26
27 #if defined(OS_MACOSX) 27 #if defined(OS_MACOSX)
28 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" 28 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h"
29 #endif 29 #endif
30 30
31 #if defined(OS_ANDROID) 31 #if defined(OS_ANDROID)
32 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h" 32 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h"
33 #endif 33 #endif
34 34
35 #if defined(USE_OZONE) 35 #if defined(USE_OZONE)
36 #include "content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h" 36 #include "content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h"
37 #endif 37 #endif
38 38
39 namespace content { 39 namespace content {
40 namespace { 40 namespace {
41 41
42 void GpuMemoryBufferDeleted( 42 void GpuMemoryBufferDeleted(
43 scoped_refptr<base::SingleThreadTaskRunner> destruction_task_runner, 43 scoped_refptr<base::SingleThreadTaskRunner> destruction_task_runner,
44 const GpuMemoryBufferImpl::DestructionCallback& destruction_callback, 44 const GpuMemoryBufferImpl::DestructionCallback& destruction_callback,
45 uint32 sync_point) { 45 uint32 sync_point) {
46 destruction_task_runner->PostTask( 46 destruction_task_runner->PostTask(
47 FROM_HERE, base::Bind(destruction_callback, sync_point)); 47 FROM_HERE, base::Bind(destruction_callback, sync_point));
48 } 48 }
49 49
50 bool IsGpuMemoryBufferFactoryConfigurationSupported( 50 bool IsNativeGpuMemoryBufferFactoryConfigurationSupported(
51 gfx::GpuMemoryBufferType type, 51 gfx::BufferFormat format,
52 const GpuMemoryBufferFactory::Configuration& configuration) { 52 gfx::BufferUsage usage) {
53 switch (type) { 53 switch (GpuMemoryBufferFactory::GetNativeType()) {
54 case gfx::SHARED_MEMORY_BUFFER: 54 case gfx::SHARED_MEMORY_BUFFER:
55 return GpuMemoryBufferFactorySharedMemory:: 55 return false;
56 IsGpuMemoryBufferConfigurationSupported(configuration.format,
57 configuration.usage);
58 #if defined(OS_MACOSX) 56 #if defined(OS_MACOSX)
59 case gfx::IO_SURFACE_BUFFER: 57 case gfx::IO_SURFACE_BUFFER:
60 return GpuMemoryBufferFactoryIOSurface:: 58 return GpuMemoryBufferFactoryIOSurface::
61 IsGpuMemoryBufferConfigurationSupported(configuration.format, 59 IsGpuMemoryBufferConfigurationSupported(format, usage);
62 configuration.usage);
63 #endif 60 #endif
64 #if defined(OS_ANDROID) 61 #if defined(OS_ANDROID)
65 case gfx::SURFACE_TEXTURE_BUFFER: 62 case gfx::SURFACE_TEXTURE_BUFFER:
66 return GpuMemoryBufferFactorySurfaceTexture:: 63 return GpuMemoryBufferFactorySurfaceTexture::
67 IsGpuMemoryBufferConfigurationSupported(configuration.format, 64 IsGpuMemoryBufferConfigurationSupported(format, usage);
68 configuration.usage);
69 #endif 65 #endif
70 #if defined(USE_OZONE) 66 #if defined(USE_OZONE)
71 case gfx::OZONE_NATIVE_PIXMAP: 67 case gfx::OZONE_NATIVE_PIXMAP:
72 return GpuMemoryBufferFactoryOzoneNativePixmap:: 68 return GpuMemoryBufferFactoryOzoneNativePixmap::
73 IsGpuMemoryBufferConfigurationSupported(configuration.format, 69 IsGpuMemoryBufferConfigurationSupported(format, usage);
74 configuration.usage);
75 #endif 70 #endif
76 default: 71 default:
77 NOTREACHED(); 72 NOTREACHED();
78 return false; 73 return false;
79 } 74 }
80 } 75 }
81 76
82 gfx::GpuMemoryBufferType GetGpuMemoryBufferFactoryType() { 77 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
83 std::vector<gfx::GpuMemoryBufferType> supported_types; 78 GpuMemoryBufferConfigurationSet configurations;
84 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types);
85 DCHECK(!supported_types.empty());
86
87 // The GPU service will always use the preferred type.
88 return supported_types[0];
89 }
90
91 std::vector<GpuMemoryBufferFactory::Configuration>
92 GetSupportedGpuMemoryBufferConfigurations(gfx::GpuMemoryBufferType type) {
93 std::vector<GpuMemoryBufferFactory::Configuration> configurations;
94 #if defined(OS_MACOSX) 79 #if defined(OS_MACOSX)
95 bool enable_native_gpu_memory_buffers = 80 bool enable_native_gpu_memory_buffers =
96 !base::CommandLine::ForCurrentProcess()->HasSwitch( 81 !base::CommandLine::ForCurrentProcess()->HasSwitch(
97 switches::kDisableNativeGpuMemoryBuffers); 82 switches::kDisableNativeGpuMemoryBuffers);
98 #else 83 #else
99 bool enable_native_gpu_memory_buffers = 84 bool enable_native_gpu_memory_buffers =
100 base::CommandLine::ForCurrentProcess()->HasSwitch( 85 base::CommandLine::ForCurrentProcess()->HasSwitch(
101 switches::kEnableNativeGpuMemoryBuffers); 86 switches::kEnableNativeGpuMemoryBuffers);
102 #endif 87 #endif
103 88
89 #if defined(USE_OZONE) || defined(OS_MACOSX)
90 bool force_native_scanout_formats = true;
91 #else
92 bool force_native_scanout_formats = false;
93 #endif
94
104 // Disable native buffers when using Mesa. 95 // Disable native buffers when using Mesa.
105 if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 96 if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
106 switches::kUseGL) == gfx::kGLImplementationOSMesaName) { 97 switches::kUseGL) == gfx::kGLImplementationOSMesaName) {
107 enable_native_gpu_memory_buffers = false; 98 enable_native_gpu_memory_buffers = false;
99 force_native_scanout_formats = false;
108 } 100 }
109 101
110 if (enable_native_gpu_memory_buffers) { 102 if (enable_native_gpu_memory_buffers) {
111 const GpuMemoryBufferFactory::Configuration kNativeConfigurations[] = { 103 const gfx::BufferFormat kNativeFormats[] = {
112 {gfx::BufferFormat::R_8, gfx::BufferUsage::MAP}, 104 gfx::BufferFormat::R_8, gfx::BufferFormat::RGBA_4444,
113 {gfx::BufferFormat::R_8, gfx::BufferUsage::PERSISTENT_MAP}, 105 gfx::BufferFormat::RGBA_8888, gfx::BufferFormat::BGRA_8888,
114 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::MAP}, 106 gfx::BufferFormat::UYVY_422, gfx::BufferFormat::YUV_420_BIPLANAR};
115 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::PERSISTENT_MAP}, 107 const gfx::BufferUsage kNativeUsages[] = {gfx::BufferUsage::MAP,
116 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::MAP}, 108 gfx::BufferUsage::PERSISTENT_MAP};
117 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::PERSISTENT_MAP}, 109 for (auto& format : kNativeFormats) {
118 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::MAP}, 110 for (auto& usage : kNativeUsages) {
119 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::PERSISTENT_MAP}, 111 if (IsNativeGpuMemoryBufferFactoryConfigurationSupported(format, usage))
120 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::MAP}, 112 configurations.insert(std::make_pair(format, usage));
121 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::PERSISTENT_MAP}, 113 }
122 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::MAP},
123 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::PERSISTENT_MAP},
124 };
125 for (auto& configuration : kNativeConfigurations) {
126 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration))
127 configurations.push_back(configuration);
128 } 114 }
129 } 115 }
130 116
131 #if defined(USE_OZONE) || defined(OS_MACOSX) 117 if (force_native_scanout_formats) {
132 const GpuMemoryBufferFactory::Configuration kScanoutConfigurations[] = { 118 const gfx::BufferFormat kScanoutFormats[] = {
133 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT}, 119 gfx::BufferFormat::BGRA_8888, gfx::BufferFormat::BGRX_8888,
134 {gfx::BufferFormat::BGRX_8888, gfx::BufferUsage::SCANOUT}, 120 gfx::BufferFormat::UYVY_422, gfx::BufferFormat::YUV_420_BIPLANAR};
135 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::SCANOUT}, 121 for (auto& format : kScanoutFormats) {
136 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::SCANOUT}, 122 if (IsNativeGpuMemoryBufferFactoryConfigurationSupported(
137 }; 123 format, gfx::BufferUsage::SCANOUT)) {
138 for (auto& configuration : kScanoutConfigurations) { 124 configurations.insert(
139 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration)) 125 std::make_pair(format, gfx::BufferUsage::SCANOUT));
140 configurations.push_back(configuration); 126 }
127 }
141 } 128 }
142 #endif
143 129
144 return configurations; 130 return configurations;
145 } 131 }
146 132
147 BrowserGpuMemoryBufferManager* g_gpu_memory_buffer_manager = nullptr; 133 BrowserGpuMemoryBufferManager* g_gpu_memory_buffer_manager = nullptr;
148 134
149 } // namespace 135 } // namespace
150 136
151 struct BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferRequest { 137 struct BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferRequest {
152 AllocateGpuMemoryBufferRequest(const gfx::Size& size, 138 AllocateGpuMemoryBufferRequest(const gfx::Size& size,
(...skipping 13 matching lines...) Expand all
166 gfx::BufferFormat format; 152 gfx::BufferFormat format;
167 gfx::BufferUsage usage; 153 gfx::BufferUsage usage;
168 int client_id; 154 int client_id;
169 int surface_id; 155 int surface_id;
170 scoped_ptr<gfx::GpuMemoryBuffer> result; 156 scoped_ptr<gfx::GpuMemoryBuffer> result;
171 }; 157 };
172 158
173 BrowserGpuMemoryBufferManager::BrowserGpuMemoryBufferManager( 159 BrowserGpuMemoryBufferManager::BrowserGpuMemoryBufferManager(
174 int gpu_client_id, 160 int gpu_client_id,
175 uint64_t gpu_client_tracing_id) 161 uint64_t gpu_client_tracing_id)
176 : factory_type_(GetGpuMemoryBufferFactoryType()), 162 : native_configurations_(GetNativeGpuMemoryBufferConfigurations()),
177 supported_configurations_(
178 GetSupportedGpuMemoryBufferConfigurations(factory_type_)),
179 gpu_client_id_(gpu_client_id), 163 gpu_client_id_(gpu_client_id),
180 gpu_client_tracing_id_(gpu_client_tracing_id), 164 gpu_client_tracing_id_(gpu_client_tracing_id),
181 gpu_host_id_(0) { 165 gpu_host_id_(0) {
182 DCHECK(!g_gpu_memory_buffer_manager); 166 DCHECK(!g_gpu_memory_buffer_manager);
183 g_gpu_memory_buffer_manager = this; 167 g_gpu_memory_buffer_manager = this;
184 } 168 }
185 169
186 BrowserGpuMemoryBufferManager::~BrowserGpuMemoryBufferManager() { 170 BrowserGpuMemoryBufferManager::~BrowserGpuMemoryBufferManager() {
187 g_gpu_memory_buffer_manager = nullptr; 171 g_gpu_memory_buffer_manager = nullptr;
188 } 172 }
189 173
190 // static 174 // static
191 BrowserGpuMemoryBufferManager* BrowserGpuMemoryBufferManager::current() { 175 BrowserGpuMemoryBufferManager* BrowserGpuMemoryBufferManager::current() {
192 return g_gpu_memory_buffer_manager; 176 return g_gpu_memory_buffer_manager;
193 } 177 }
194 178
195 // static 179 // static
196 uint32 BrowserGpuMemoryBufferManager::GetImageTextureTarget( 180 uint32 BrowserGpuMemoryBufferManager::GetImageTextureTarget(
197 gfx::BufferFormat format, 181 gfx::BufferFormat format,
198 gfx::BufferUsage usage) { 182 gfx::BufferUsage usage) {
199 gfx::GpuMemoryBufferType type = GetGpuMemoryBufferFactoryType(); 183 GpuMemoryBufferConfigurationSet native_configurations =
200 for (auto& configuration : GetSupportedGpuMemoryBufferConfigurations(type)) { 184 GetNativeGpuMemoryBufferConfigurations();
201 if (configuration.format != format || configuration.usage != usage) 185 if (native_configurations.find(std::make_pair(format, usage)) ==
202 continue; 186 native_configurations.end()) {
203 187 return GL_TEXTURE_2D;
204 switch (type) {
205 case gfx::SURFACE_TEXTURE_BUFFER:
206 case gfx::OZONE_NATIVE_PIXMAP:
207 // GPU memory buffers that are shared with the GL using EGLImages
208 // require TEXTURE_EXTERNAL_OES.
209 return GL_TEXTURE_EXTERNAL_OES;
210 case gfx::IO_SURFACE_BUFFER:
211 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB.
212 return GL_TEXTURE_RECTANGLE_ARB;
213 default:
214 return GL_TEXTURE_2D;
215 }
216 } 188 }
217 189
190 switch (GpuMemoryBufferFactory::GetNativeType()) {
191 case gfx::SURFACE_TEXTURE_BUFFER:
192 case gfx::OZONE_NATIVE_PIXMAP:
193 // GPU memory buffers that are shared with the GL using EGLImages
194 // require TEXTURE_EXTERNAL_OES.
195 return GL_TEXTURE_EXTERNAL_OES;
196 case gfx::IO_SURFACE_BUFFER:
197 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB.
198 return GL_TEXTURE_RECTANGLE_ARB;
199 case gfx::SHARED_MEMORY_BUFFER:
200 return GL_TEXTURE_2D;
201 case gfx::EMPTY_BUFFER:
202 NOTREACHED();
203 return GL_TEXTURE_2D;
204 }
205
206 NOTREACHED();
218 return GL_TEXTURE_2D; 207 return GL_TEXTURE_2D;
219 } 208 }
220 209
221 scoped_ptr<gfx::GpuMemoryBuffer> 210 scoped_ptr<gfx::GpuMemoryBuffer>
222 BrowserGpuMemoryBufferManager::AllocateGpuMemoryBuffer(const gfx::Size& size, 211 BrowserGpuMemoryBufferManager::AllocateGpuMemoryBuffer(const gfx::Size& size,
223 gfx::BufferFormat format, 212 gfx::BufferFormat format,
224 gfx::BufferUsage usage) { 213 gfx::BufferUsage usage) {
225 return AllocateGpuMemoryBufferForSurface(size, format, usage, 0); 214 return AllocateGpuMemoryBufferForSurface(size, format, usage, 0);
226 } 215 }
227 216
(...skipping 10 matching lines...) Expand all
238 void BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForChildProcess( 227 void BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForChildProcess(
239 gfx::GpuMemoryBufferId id, 228 gfx::GpuMemoryBufferId id,
240 const gfx::Size& size, 229 const gfx::Size& size,
241 gfx::BufferFormat format, 230 gfx::BufferFormat format,
242 gfx::BufferUsage usage, 231 gfx::BufferUsage usage,
243 base::ProcessHandle child_process_handle, 232 base::ProcessHandle child_process_handle,
244 int child_client_id, 233 int child_client_id,
245 const AllocationCallback& callback) { 234 const AllocationCallback& callback) {
246 DCHECK_CURRENTLY_ON(BrowserThread::IO); 235 DCHECK_CURRENTLY_ON(BrowserThread::IO);
247 236
248 // Use service side allocation if this is a supported configuration. 237 // Use service side allocation for native configurations.
249 if (IsGpuMemoryBufferConfigurationSupported(format, usage)) { 238 if (IsNativeGpuMemoryBufferConfiguration(format, usage)) {
250 AllocateGpuMemoryBufferOnIO(id, size, format, usage, child_client_id, 0, 239 AllocateGpuMemoryBufferOnIO(id, size, format, usage, child_client_id, 0,
251 false, callback); 240 false, callback);
252 return; 241 return;
253 } 242 }
254 243
255 // Early out if we cannot fallback to shared memory buffer. 244 // Early out if we cannot fallback to shared memory buffer.
256 if (!GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) || 245 if (!GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) ||
257 !GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage) || 246 !GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage) ||
258 !GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat(size, format)) { 247 !GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat(size, format)) {
259 callback.Run(gfx::GpuMemoryBufferHandle()); 248 callback.Run(gfx::GpuMemoryBufferHandle());
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 373
385 // We're blocking the UI thread, which is generally undesirable. 374 // We're blocking the UI thread, which is generally undesirable.
386 TRACE_EVENT0( 375 TRACE_EVENT0(
387 "browser", 376 "browser",
388 "BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForSurface"); 377 "BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForSurface");
389 base::ThreadRestrictions::ScopedAllowWait allow_wait; 378 base::ThreadRestrictions::ScopedAllowWait allow_wait;
390 request.event.Wait(); 379 request.event.Wait();
391 return request.result.Pass(); 380 return request.result.Pass();
392 } 381 }
393 382
394 bool BrowserGpuMemoryBufferManager::IsGpuMemoryBufferConfigurationSupported( 383 bool BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBufferConfiguration(
395 gfx::BufferFormat format, 384 gfx::BufferFormat format,
396 gfx::BufferUsage usage) const { 385 gfx::BufferUsage usage) const {
397 for (auto& configuration : supported_configurations_) { 386 return native_configurations_.find(std::make_pair(format, usage)) !=
398 if (configuration.format == format && configuration.usage == usage) 387 native_configurations_.end();
399 return true;
400 }
401 return false;
402 } 388 }
403 389
404 void BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForSurfaceOnIO( 390 void BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForSurfaceOnIO(
405 AllocateGpuMemoryBufferRequest* request) { 391 AllocateGpuMemoryBufferRequest* request) {
406 DCHECK_CURRENTLY_ON(BrowserThread::IO); 392 DCHECK_CURRENTLY_ON(BrowserThread::IO);
407 393
408 gfx::GpuMemoryBufferId new_id = content::GetNextGenericSharedMemoryId(); 394 gfx::GpuMemoryBufferId new_id = content::GetNextGenericSharedMemoryId();
409 395
410 // Use service side allocation if this is a supported configuration. 396 // Use service side allocation for native configurations.
411 if (IsGpuMemoryBufferConfigurationSupported(request->format, 397 if (IsNativeGpuMemoryBufferConfiguration(request->format, request->usage)) {
412 request->usage)) {
413 // Note: Unretained is safe as this is only used for synchronous allocation 398 // Note: Unretained is safe as this is only used for synchronous allocation
414 // from a non-IO thread. 399 // from a non-IO thread.
415 AllocateGpuMemoryBufferOnIO( 400 AllocateGpuMemoryBufferOnIO(
416 new_id, request->size, request->format, request->usage, 401 new_id, request->size, request->format, request->usage,
417 request->client_id, request->surface_id, false, 402 request->client_id, request->surface_id, false,
418 base::Bind(&BrowserGpuMemoryBufferManager:: 403 base::Bind(&BrowserGpuMemoryBufferManager::
419 GpuMemoryBufferAllocatedForSurfaceOnIO, 404 GpuMemoryBufferAllocatedForSurfaceOnIO,
420 base::Unretained(this), base::Unretained(request))); 405 base::Unretained(this), base::Unretained(request)));
421 return; 406 return;
422 } 407 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 return gpu_client_tracing_id_; 614 return gpu_client_tracing_id_;
630 } 615 }
631 616
632 // In normal cases, |client_id| is a child process id, so we can perform 617 // In normal cases, |client_id| is a child process id, so we can perform
633 // the standard conversion. 618 // the standard conversion.
634 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId( 619 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId(
635 client_id); 620 client_id);
636 } 621 }
637 622
638 } // namespace content 623 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_memory_buffer_manager.h ('k') | content/common/gpu/client/gpu_memory_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698