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

Unified Diff: gpu/command_buffer/client/client_test_helper.cc

Issue 2550583002: gpu: Thread-safe command buffer state lookup. (Closed)
Patch Set: Created 4 years 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
Index: gpu/command_buffer/client/client_test_helper.cc
diff --git a/gpu/command_buffer/client/client_test_helper.cc b/gpu/command_buffer/client/client_test_helper.cc
index ff7e06944875acc9ca5e7c22f0d9d8377f80ab1a..3cff5994a309ac1fc0b29d155642cbd6f0a0a529 100644
--- a/gpu/command_buffer/client/client_test_helper.cc
+++ b/gpu/command_buffer/client/client_test_helper.cc
@@ -20,11 +20,9 @@ using ::testing::Invoke;
namespace gpu {
-MockCommandBufferBase::MockCommandBufferBase() : put_offset_(0) {
-}
+MockCommandBufferBase::MockCommandBufferBase() : put_offset_(0) {}
-MockCommandBufferBase::~MockCommandBufferBase() {
-}
+MockCommandBufferBase::~MockCommandBufferBase() {}
CommandBuffer::State MockCommandBufferBase::GetLastState() {
return state_;
@@ -38,12 +36,17 @@ void MockCommandBufferBase::SetGetOffset(int32_t get_offset) {
state_.get_offset = get_offset;
}
-void MockCommandBufferBase::WaitForTokenInRange(int32_t start, int32_t end) {}
+CommandBuffer::State MockCommandBufferBase::WaitForTokenInRange(int32_t start,
+ int32_t end) {
+ return state_;
+}
-void MockCommandBufferBase::WaitForGetOffsetInRange(int32_t start,
- int32_t end) {
+CommandBuffer::State MockCommandBufferBase::WaitForGetOffsetInRange(
+ int32_t start,
+ int32_t end) {
state_.get_offset = put_offset_;
OnFlush();
+ return state_;
}
void MockCommandBufferBase::SetGetBuffer(int transfer_buffer_id) {
@@ -125,8 +128,7 @@ MockClientCommandBuffer::MockClientCommandBuffer() {
DelegateToFake();
}
-MockClientCommandBuffer::~MockClientCommandBuffer() {
-}
+MockClientCommandBuffer::~MockClientCommandBuffer() {}
void MockClientCommandBuffer::Flush(int32_t put_offset) {
FlushHelper(put_offset);
@@ -138,30 +140,24 @@ void MockClientCommandBuffer::OrderingBarrier(int32_t put_offset) {
void MockClientCommandBuffer::DelegateToFake() {
ON_CALL(*this, DestroyTransferBuffer(_))
- .WillByDefault(Invoke(
- this, &MockCommandBufferBase::DestroyTransferBufferHelper));
+ .WillByDefault(
+ Invoke(this, &MockCommandBufferBase::DestroyTransferBufferHelper));
}
MockClientCommandBufferMockFlush::MockClientCommandBufferMockFlush() {
DelegateToFake();
}
-MockClientCommandBufferMockFlush::~MockClientCommandBufferMockFlush() {
-}
+MockClientCommandBufferMockFlush::~MockClientCommandBufferMockFlush() {}
void MockClientCommandBufferMockFlush::DelegateToFake() {
MockClientCommandBuffer::DelegateToFake();
ON_CALL(*this, Flush(_))
- .WillByDefault(Invoke(
- this, &MockCommandBufferBase::FlushHelper));
+ .WillByDefault(Invoke(this, &MockCommandBufferBase::FlushHelper));
}
-MockClientGpuControl::MockClientGpuControl() {
-}
+MockClientGpuControl::MockClientGpuControl() {}
-MockClientGpuControl::~MockClientGpuControl() {
-}
+MockClientGpuControl::~MockClientGpuControl() {}
} // namespace gpu
-
-

Powered by Google App Engine
This is Rietveld 408576698