Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Side by Side Diff: content/gpu/gpu_info_collector_win.cc

Issue 10066004: Revert 131376 - Revert 130496 - Disable image transport surface on AMD GPUs (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/gpu/gpu_data_manager.cc ('k') | content/public/common/gpu_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/gpu/gpu_info_collector.h" 5 #include "content/gpu/gpu_info_collector.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <d3d9.h> 8 #include <d3d9.h>
9 #include <setupapi.h> 9 #include <setupapi.h>
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 driver_version = WideToASCII(std::wstring(value)); 248 driver_version = WideToASCII(std::wstring(value));
249 249
250 std::string driver_date; 250 std::string driver_date;
251 dwcb_data = sizeof(value); 251 dwcb_data = sizeof(value);
252 result = RegQueryValueExW( 252 result = RegQueryValueExW(
253 key, L"DriverDate", NULL, NULL, 253 key, L"DriverDate", NULL, NULL,
254 reinterpret_cast<LPBYTE>(value), &dwcb_data); 254 reinterpret_cast<LPBYTE>(value), &dwcb_data);
255 if (result == ERROR_SUCCESS) 255 if (result == ERROR_SUCCESS)
256 driver_date = WideToASCII(std::wstring(value)); 256 driver_date = WideToASCII(std::wstring(value));
257 257
258 std::string driver_vendor;
259 dwcb_data = sizeof(value);
260 result = RegQueryValueExW(
261 key, L"ProviderName", NULL, NULL,
262 reinterpret_cast<LPBYTE>(value), &dwcb_data);
263 if (result == ERROR_SUCCESS) {
264 driver_vendor = WideToASCII(std::wstring(value));
265 // If it's an Intel GPU with a driver provided by AMD then it's
266 // probably AMD's Dynamic Switchable Graphics.
267 // TODO: detect only AMD switchable
268 gpu_info->amd_switchable =
269 driver_vendor == "Advanced Micro Devices, Inc." ||
270 driver_vendor == "ATI Technologies Inc.";
271 }
272
273 gpu_info->driver_vendor = driver_vendor;
258 gpu_info->driver_version = driver_version; 274 gpu_info->driver_version = driver_version;
259 gpu_info->driver_date = driver_date; 275 gpu_info->driver_date = driver_date;
260 found = true; 276 found = true;
261 RegCloseKey(key); 277 RegCloseKey(key);
262 break; 278 break;
263 } 279 }
264 } 280 }
265 } 281 }
266 fp_destroy_device_info_list(device_info); 282 fp_destroy_device_info_list(device_info);
267 FreeLibrary(lib_setupapi); 283 FreeLibrary(lib_setupapi);
(...skipping 10 matching lines...) Expand all
278 294
279 size_t pos = gl_version_string.find_last_not_of("0123456789."); 295 size_t pos = gl_version_string.find_last_not_of("0123456789.");
280 if (pos != std::string::npos && pos < gl_version_string.length() - 1) { 296 if (pos != std::string::npos && pos < gl_version_string.length() - 1) {
281 gpu_info->driver_version = gl_version_string.substr(pos + 1); 297 gpu_info->driver_version = gl_version_string.substr(pos + 1);
282 return true; 298 return true;
283 } 299 }
284 return false; 300 return false;
285 } 301 }
286 302
287 } // namespace gpu_info_collector 303 } // namespace gpu_info_collector
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager.cc ('k') | content/public/common/gpu_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698