| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Tests for GLES2Implementation. | 5 // Tests for GLES2Implementation. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/client_test_helper.h" | 7 #include "gpu/command_buffer/client/client_test_helper.h" |
| 8 | 8 |
| 9 #include "gpu/command_buffer/common/command_buffer.h" | 9 #include "gpu/command_buffer/common/command_buffer.h" |
| 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 id -= kTransferBufferBaseId; | 82 id -= kTransferBufferBaseId; |
| 83 transfer_buffer_buffers_[id] = NULL; | 83 transfer_buffer_buffers_[id] = NULL; |
| 84 } | 84 } |
| 85 | 85 |
| 86 scoped_refptr<Buffer> MockCommandBufferBase::GetTransferBuffer(int32 id) { | 86 scoped_refptr<Buffer> MockCommandBufferBase::GetTransferBuffer(int32 id) { |
| 87 DCHECK_GE(id, kTransferBufferBaseId); | 87 DCHECK_GE(id, kTransferBufferBaseId); |
| 88 DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers); | 88 DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers); |
| 89 return transfer_buffer_buffers_[id - kTransferBufferBaseId]; | 89 return transfer_buffer_buffers_[id - kTransferBufferBaseId]; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void MockCommandBufferBase::FlushHelper(int32 put_offset) { | 92 void MockCommandBufferBase::FlushHelper( |
| 93 int32 put_offset, |
| 94 const std::vector<uint32>& sync_points) { |
| 93 put_offset_ = put_offset; | 95 put_offset_ = put_offset; |
| 94 } | 96 } |
| 95 | 97 |
| 96 void MockCommandBufferBase::SetToken(int32 token) { | 98 void MockCommandBufferBase::SetToken(int32 token) { |
| 97 NOTREACHED(); | 99 NOTREACHED(); |
| 98 state_.token = token; | 100 state_.token = token; |
| 99 } | 101 } |
| 100 | 102 |
| 101 void MockCommandBufferBase::SetParseError(error::Error error) { | 103 void MockCommandBufferBase::SetParseError(error::Error error) { |
| 102 NOTREACHED(); | 104 NOTREACHED(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 119 const int32 MockCommandBufferBase::kMaxTransferBuffers; | 121 const int32 MockCommandBufferBase::kMaxTransferBuffers; |
| 120 #endif | 122 #endif |
| 121 | 123 |
| 122 MockClientCommandBuffer::MockClientCommandBuffer() { | 124 MockClientCommandBuffer::MockClientCommandBuffer() { |
| 123 DelegateToFake(); | 125 DelegateToFake(); |
| 124 } | 126 } |
| 125 | 127 |
| 126 MockClientCommandBuffer::~MockClientCommandBuffer() { | 128 MockClientCommandBuffer::~MockClientCommandBuffer() { |
| 127 } | 129 } |
| 128 | 130 |
| 129 void MockClientCommandBuffer::Flush(int32 put_offset) { | 131 void MockClientCommandBuffer::Flush(int32 put_offset, |
| 130 FlushHelper(put_offset); | 132 const std::vector<uint32>& sync_points) { |
| 133 FlushHelper(put_offset, sync_points); |
| 131 } | 134 } |
| 132 | 135 |
| 133 void MockClientCommandBuffer::DelegateToFake() { | 136 void MockClientCommandBuffer::DelegateToFake() { |
| 134 ON_CALL(*this, DestroyTransferBuffer(_)) | 137 ON_CALL(*this, DestroyTransferBuffer(_)) |
| 135 .WillByDefault(Invoke( | 138 .WillByDefault(Invoke( |
| 136 this, &MockCommandBufferBase::DestroyTransferBufferHelper)); | 139 this, &MockCommandBufferBase::DestroyTransferBufferHelper)); |
| 137 } | 140 } |
| 138 | 141 |
| 139 MockClientCommandBufferMockFlush::MockClientCommandBufferMockFlush() { | 142 MockClientCommandBufferMockFlush::MockClientCommandBufferMockFlush() { |
| 140 DelegateToFake(); | 143 DelegateToFake(); |
| 141 } | 144 } |
| 142 | 145 |
| 143 MockClientCommandBufferMockFlush::~MockClientCommandBufferMockFlush() { | 146 MockClientCommandBufferMockFlush::~MockClientCommandBufferMockFlush() { |
| 144 } | 147 } |
| 145 | 148 |
| 146 void MockClientCommandBufferMockFlush::DelegateToFake() { | 149 void MockClientCommandBufferMockFlush::DelegateToFake() { |
| 147 MockClientCommandBuffer::DelegateToFake(); | 150 MockClientCommandBuffer::DelegateToFake(); |
| 148 ON_CALL(*this, Flush(_)) | 151 ON_CALL(*this, Flush(_, _)) |
| 149 .WillByDefault(Invoke( | 152 .WillByDefault(Invoke(this, &MockCommandBufferBase::FlushHelper)); |
| 150 this, &MockCommandBufferBase::FlushHelper)); | |
| 151 } | 153 } |
| 152 | 154 |
| 153 MockClientGpuControl::MockClientGpuControl() { | 155 MockClientGpuControl::MockClientGpuControl() { |
| 154 } | 156 } |
| 155 | 157 |
| 156 MockClientGpuControl::~MockClientGpuControl() { | 158 MockClientGpuControl::~MockClientGpuControl() { |
| 157 } | 159 } |
| 158 | 160 |
| 159 } // namespace gpu | 161 } // namespace gpu |
| 160 | 162 |
| 161 | 163 |
| OLD | NEW |