OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gpu_data_manager.h" | 5 #include "content/browser/gpu/gpu_data_manager.h" |
6 | 6 |
7 #if defined(OS_MACOSX) | 7 #if defined(OS_MACOSX) |
8 #include <CoreGraphics/CGDisplayConfiguration.h> | 8 #include <CoreGraphics/CGDisplayConfiguration.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 : complete_gpu_info_already_requested_(false), | 198 : complete_gpu_info_already_requested_(false), |
199 observer_list_(new GpuDataManagerObserverList), | 199 observer_list_(new GpuDataManagerObserverList), |
200 software_rendering_(false) { | 200 software_rendering_(false) { |
201 Initialize(); | 201 Initialize(); |
202 } | 202 } |
203 | 203 |
204 void GpuDataManager::Initialize() { | 204 void GpuDataManager::Initialize() { |
205 // User flags need to be collected before any further initialization. | 205 // User flags need to be collected before any further initialization. |
206 user_flags_.Initialize(); | 206 user_flags_.Initialize(); |
207 | 207 |
208 // Certain tests doesn't go through the browser startup path that | 208 if (!user_flags_.skip_gpu_data_loading()) { |
209 // initializes GpuDataManager on FILE thread; therefore, it is initialized | |
210 // on UI thread later, and we skip the preliminary gpu info collection | |
211 // in such situation. | |
212 if (!user_flags_.skip_gpu_data_loading() && | |
213 BrowserThread::CurrentlyOn(BrowserThread::FILE)) { | |
214 content::GPUInfo gpu_info; | 209 content::GPUInfo gpu_info; |
215 gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info); | 210 gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info); |
216 UpdateGpuInfo(gpu_info); | 211 UpdateGpuInfo(gpu_info); |
217 } | 212 } |
218 | 213 |
219 #if defined(OS_MACOSX) | 214 #if defined(OS_MACOSX) |
220 CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, this); | 215 CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, this); |
221 #endif | 216 #endif |
222 } | 217 } |
223 | 218 |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 790 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
796 if (gpu_info_.can_lose_context) | 791 if (gpu_info_.can_lose_context) |
797 return false; | 792 return false; |
798 #if defined(USE_SKIA) | 793 #if defined(USE_SKIA) |
799 return true; | 794 return true; |
800 #else | 795 #else |
801 return false; | 796 return false; |
802 #endif | 797 #endif |
803 } | 798 } |
804 | 799 |
OLD | NEW |