diff options
author | jbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 19:45:06 +0000 |
---|---|---|
committer | jbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 19:45:06 +0000 |
commit | 198e0c44b137b9f55c304b961be133b6179b65c7 (patch) | |
tree | 4e43a44da4b3b393be13c4c2653c521e47cbc532 /content | |
parent | 0059eb96d9e2ed945a7f62c192f4b66120e51380 (diff) | |
download | chromium_src-198e0c44b137b9f55c304b961be133b6179b65c7.zip chromium_src-198e0c44b137b9f55c304b961be133b6179b65c7.tar.gz chromium_src-198e0c44b137b9f55c304b961be133b6179b65c7.tar.bz2 |
Improve GPU tests to fail when GPU drawing fails.
Changed the accelerated html pages to use raf to draw multiple frames. Changed the webgl and canvas2d pages to draw onscreen rather than offscreen to make sure the compositor draws the page.
BUG=105785,104142
Review URL: http://codereview.chromium.org/8692013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112763 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/gpu/gpu_process_host.cc | 6 | ||||
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.cc | 7 | ||||
-rw-r--r-- | content/gpu/gpu_child_thread.cc | 13 |
3 files changed, 17 insertions, 9 deletions
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index ae45cad..cdaac3e 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -481,6 +481,10 @@ void GpuProcessHost::OnDestroyCommandBuffer( } void GpuProcessHost::OnGraphicsInfoCollected(const content::GPUInfo& gpu_info) { + // OnGraphicsInfoCollected is sent back after the GPU process successfully + // initializes GL. + TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected"); + GpuDataManager::GetInstance()->UpdateGpuInfo(gpu_info); } @@ -493,8 +497,6 @@ void GpuProcessHost::OnProcessLaunched() { // respond to any requests to establish a GPU channel. The response // to such requests require that the GPU process handle be known. - TRACE_EVENT0("test_gpu", "GpuProcessLaunched"); - base::ProcessHandle child_handle = in_process_ ? base::GetCurrentProcessHandle() : handle(); diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index 195cf6e..af478e0 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -164,6 +164,8 @@ void GpuCommandBufferStub::OnInitialize( IPC::Message* reply_message) { DCHECK(!command_buffer_.get()); + UNSHIPPED_TRACE_EVENT_INSTANT0("test_gpu", "TryCreateGLContext"); + command_buffer_.reset(new gpu::CommandBufferService); #if defined(OS_WIN) @@ -179,6 +181,7 @@ void GpuCommandBufferStub::OnInitialize( #endif if (!command_buffer_->Initialize(&shared_memory, size)) { + DLOG(ERROR) << "CommandBufferService failed to initialize.\n"; OnInitializeFailed(reply_message); return; } @@ -194,6 +197,7 @@ void GpuCommandBufferStub::OnInitialize( if (handle_) { #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) if (software_) { + DLOG(ERROR) << "No software support.\n"; OnInitializeFailed(reply_message); return; } @@ -278,6 +282,9 @@ void GpuCommandBufferStub::OnInitialize( GpuCommandBufferMsg_Initialize::WriteReplyParams(reply_message, true); Send(reply_message); + + UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "CreateGLContextSuccess", + "offscreen", surface_->IsOffscreen()); } void GpuCommandBufferStub::OnSetParent(int32 parent_route_id, diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index 02c38af..0141961 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc @@ -103,12 +103,12 @@ void GpuChildThread::OnInitialize() { !CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) logging::SetLogMessageHandler(GpuProcessLogMessageHandler); + // Always set gpu info and send it back, even if there's an error and it's + // impartially collected. bool succeeded = gpu_info_collector::CollectGraphicsInfo(&gpu_info_); - - if (succeeded) { - content::GetContentClient()->SetGpuInfo(gpu_info_); - LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo complete"; - } + content::GetContentClient()->SetGpuInfo(gpu_info_); + LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo complete. success = " << + succeeded; // Record initialization only after collecting the GPU info because that can // take a significant amount of time. @@ -157,8 +157,7 @@ void GpuChildThread::OnInitialize() { // Ensure the browser process receives the GPU info before a reply to any // subsequent IPC it might send. - if (succeeded) - Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); + Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); } void GpuChildThread::StopWatchdog() { |