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

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

Issue 3104011: Add Mac GPU logging code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome/gpu/gpu_info_collector_mac.mm ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/gpu/gpu_info_collector.h" 5 #include "chrome/gpu/gpu_info_collector.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <d3d9.h> 8 #include <d3d9.h>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 driver_major_version_lo, 63 driver_major_version_lo,
64 driver_minor_version_hi, 64 driver_minor_version_hi,
65 driver_minor_version_lo); 65 driver_minor_version_lo);
66 d3d->Release(); 66 d3d->Release();
67 67
68 // Get shader versions 68 // Get shader versions
69 uint32 pixel_shader_version = d3d_caps.PixelShaderVersion; 69 uint32 pixel_shader_version = d3d_caps.PixelShaderVersion;
70 uint32 vertex_shader_version = d3d_caps.VertexShaderVersion; 70 uint32 vertex_shader_version = d3d_caps.VertexShaderVersion;
71 71
72 gpu_info.SetGraphicsInfo(vendor_id, device_id, driver_version, 72 gpu_info.SetGraphicsInfo(vendor_id, device_id, driver_version,
73 pixel_shader_version, vertex_shader_version); 73 pixel_shader_version, vertex_shader_version, 0);
74 return true; 74 return true;
75 } 75 }
76 76
77 bool CollectGraphicsInfoGL(GPUInfo& gpu_info) { 77 bool CollectGraphicsInfoGL(GPUInfo& gpu_info) {
78 // Taken from http://developer.nvidia.com/object/device_ids.html 78 // Taken from http://developer.nvidia.com/object/device_ids.html
79 DISPLAY_DEVICE dd; 79 DISPLAY_DEVICE dd;
80 dd.cb = sizeof(DISPLAY_DEVICE); 80 dd.cb = sizeof(DISPLAY_DEVICE);
81 int i = 0; 81 int i = 0;
82 std::wstring id; 82 std::wstring id;
83 for (int i = 0; EnumDisplayDevices(NULL, i, &dd, 0); ++i) { 83 for (int i = 0; EnumDisplayDevices(NULL, i, &dd, 0); ++i) {
84 if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) { 84 if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
85 id = dd.DeviceID; 85 id = dd.DeviceID;
86 break; 86 break;
87 } 87 }
88 } 88 }
89 if (id.empty()) { 89 if (id.empty()) {
90 return false; 90 return false;
91 } 91 }
92 uint32 vendor_id; 92 uint32 vendor_id;
93 uint32 device_id; 93 uint32 device_id;
94 std::wstring vendorid = id.substr(8, 4); 94 std::wstring vendorid = id.substr(8, 4);
95 std::wstring deviceid = id.substr(17, 4); 95 std::wstring deviceid = id.substr(17, 4);
96 swscanf_s(vendorid.c_str(), L"%x", &vendor_id); 96 swscanf_s(vendorid.c_str(), L"%x", &vendor_id);
97 swscanf_s(deviceid.c_str(), L"%x", &device_id); 97 swscanf_s(deviceid.c_str(), L"%x", &device_id);
98 98
99 std::wstring driver_version = L""; 99 std::wstring driver_version = L"";
100 uint32 pixel_shader_version = 0; 100 uint32 pixel_shader_version = 0;
101 uint32 vertex_shader_version = 0; 101 uint32 vertex_shader_version = 0;
102 gpu_info.SetGraphicsInfo(vendor_id, device_id, driver_version, 102 gpu_info.SetGraphicsInfo(vendor_id, device_id, driver_version,
103 pixel_shader_version, vertex_shader_version); 103 pixel_shader_version, vertex_shader_version, 0);
104 return true; 104 return true;
105 105
106 // TODO(rlp): Add driver and pixel versions 106 // TODO(rlp): Add driver and pixel versions
107 } 107 }
108 108
109 } // namespace gpu_info_collector 109 } // namespace gpu_info_collector
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_info_collector_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698