OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import test_expectations | 5 import test_expectations |
6 | 6 |
7 ANGLE_CONDITIONS = ['d3d9', 'd3d11', 'opengl'] | 7 ANGLE_CONDITIONS = ['d3d9', 'd3d11', 'opengl'] |
8 | 8 |
9 GPU_CONDITIONS = ['amd', 'arm', 'broadcom', 'hisilicon', 'intel', 'imagination', | 9 GPU_CONDITIONS = ['amd', 'arm', 'broadcom', 'hisilicon', 'intel', 'imagination', |
10 'nvidia', 'qualcomm', 'vivante'] | 10 'nvidia', 'qualcomm', 'vivante'] |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 angle_renderer in expectation.angle_conditions) | 94 angle_renderer in expectation.angle_conditions) |
95 | 95 |
96 return gpu_matches and angle_matches | 96 return gpu_matches and angle_matches |
97 | 97 |
98 def _GetGpuVendorString(self, gpu_info): | 98 def _GetGpuVendorString(self, gpu_info): |
99 if gpu_info: | 99 if gpu_info: |
100 primary_gpu = gpu_info.devices[0] | 100 primary_gpu = gpu_info.devices[0] |
101 if primary_gpu: | 101 if primary_gpu: |
102 vendor_string = primary_gpu.vendor_string.lower() | 102 vendor_string = primary_gpu.vendor_string.lower() |
103 vendor_id = primary_gpu.vendor_id | 103 vendor_id = primary_gpu.vendor_id |
104 if vendor_string: | 104 if vendor_id == 0x10DE: |
105 return vendor_string.split(' ')[0] | |
106 elif vendor_id == 0x10DE: | |
107 return 'nvidia' | 105 return 'nvidia' |
108 elif vendor_id == 0x1002: | 106 elif vendor_id == 0x1002: |
109 return 'amd' | 107 return 'amd' |
110 elif vendor_id == 0x8086: | 108 elif vendor_id == 0x8086: |
111 return 'intel' | 109 return 'intel' |
| 110 elif vendor_string: |
| 111 return vendor_string.split(' ')[0] |
112 return 'unknown_gpu' | 112 return 'unknown_gpu' |
113 | 113 |
114 def _GetGpuDeviceId(self, gpu_info): | 114 def _GetGpuDeviceId(self, gpu_info): |
115 if gpu_info: | 115 if gpu_info: |
116 primary_gpu = gpu_info.devices[0] | 116 primary_gpu = gpu_info.devices[0] |
117 if primary_gpu: | 117 if primary_gpu: |
118 return primary_gpu.device_id or primary_gpu.device_string | 118 return primary_gpu.device_id or primary_gpu.device_string |
119 return 0 | 119 return 0 |
120 | 120 |
121 def _GetANGLERenderer(self, gpu_info): | 121 def _GetANGLERenderer(self, gpu_info): |
122 if gpu_info and gpu_info.aux_attributes: | 122 if gpu_info and gpu_info.aux_attributes: |
123 gl_renderer = gpu_info.aux_attributes.get('gl_renderer') | 123 gl_renderer = gpu_info.aux_attributes.get('gl_renderer') |
124 if gl_renderer: | 124 if gl_renderer: |
125 if 'Direct3D11' in gl_renderer: | 125 if 'Direct3D11' in gl_renderer: |
126 return 'd3d11' | 126 return 'd3d11' |
127 elif 'Direct3D9' in gl_renderer: | 127 elif 'Direct3D9' in gl_renderer: |
128 return 'd3d9' | 128 return 'd3d9' |
129 elif 'OpenGL' in gl_renderer: | 129 elif 'OpenGL' in gl_renderer: |
130 return 'opengl' | 130 return 'opengl' |
131 return '' | 131 return '' |
OLD | NEW |