diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 03:49:02 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 03:49:02 +0000 |
commit | 808f7fe7f54d770c411409d55a486437da664119 (patch) | |
tree | c31c85d40ae9ac7597902c32c6ec1d8be81c56c5 /gpu/command_buffer | |
parent | d8528c1042cb74073bea1a8adc0721be4c7eb64d (diff) | |
download | chromium_src-808f7fe7f54d770c411409d55a486437da664119.zip chromium_src-808f7fe7f54d770c411409d55a486437da664119.tar.gz chromium_src-808f7fe7f54d770c411409d55a486437da664119.tar.bz2 |
Check the GPU watchdog after processing every 3D command.
Reduce the chance that a long stream of expensive 3D commands will cause the watchdog to go off by checking the watchdog after every 3D command.
BUG=76603
TEST=none
Review URL: http://codereview.chromium.org/6715006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r-- | gpu/command_buffer/service/gpu_processor.cc | 10 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_processor.h | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/gpu_processor.cc b/gpu/command_buffer/service/gpu_processor.cc index c7d19d3..e94c870 100644 --- a/gpu/command_buffer/service/gpu_processor.cc +++ b/gpu/command_buffer/service/gpu_processor.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -191,6 +191,9 @@ void GPUProcessor::ProcessCommands() { return; } ++commands_processed; + if (command_processed_callback_.get()) { + command_processed_callback_->Run(); + } } command_buffer_->SetGetOffset(static_cast<int32>(parser_->get())); @@ -242,4 +245,9 @@ void GPUProcessor::SetSwapBuffersCallback( &GPUProcessor::WillSwapBuffers)); } +void GPUProcessor::SetCommandProcessedCallback( + Callback0::Type* callback) { + command_processed_callback_.reset(callback); +} + } // namespace gpu diff --git a/gpu/command_buffer/service/gpu_processor.h b/gpu/command_buffer/service/gpu_processor.h index 6816d16..1682ad8 100644 --- a/gpu/command_buffer/service/gpu_processor.h +++ b/gpu/command_buffer/service/gpu_processor.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -112,6 +112,8 @@ class GPUProcessor : public CommandBufferEngine { // It is not defined on which thread this callback is called. virtual void SetSwapBuffersCallback(Callback0::Type* callback); + virtual void SetCommandProcessedCallback(Callback0::Type* callback); + // Get the GLES2Decoder associated with this processor. gles2::GLES2Decoder* decoder() const { return decoder_.get(); } @@ -153,6 +155,7 @@ class GPUProcessor : public CommandBufferEngine { ScopedRunnableMethodFactory<GPUProcessor> method_factory_; scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; + scoped_ptr<Callback0::Type> command_processed_callback_; }; } // namespace gpu |