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

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

Issue 2810593003: gpu: Some cleanups. (Closed)
Patch Set: . Created 3 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
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 <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
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
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
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/browser/gpu/gpu_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698