Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 // If flags hasn't been set and GPUInfo is available, run through blacklist | 74 // If flags hasn't been set and GPUInfo is available, run through blacklist |
| 75 // and compute the flags. | 75 // and compute the flags. |
| 76 void UpdateGpuFeatureType(content::GpuFeatureType embedder_feature_type); | 76 void UpdateGpuFeatureType(content::GpuFeatureType embedder_feature_type); |
| 77 | 77 |
| 78 // Notify all observers whenever there is a GPU info update. | 78 // Notify all observers whenever there is a GPU info update. |
| 79 void NotifyGpuInfoUpdate(); | 79 void NotifyGpuInfoUpdate(); |
| 80 | 80 |
| 81 // If use-gl switch is osmesa or any, return true. | 81 // If use-gl switch is osmesa or any, return true. |
| 82 bool UseGLIsOSMesaOrAny(); | 82 bool UseGLIsOSMesaOrAny(); |
| 83 | 83 |
| 84 // Merges the second GPUInfo object with the first. | |
| 85 // If it's the same GPU, i.e., device id and vendor id are the same, then | |
| 86 // copy over the fields that are not set yet and ignore the rest. | |
| 87 // If it's a different GPU, then reset and copy over everything. | |
| 88 // Return true if something changes that may affect blacklisting; currently | |
| 89 // they are device_id, vendor_id, driver_vendor, driver_version, driver_date, | |
| 90 // and gl_renderer. | |
| 91 static bool Merge(content::GPUInfo* object, const content::GPUInfo& other); | |
|
Ken Russell (switch to Gerrit)
2012/05/10 01:11:09
Was removing this method intentional? If the GPU p
Zhenyao Mo
2012/05/10 21:55:32
The removal of this Merge function is on purpose.
| |
| 92 | |
| 93 // Try to switch to software rendering, if possible and necessary. | 84 // Try to switch to software rendering, if possible and necessary. |
| 94 void EnableSoftwareRenderingIfNecessary(); | 85 void EnableSoftwareRenderingIfNecessary(); |
| 95 | 86 |
| 96 bool complete_gpu_info_already_requested_; | 87 bool complete_gpu_info_already_requested_; |
| 97 bool complete_gpu_info_available_; | 88 bool complete_gpu_info_available_; |
| 98 | 89 |
| 99 content::GpuFeatureType gpu_feature_type_; | 90 content::GpuFeatureType gpu_feature_type_; |
| 100 content::GpuFeatureType preliminary_gpu_feature_type_; | 91 content::GpuFeatureType preliminary_gpu_feature_type_; |
| 101 | 92 |
| 102 content::GPUInfo gpu_info_; | 93 content::GPUInfo gpu_info_; |
| 103 mutable base::Lock gpu_info_lock_; | 94 mutable base::Lock gpu_info_lock_; |
| 104 | 95 |
| 105 // Observers. | 96 // Observers. |
| 106 const scoped_refptr<GpuDataManagerObserverList> observer_list_; | 97 const scoped_refptr<GpuDataManagerObserverList> observer_list_; |
| 107 | 98 |
| 108 ListValue log_messages_; | 99 ListValue log_messages_; |
| 109 bool software_rendering_; | 100 bool software_rendering_; |
| 110 | 101 |
| 111 FilePath swiftshader_path_; | 102 FilePath swiftshader_path_; |
| 112 | 103 |
| 113 // Current card force-blacklisted due to GPU crashes. | 104 // Current card force-blacklisted due to GPU crashes. |
| 114 bool card_blacklisted_; | 105 bool card_blacklisted_; |
| 115 | 106 |
| 116 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 107 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
| 117 }; | 108 }; |
| 118 | 109 |
| 119 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 110 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| OLD | NEW |