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

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

Issue 2781993002: Get the proper GPU Info in GpuProcessHost (Closed)
Patch Set: 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 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 RecordProcessCrash(); 883 RecordProcessCrash();
884 GpuDataManagerImpl::GetInstance()->ProcessCrashed( 884 GpuDataManagerImpl::GetInstance()->ProcessCrashed(
885 process_->GetTerminationStatus(true /* known_dead */, NULL)); 885 process_->GetTerminationStatus(true /* known_dead */, NULL));
886 } 886 }
887 887
888 void GpuProcessHost::DidInitialize( 888 void GpuProcessHost::DidInitialize(
889 const gpu::GPUInfo& gpu_info, 889 const gpu::GPUInfo& gpu_info,
890 const gpu::GpuFeatureInfo& gpu_feature_info) { 890 const gpu::GpuFeatureInfo& gpu_feature_info) {
891 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", true); 891 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", true);
892 initialized_ = true; 892 initialized_ = true;
893 gpu_info_ = gpu_info; 893 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
894 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); 894 if (!gpu_data_manager->ShouldUseSwiftShader()) {
895 GpuDataManagerImpl::GetInstance()->UpdateGpuFeatureInfo(gpu_feature_info); 895 gpu_info_ = gpu_info;
896 gpu_data_manager->UpdateGpuInfo(gpu_info);
897 gpu_data_manager->UpdateGpuFeatureInfo(gpu_feature_info);
898 } else {
899 // Once SwiftShader is set, GpuInfo can no longer be modified
900 gpu_info_ = gpu_data_manager->GetGPUInfo();
901 }
896 } 902 }
897 903
898 void GpuProcessHost::DidFailInitialize() { 904 void GpuProcessHost::DidFailInitialize() {
899 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false); 905 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false);
900 initialized_ = false; 906 initialized_ = false;
901 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); 907 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure();
902 } 908 }
903 909
904 void GpuProcessHost::DidCreateOffscreenContext(const GURL& url) { 910 void GpuProcessHost::DidCreateOffscreenContext(const GURL& url) {
905 urls_with_live_offscreen_contexts_.insert(url); 911 urls_with_live_offscreen_contexts_.insert(url);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 GetShaderCacheFactorySingleton()->Get(client_id); 1254 GetShaderCacheFactorySingleton()->Get(client_id);
1249 if (!cache.get()) 1255 if (!cache.get())
1250 return; 1256 return;
1251 1257
1252 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); 1258 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_));
1253 1259
1254 client_id_to_shader_cache_[client_id] = cache; 1260 client_id_to_shader_cache_[client_id] = cache;
1255 } 1261 }
1256 1262
1257 } // namespace content 1263 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698