| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 return nullptr; | 305 return nullptr; |
| 306 #endif | 306 #endif |
| 307 EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); | 307 EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); |
| 308 | 308 |
| 309 if (pending_request_.get()) | 309 if (pending_request_.get()) |
| 310 pending_request_->Wait(); | 310 pending_request_->Wait(); |
| 311 | 311 |
| 312 return gpu_channel_; | 312 return gpu_channel_; |
| 313 } | 313 } |
| 314 | 314 |
| 315 gpu::GpuMemoryBufferManager* |
| 316 BrowserGpuChannelHostFactory::GetGpuMemoryBufferManager() { |
| 317 return gpu_memory_buffer_manager_.get(); |
| 318 } |
| 319 |
| 315 gpu::GpuChannelHost* BrowserGpuChannelHostFactory::GetGpuChannel() { | 320 gpu::GpuChannelHost* BrowserGpuChannelHostFactory::GetGpuChannel() { |
| 316 if (gpu_channel_.get() && !gpu_channel_->IsLost()) | 321 if (gpu_channel_.get() && !gpu_channel_->IsLost()) |
| 317 return gpu_channel_.get(); | 322 return gpu_channel_.get(); |
| 318 | 323 |
| 319 return NULL; | 324 return NULL; |
| 320 } | 325 } |
| 321 | 326 |
| 322 void BrowserGpuChannelHostFactory::GpuChannelEstablished() { | 327 void BrowserGpuChannelHostFactory::GpuChannelEstablished() { |
| 323 DCHECK(IsMainThread()); | 328 DCHECK(IsMainThread()); |
| 324 DCHECK(pending_request_.get()); | 329 DCHECK(pending_request_.get()); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 368 } |
| 364 | 369 |
| 365 // static | 370 // static |
| 366 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( | 371 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( |
| 367 int gpu_client_id, | 372 int gpu_client_id, |
| 368 const base::FilePath& cache_dir) { | 373 const base::FilePath& cache_dir) { |
| 369 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir); | 374 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir); |
| 370 } | 375 } |
| 371 | 376 |
| 372 } // namespace content | 377 } // namespace content |
| OLD | NEW |