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

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

Issue 558513003: command_buffer: Batch command processing to reduce handler overheads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 3 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 25598478bf8468986ddf05ef27a06daa1c5a6f07..143ec0b4d84d8d1f9d6b7d0b2073c769848cfd83 100644
--- a/gpu/command_buffer/service/mocks.cc
+++ b/gpu/command_buffer/service/mocks.cc
@@ -7,15 +7,31 @@
#include "gpu/command_buffer/service/gpu_scheduler.h"
#include "gpu/command_buffer/service/mocks.h"
+using testing::Invoke;
+using testing::_;
+
namespace gpu {
-AsyncAPIMock::AsyncAPIMock() {
+AsyncAPIMock::AsyncAPIMock(bool default_do_commands) {
testing::DefaultValue<error::Error>::Set(
error::kNoError);
+
+ if (default_do_commands) {
+ ON_CALL(*this, DoCommands(_, _, _, _))
+ .WillByDefault(Invoke(this, &AsyncAPIMock::FakeDoCommands));
+ }
}
AsyncAPIMock::~AsyncAPIMock() {}
+error::Error AsyncAPIMock::FakeDoCommands(unsigned int num_commands,
+ const void* buffer,
+ int num_entries,
+ int* entries_processed) {
+ return AsyncAPIInterface::DoCommands(
+ num_commands, buffer, num_entries, entries_processed);
+}
+
void AsyncAPIMock::SetToken(unsigned int command,
unsigned int arg_count,
const void* _args) {
« 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