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

Unified Diff: gpu/command_buffer/service/mocks.cc

Issue 7058035: WebGraphicsContext3DCommandBufferImpl cleanup, Canvas2D thottling fix, GpuScheduler fix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 9 years, 7 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 | « gpu/command_buffer/service/mocks.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/mocks.cc
diff --git a/gpu/command_buffer/service/mocks.cc b/gpu/command_buffer/service/mocks.cc
index 40b3d6d924fd06e78b4753640724ebdc244e5997..14906c5d44d726fb9d854250e977174d85030821 100644
--- a/gpu/command_buffer/service/mocks.cc
+++ b/gpu/command_buffer/service/mocks.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/threading/thread.h"
+#include "base/time.h"
+#include "gpu/command_buffer/service/gpu_scheduler.h"
#include "gpu/command_buffer/service/mocks.h"
namespace gpu {
@@ -24,6 +27,24 @@ void AsyncAPIMock::SetToken(unsigned int command,
engine_->set_token(args->token);
}
+SpecializedAsyncAPIMock::SpecializedAsyncAPIMock() {}
+
+SpecializedAsyncAPIMock::~SpecializedAsyncAPIMock() {}
+
+error::Error SpecializedAsyncAPIMock::DoCommand(unsigned int command,
+ unsigned int arg_count,
+ const void* cmd_data) {
+ if (command == kTestQuantumCommand) {
+ // Surpass the GpuScheduler scheduling quantum.
+ base::TimeTicks start_time = base::TimeTicks::Now();
+ while ((base::TimeTicks::Now() - start_time).InMicroseconds() <
+ GpuScheduler::kMinimumSchedulerQuantumMicros) {
+ base::PlatformThread::Sleep(1);
+ }
+ }
+ return AsyncAPIMock::DoCommand(command, arg_count, cmd_data);
+}
+
namespace gles2 {
MockShaderTranslator::MockShaderTranslator() {}
« no previous file with comments | « gpu/command_buffer/service/mocks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698