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 // This file contains the mock GLES2Decoder class. | 5 // This file contains the mock GLES2Decoder class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 26 matching lines...) Expand all Loading... |
37 class MockGLES2Decoder : public GLES2Decoder { | 37 class MockGLES2Decoder : public GLES2Decoder { |
38 public: | 38 public: |
39 MockGLES2Decoder(); | 39 MockGLES2Decoder(); |
40 virtual ~MockGLES2Decoder(); | 40 virtual ~MockGLES2Decoder(); |
41 | 41 |
42 error::Error FakeDoCommands(unsigned int num_commands, | 42 error::Error FakeDoCommands(unsigned int num_commands, |
43 const volatile void* buffer, | 43 const volatile void* buffer, |
44 int num_entries, | 44 int num_entries, |
45 int* entries_processed); | 45 int* entries_processed); |
46 | 46 |
| 47 base::WeakPtr<GLES2Decoder> AsWeakPtr() override; |
| 48 |
47 MOCK_METHOD5(Initialize, | 49 MOCK_METHOD5(Initialize, |
48 bool(const scoped_refptr<gl::GLSurface>& surface, | 50 bool(const scoped_refptr<gl::GLSurface>& surface, |
49 const scoped_refptr<gl::GLContext>& context, | 51 const scoped_refptr<gl::GLContext>& context, |
50 bool offscreen, | 52 bool offscreen, |
51 const DisallowedFeatures& disallowed_features, | 53 const DisallowedFeatures& disallowed_features, |
52 const ContextCreationAttribHelper& attrib_helper)); | 54 const ContextCreationAttribHelper& attrib_helper)); |
53 MOCK_METHOD1(Destroy, void(bool have_context)); | 55 MOCK_METHOD1(Destroy, void(bool have_context)); |
54 MOCK_METHOD1(SetSurface, void(const scoped_refptr<gl::GLSurface>& surface)); | 56 MOCK_METHOD1(SetSurface, void(const scoped_refptr<gl::GLSurface>& surface)); |
55 MOCK_METHOD0(ReleaseSurface, void()); | 57 MOCK_METHOD0(ReleaseSurface, void()); |
56 MOCK_METHOD1(TakeFrontBuffer, void(const Mailbox& mailbox)); | 58 MOCK_METHOD1(TakeFrontBuffer, void(const Mailbox& mailbox)); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 MOCK_METHOD1(SetDescheduleUntilFinishedCallback, | 159 MOCK_METHOD1(SetDescheduleUntilFinishedCallback, |
158 void(const NoParamCallback& callback)); | 160 void(const NoParamCallback& callback)); |
159 MOCK_METHOD1(SetRescheduleAfterFinishedCallback, | 161 MOCK_METHOD1(SetRescheduleAfterFinishedCallback, |
160 void(const NoParamCallback& callback)); | 162 void(const NoParamCallback& callback)); |
161 MOCK_METHOD1(WaitForReadPixels, | 163 MOCK_METHOD1(WaitForReadPixels, |
162 void(base::Closure callback)); | 164 void(base::Closure callback)); |
163 MOCK_CONST_METHOD0(WasContextLost, bool()); | 165 MOCK_CONST_METHOD0(WasContextLost, bool()); |
164 MOCK_CONST_METHOD0(WasContextLostByRobustnessExtension, bool()); | 166 MOCK_CONST_METHOD0(WasContextLostByRobustnessExtension, bool()); |
165 MOCK_METHOD1(MarkContextLost, void(gpu::error::ContextLostReason reason)); | 167 MOCK_METHOD1(MarkContextLost, void(gpu::error::ContextLostReason reason)); |
166 | 168 |
| 169 private: |
| 170 base::WeakPtrFactory<MockGLES2Decoder> weak_ptr_factory_; |
| 171 |
167 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); | 172 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); |
168 }; | 173 }; |
169 | 174 |
170 } // namespace gles2 | 175 } // namespace gles2 |
171 } // namespace gpu | 176 } // namespace gpu |
172 | 177 |
173 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 178 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
OLD | NEW |