| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 void BrowserGpuChannelHostFactory::CloseChannel() { | 177 void BrowserGpuChannelHostFactory::CloseChannel() { |
| 178 DCHECK(instance_); | 178 DCHECK(instance_); |
| 179 if (instance_->gpu_channel_) { | 179 if (instance_->gpu_channel_) { |
| 180 instance_->gpu_channel_->DestroyChannel(); | 180 instance_->gpu_channel_->DestroyChannel(); |
| 181 instance_->gpu_channel_ = nullptr; | 181 instance_->gpu_channel_ = nullptr; |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 bool BrowserGpuChannelHostFactory::CanUseForTesting() { | |
| 186 return GpuDataManager::GetInstance()->GpuAccessAllowed(NULL); | |
| 187 } | |
| 188 | |
| 189 void BrowserGpuChannelHostFactory::Initialize(bool establish_gpu_channel) { | 185 void BrowserGpuChannelHostFactory::Initialize(bool establish_gpu_channel) { |
| 190 DCHECK(!instance_); | 186 DCHECK(!instance_); |
| 191 instance_ = new BrowserGpuChannelHostFactory(); | 187 instance_ = new BrowserGpuChannelHostFactory(); |
| 192 if (establish_gpu_channel) { | 188 if (establish_gpu_channel) { |
| 193 instance_->EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); | 189 instance_->EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); |
| 194 } | 190 } |
| 195 } | 191 } |
| 196 | 192 |
| 197 void BrowserGpuChannelHostFactory::Terminate() { | 193 void BrowserGpuChannelHostFactory::Terminate() { |
| 198 DCHECK(instance_); | 194 DCHECK(instance_); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 335 } |
| 340 | 336 |
| 341 // static | 337 // static |
| 342 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( | 338 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( |
| 343 int gpu_client_id, | 339 int gpu_client_id, |
| 344 const base::FilePath& cache_dir) { | 340 const base::FilePath& cache_dir) { |
| 345 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); | 341 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); |
| 346 } | 342 } |
| 347 | 343 |
| 348 } // namespace content | 344 } // namespace content |
| OLD | NEW |