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

Unified Diff: chrome/gpu/gpu_thread.cc

Issue 6364013: Defered collect DirectX diagnostics until they are needed for about:gpu.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/gpu/gpu_thread.h ('k') | chrome/test/gpu/gpu_pixel_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/gpu_thread.cc
===================================================================
--- chrome/gpu/gpu_thread.cc (revision 72672)
+++ chrome/gpu/gpu_thread.cc (working copy)
@@ -95,18 +95,6 @@
gpu_info_collector::CollectGraphicsInfo(&gpu_info_);
child_process_logging::SetGpuInfo(gpu_info_);
-#if defined(OS_WIN)
- // Asynchronously collect the DirectX diagnostics because this can take a
- // couple of seconds.
- if (!base::WorkerPool::PostTask(
- FROM_HERE,
- NewRunnableFunction(&GpuThread::CollectDxDiagnostics, this),
- true)) {
- // Flag GPU info as complete if the DirectX diagnostics cannot be collected.
- gpu_info_.SetProgress(GPUInfo::kComplete);
- }
-#endif
-
// Record initialization only after collecting the GPU info because that can
// take a significant amount of time.
gpu_info_.SetInitializationTime(base::Time::Now() - process_start_time_);
@@ -208,7 +196,26 @@
Send(new GpuHostMsg_SynchronizeReply());
}
-void GpuThread::OnCollectGraphicsInfo() {
+void GpuThread::OnCollectGraphicsInfo(GPUInfo::Level level) {
+#if defined(OS_WIN)
+ if (level == GPUInfo::kComplete && gpu_info_.level() <= GPUInfo::kPartial) {
+ // Prevent concurrent collection of DirectX diagnostics.
+ gpu_info_.SetLevel(GPUInfo::kCompleting);
+
+ // Asynchronously collect the DirectX diagnostics because this can take a
+ // couple of seconds.
+ if (!base::WorkerPool::PostTask(
+ FROM_HERE,
+ NewRunnableFunction(&GpuThread::CollectDxDiagnostics, this),
+ true)) {
+
+ // Flag GPU info as complete if the DirectX diagnostics cannot be
+ // collected.
+ gpu_info_.SetLevel(GPUInfo::kComplete);
+ }
+ }
+#endif
+
Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_));
}
@@ -262,7 +269,7 @@
// Runs on the GPU thread.
void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) {
thread->gpu_info_.SetDxDiagnostics(node);
- thread->gpu_info_.SetProgress(GPUInfo::kComplete);
+ thread->gpu_info_.SetLevel(GPUInfo::kComplete);
}
#endif
« no previous file with comments | « chrome/gpu/gpu_thread.h ('k') | chrome/test/gpu/gpu_pixel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698