| OLD | NEW |
| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 const gfx::Size& size, | 335 const gfx::Size& size, |
| 336 gfx::BufferFormat format, | 336 gfx::BufferFormat format, |
| 337 gfx::BufferUsage usage, | 337 gfx::BufferUsage usage, |
| 338 int client_id, | 338 int client_id, |
| 339 bool reused_gpu_process, | 339 bool reused_gpu_process, |
| 340 const CreateCallback& callback) { | 340 const CreateCallback& callback) { |
| 341 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 341 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 342 | 342 |
| 343 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); | 343 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); |
| 344 if (!host) { | 344 if (!host) { |
| 345 host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED); | 345 host = GpuProcessHost::Get(); |
| 346 if (!host) { | 346 if (!host) { |
| 347 LOG(ERROR) << "Failed to launch GPU process."; | 347 LOG(ERROR) << "Failed to launch GPU process."; |
| 348 callback.Run(gfx::GpuMemoryBufferHandle()); | 348 callback.Run(gfx::GpuMemoryBufferHandle()); |
| 349 return; | 349 return; |
| 350 } | 350 } |
| 351 gpu_host_id_ = host->host_id(); | 351 gpu_host_id_ = host->host_id(); |
| 352 reused_gpu_process = false; | 352 reused_gpu_process = false; |
| 353 } else { | 353 } else { |
| 354 if (reused_gpu_process) { | 354 if (reused_gpu_process) { |
| 355 // We come here if we retried to create the buffer because of a failure | 355 // We come here if we retried to create the buffer because of a failure |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 format(format), | 507 format(format), |
| 508 usage(usage), | 508 usage(usage), |
| 509 gpu_host_id(gpu_host_id) {} | 509 gpu_host_id(gpu_host_id) {} |
| 510 | 510 |
| 511 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = | 511 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = |
| 512 default; | 512 default; |
| 513 | 513 |
| 514 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} | 514 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} |
| 515 | 515 |
| 516 } // namespace content | 516 } // namespace content |
| OLD | NEW |