summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/mocks.h
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-03 23:19:30 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-03 23:19:30 +0000
commitd6ca9a3a0c76deb0723789d2844e028cf7fa419d (patch)
tree9373b7e4e04e7e1a79b24aad37d1570f1a1fa0f3 /gpu/command_buffer/service/mocks.h
parent0f25bfdf7a60ff20d3b3d7572065fe1250bd6bd0 (diff)
downloadchromium_src-d6ca9a3a0c76deb0723789d2844e028cf7fa419d.zip
chromium_src-d6ca9a3a0c76deb0723789d2844e028cf7fa419d.tar.gz
chromium_src-d6ca9a3a0c76deb0723789d2844e028cf7fa419d.tar.bz2
GpuScheduler fix:
- Ganesh generates a lot of cheap GL commands, so 100 commands were executing in 50us, causing us to spin on PostTask(ProcessCommands) 60+ times per frame. This change simply tracks the elapsed time after each 100 commands - if the time is less than 2ms, it continues on to the next 100 commands. BUG=83628 TEST=trace FishIE demo with 500 fish, check that ProcessCommands is not called ~60 times per frame. Review URL: http://codereview.chromium.org/6993032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/mocks.h')
-rw-r--r--gpu/command_buffer/service/mocks.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h
index 0d341bd..f526c01 100644
--- a/gpu/command_buffer/service/mocks.h
+++ b/gpu/command_buffer/service/mocks.h
@@ -69,6 +69,20 @@ class AsyncAPIMock : public AsyncAPIInterface {
CommandBufferEngine *engine_;
};
+// Allows specialized behavior per command in DoCommand.
+class SpecializedDoCommandAsyncAPIMock : public AsyncAPIMock {
+ public:
+ // Cause DoCommand to sleep more than the GpuScheduler time quantum.
+ static const unsigned int kTestQuantumCommand = 333;
+
+ SpecializedDoCommandAsyncAPIMock();
+ virtual ~SpecializedDoCommandAsyncAPIMock();
+
+ virtual error::Error DoCommand(unsigned int command,
+ unsigned int arg_count,
+ const void* cmd_data);
+};
+
namespace gles2 {
class MockShaderTranslator : public ShaderTranslatorInterface {