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

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 2781993002: Get the proper GPU Info in GpuProcessHost (Closed)
Patch Set: Added tests Created 3 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
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/browser/gpu/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 RecordProcessCrash(); 843 RecordProcessCrash();
844 GpuDataManagerImpl::GetInstance()->ProcessCrashed( 844 GpuDataManagerImpl::GetInstance()->ProcessCrashed(
845 process_->GetTerminationStatus(true /* known_dead */, NULL)); 845 process_->GetTerminationStatus(true /* known_dead */, NULL));
846 } 846 }
847 847
848 void GpuProcessHost::DidInitialize( 848 void GpuProcessHost::DidInitialize(
849 const gpu::GPUInfo& gpu_info, 849 const gpu::GPUInfo& gpu_info,
850 const gpu::GpuFeatureInfo& gpu_feature_info) { 850 const gpu::GpuFeatureInfo& gpu_feature_info) {
851 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", true); 851 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", true);
852 initialized_ = true; 852 initialized_ = true;
853 gpu_info_ = gpu_info; 853 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
854 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); 854 if (!gpu_data_manager->ShouldUseSwiftShader()) {
855 GpuDataManagerImpl::GetInstance()->UpdateGpuFeatureInfo(gpu_feature_info); 855 gpu_info_ = gpu_info;
856 gpu_data_manager->UpdateGpuInfo(gpu_info);
857 gpu_data_manager->UpdateGpuFeatureInfo(gpu_feature_info);
858 } else {
859 gpu_info_ = gpu_data_manager->GetGPUInfo();
860 }
856 } 861 }
857 862
858 void GpuProcessHost::DidFailInitialize() { 863 void GpuProcessHost::DidFailInitialize() {
859 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false); 864 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false);
860 initialized_ = false; 865 initialized_ = false;
861 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); 866 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure();
862 } 867 }
863 868
864 void GpuProcessHost::DidCreateOffscreenContext(const GURL& url) { 869 void GpuProcessHost::DidCreateOffscreenContext(const GURL& url) {
865 urls_with_live_offscreen_contexts_.insert(url); 870 urls_with_live_offscreen_contexts_.insert(url);
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 GetShaderCacheFactorySingleton()->Get(client_id); 1212 GetShaderCacheFactorySingleton()->Get(client_id);
1208 if (!cache.get()) 1213 if (!cache.get())
1209 return; 1214 return;
1210 1215
1211 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); 1216 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_));
1212 1217
1213 client_id_to_shader_cache_[client_id] = cache; 1218 client_id_to_shader_cache_[client_id] = cache;
1214 } 1219 }
1215 1220
1216 } // namespace content 1221 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698