| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 8 | 8 |
| 9 namespace gpu { | 9 namespace gpu { |
| 10 namespace gles2 { | 10 namespace gles2 { |
| 11 | 11 |
| 12 MockGLES2Decoder::MockGLES2Decoder() | 12 MockGLES2Decoder::MockGLES2Decoder() : GLES2Decoder(), weak_ptr_factory_(this) { |
| 13 : GLES2Decoder() { | |
| 14 ON_CALL(*this, GetCommandName(testing::_)) | 13 ON_CALL(*this, GetCommandName(testing::_)) |
| 15 .WillByDefault(testing::Return("")); | 14 .WillByDefault(testing::Return("")); |
| 16 ON_CALL(*this, MakeCurrent()) | 15 ON_CALL(*this, MakeCurrent()) |
| 17 .WillByDefault(testing::Return(true)); | 16 .WillByDefault(testing::Return(true)); |
| 18 } | 17 } |
| 19 | 18 |
| 20 MockGLES2Decoder::~MockGLES2Decoder() {} | 19 MockGLES2Decoder::~MockGLES2Decoder() {} |
| 21 | 20 |
| 22 error::Error MockGLES2Decoder::FakeDoCommands(unsigned int num_commands, | 21 error::Error MockGLES2Decoder::FakeDoCommands(unsigned int num_commands, |
| 23 const volatile void* buffer, | 22 const volatile void* buffer, |
| 24 int num_entries, | 23 int num_entries, |
| 25 int* entries_processed) { | 24 int* entries_processed) { |
| 26 return AsyncAPIInterface::DoCommands( | 25 return AsyncAPIInterface::DoCommands( |
| 27 num_commands, buffer, num_entries, entries_processed); | 26 num_commands, buffer, num_entries, entries_processed); |
| 28 } | 27 } |
| 29 | 28 |
| 29 base::WeakPtr<GLES2Decoder> MockGLES2Decoder::AsWeakPtr() { |
| 30 return weak_ptr_factory_.GetWeakPtr(); |
| 31 } |
| 32 |
| 30 } // namespace gles2 | 33 } // namespace gles2 |
| 31 } // namespace gpu | 34 } // namespace gpu |
| OLD | NEW |