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

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

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « gpu/command_buffer_service.gypi ('k') | gpu/gpu.gyp » ('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 "gpu/config/gpu_info_collector.h" 5 #include "gpu/config/gpu_info_collector.h"
6 6
7 // This has to be included before windows.h. 7 // This has to be included before windows.h.
8 #include "third_party/re2/re2/re2.h" 8 #include "third_party/re2/re2/re2.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 658
659 void MergeGPUInfo(GPUInfo* basic_gpu_info, 659 void MergeGPUInfo(GPUInfo* basic_gpu_info,
660 const GPUInfo& context_gpu_info) { 660 const GPUInfo& context_gpu_info) {
661 DCHECK(basic_gpu_info); 661 DCHECK(basic_gpu_info);
662 662
663 if (context_gpu_info.software_rendering) { 663 if (context_gpu_info.software_rendering) {
664 basic_gpu_info->software_rendering = true; 664 basic_gpu_info->software_rendering = true;
665 return; 665 return;
666 } 666 }
667 667
668 // Track D3D Shader Model (if available)
669 const std::string& shader_version =
670 context_gpu_info.vertex_shader_version;
671
672 // Only gather if this is the first time we're seeing
673 // a non-empty shader version string.
674 if (!shader_version.empty() &&
675 basic_gpu_info->vertex_shader_version.empty()) {
676
677 // Note: do not reorder, used by UMA_HISTOGRAM below
678 enum ShaderModel {
679 SHADER_MODEL_UNKNOWN,
680 SHADER_MODEL_2_0,
681 SHADER_MODEL_3_0,
682 SHADER_MODEL_4_0,
683 SHADER_MODEL_4_1,
684 SHADER_MODEL_5_0,
685 NUM_SHADER_MODELS
686 };
687
688 ShaderModel shader_model = SHADER_MODEL_UNKNOWN;
689
690 if (shader_version == "5.0") {
691 shader_model = SHADER_MODEL_5_0;
692 } else if (shader_version == "4.1") {
693 shader_model = SHADER_MODEL_4_1;
694 } else if (shader_version == "4.0") {
695 shader_model = SHADER_MODEL_4_0;
696 } else if (shader_version == "3.0") {
697 shader_model = SHADER_MODEL_3_0;
698 } else if (shader_version == "2.0") {
699 shader_model = SHADER_MODEL_2_0;
700 }
701
702 UMA_HISTOGRAM_ENUMERATION("GPU.D3DShaderModel",
703 shader_model,
704 NUM_SHADER_MODELS);
705 }
706
668 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); 707 MergeGPUInfoGL(basic_gpu_info, context_gpu_info);
669 708
670 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; 709 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics;
671 } 710 }
672 711
673 } // namespace gpu 712 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer_service.gypi ('k') | gpu/gpu.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698