| OLD | NEW |
| 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/browser/gpu/browser_gpu_channel_host_factory.h" | 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.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 "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 scoped_refptr<base::SingleThreadTaskRunner> | 281 scoped_refptr<base::SingleThreadTaskRunner> |
| 282 BrowserGpuChannelHostFactory::GetIOThreadTaskRunner() { | 282 BrowserGpuChannelHostFactory::GetIOThreadTaskRunner() { |
| 283 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 283 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 284 } | 284 } |
| 285 | 285 |
| 286 scoped_ptr<base::SharedMemory> | 286 scoped_ptr<base::SharedMemory> |
| 287 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) { | 287 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) { |
| 288 scoped_ptr<base::SharedMemory> shm(new base::SharedMemory()); | 288 scoped_ptr<base::SharedMemory> shm(new base::SharedMemory()); |
| 289 if (!shm->CreateAnonymous(size)) | 289 if (!shm->CreateAnonymous(size)) |
| 290 return scoped_ptr<base::SharedMemory>(); | 290 return scoped_ptr<base::SharedMemory>(); |
| 291 return shm.Pass(); | 291 return shm; |
| 292 } | 292 } |
| 293 | 293 |
| 294 void BrowserGpuChannelHostFactory::CreateViewCommandBufferOnIO( | 294 void BrowserGpuChannelHostFactory::CreateViewCommandBufferOnIO( |
| 295 CreateRequest* request, | 295 CreateRequest* request, |
| 296 int32_t surface_id, | 296 int32_t surface_id, |
| 297 const GPUCreateCommandBufferConfig& init_params) { | 297 const GPUCreateCommandBufferConfig& init_params) { |
| 298 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); | 298 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); |
| 299 if (!host) { | 299 if (!host) { |
| 300 request->event.Signal(); | 300 request->event.Signal(); |
| 301 return; | 301 return; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 } | 437 } |
| 438 | 438 |
| 439 // static | 439 // static |
| 440 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( | 440 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( |
| 441 int gpu_client_id, | 441 int gpu_client_id, |
| 442 const base::FilePath& cache_dir) { | 442 const base::FilePath& cache_dir) { |
| 443 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir); | 443 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir); |
| 444 } | 444 } |
| 445 | 445 |
| 446 } // namespace content | 446 } // namespace content |
| OLD | NEW |