| 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> |
| 11 |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" |
| 13 #include "gpu/command_buffer/common/mailbox.h" | 16 #include "gpu/command_buffer/common/mailbox.h" |
| 14 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 17 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "ui/gfx/geometry/size.h" | 19 #include "ui/gfx/geometry/size.h" |
| 17 | 20 |
| 18 namespace gfx { | 21 namespace gfx { |
| 19 class GLContext; | 22 class GLContext; |
| 20 class GLSurface; | 23 class GLSurface; |
| 21 } | 24 } |
| 22 | 25 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 const void* buffer, | 42 const void* buffer, |
| 40 int num_entries, | 43 int num_entries, |
| 41 int* entries_processed); | 44 int* entries_processed); |
| 42 | 45 |
| 43 MOCK_METHOD6(Initialize, | 46 MOCK_METHOD6(Initialize, |
| 44 bool(const scoped_refptr<gfx::GLSurface>& surface, | 47 bool(const scoped_refptr<gfx::GLSurface>& surface, |
| 45 const scoped_refptr<gfx::GLContext>& context, | 48 const scoped_refptr<gfx::GLContext>& context, |
| 46 bool offscreen, | 49 bool offscreen, |
| 47 const gfx::Size& size, | 50 const gfx::Size& size, |
| 48 const DisallowedFeatures& disallowed_features, | 51 const DisallowedFeatures& disallowed_features, |
| 49 const std::vector<int32>& attribs)); | 52 const std::vector<int32_t>& attribs)); |
| 50 MOCK_METHOD1(Destroy, void(bool have_context)); | 53 MOCK_METHOD1(Destroy, void(bool have_context)); |
| 51 MOCK_METHOD1(SetSurface, void(const scoped_refptr<gfx::GLSurface>& surface)); | 54 MOCK_METHOD1(SetSurface, void(const scoped_refptr<gfx::GLSurface>& surface)); |
| 52 MOCK_METHOD1(ProduceFrontBuffer, void(const Mailbox& mailbox)); | 55 MOCK_METHOD1(ProduceFrontBuffer, void(const Mailbox& mailbox)); |
| 53 MOCK_METHOD1(ResizeOffscreenFrameBuffer, bool(const gfx::Size& size)); | 56 MOCK_METHOD1(ResizeOffscreenFrameBuffer, bool(const gfx::Size& size)); |
| 54 MOCK_METHOD0(MakeCurrent, bool()); | 57 MOCK_METHOD0(MakeCurrent, bool()); |
| 55 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); | 58 MOCK_METHOD1(GetServiceIdForTesting, uint32_t(uint32_t client_id)); |
| 56 MOCK_METHOD0(GetGLES2Util, GLES2Util*()); | 59 MOCK_METHOD0(GetGLES2Util, GLES2Util*()); |
| 57 MOCK_METHOD0(GetGLSurface, gfx::GLSurface*()); | 60 MOCK_METHOD0(GetGLSurface, gfx::GLSurface*()); |
| 58 MOCK_METHOD0(GetGLContext, gfx::GLContext*()); | 61 MOCK_METHOD0(GetGLContext, gfx::GLContext*()); |
| 59 MOCK_METHOD0(GetContextGroup, ContextGroup*()); | 62 MOCK_METHOD0(GetContextGroup, ContextGroup*()); |
| 60 MOCK_METHOD0(GetContextState, const ContextState*()); | 63 MOCK_METHOD0(GetContextState, const ContextState*()); |
| 61 MOCK_METHOD0(GetCapabilities, Capabilities()); | 64 MOCK_METHOD0(GetCapabilities, Capabilities()); |
| 62 MOCK_CONST_METHOD0(HasPendingQueries, bool()); | 65 MOCK_CONST_METHOD0(HasPendingQueries, bool()); |
| 63 MOCK_METHOD1(ProcessPendingQueries, void(bool)); | 66 MOCK_METHOD1(ProcessPendingQueries, void(bool)); |
| 64 MOCK_CONST_METHOD0(HasMoreIdleWork, bool()); | 67 MOCK_CONST_METHOD0(HasMoreIdleWork, bool()); |
| 65 MOCK_METHOD0(PerformIdleWork, void()); | 68 MOCK_METHOD0(PerformIdleWork, void()); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 88 MOCK_METHOD1(SetForceShaderNameHashingForTest, void(bool force)); | 91 MOCK_METHOD1(SetForceShaderNameHashingForTest, void(bool force)); |
| 89 MOCK_METHOD1(SetAllowExit, void(bool allow)); | 92 MOCK_METHOD1(SetAllowExit, void(bool allow)); |
| 90 MOCK_METHOD3(DoCommand, error::Error(unsigned int command, | 93 MOCK_METHOD3(DoCommand, error::Error(unsigned int command, |
| 91 unsigned int arg_count, | 94 unsigned int arg_count, |
| 92 const void* cmd_data)); | 95 const void* cmd_data)); |
| 93 MOCK_METHOD4(DoCommands, | 96 MOCK_METHOD4(DoCommands, |
| 94 error::Error(unsigned int num_commands, | 97 error::Error(unsigned int num_commands, |
| 95 const void* buffer, | 98 const void* buffer, |
| 96 int num_entries, | 99 int num_entries, |
| 97 int* entries_processed)); | 100 int* entries_processed)); |
| 98 MOCK_METHOD2(GetServiceTextureId, bool(uint32 client_texture_id, | 101 MOCK_METHOD2(GetServiceTextureId, |
| 99 uint32* service_texture_id)); | 102 bool(uint32_t client_texture_id, uint32_t* service_texture_id)); |
| 100 MOCK_METHOD0(GetContextLostReason, error::ContextLostReason()); | 103 MOCK_METHOD0(GetContextLostReason, error::ContextLostReason()); |
| 101 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); | 104 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); |
| 102 MOCK_METHOD9(ClearLevel, | 105 MOCK_METHOD9(ClearLevel, |
| 103 bool(Texture* texture, | 106 bool(Texture* texture, |
| 104 unsigned target, | 107 unsigned target, |
| 105 int level, | 108 int level, |
| 106 unsigned format, | 109 unsigned format, |
| 107 unsigned type, | 110 unsigned type, |
| 108 int x_offset, | 111 int x_offset, |
| 109 int y_offset, | 112 int y_offset, |
| 110 int width, | 113 int width, |
| 111 int height)); | 114 int height)); |
| 112 MOCK_METHOD0(GetErrorState, ErrorState *()); | 115 MOCK_METHOD0(GetErrorState, ErrorState *()); |
| 113 | 116 |
| 114 MOCK_METHOD0(GetLogger, Logger*()); | 117 MOCK_METHOD0(GetLogger, Logger*()); |
| 115 MOCK_METHOD1(SetShaderCacheCallback, | 118 MOCK_METHOD1(SetShaderCacheCallback, |
| 116 void(const ShaderCacheCallback& callback)); | 119 void(const ShaderCacheCallback& callback)); |
| 117 MOCK_METHOD1(SetWaitSyncPointCallback, | 120 MOCK_METHOD1(SetWaitSyncPointCallback, |
| 118 void(const WaitSyncPointCallback& callback)); | 121 void(const WaitSyncPointCallback& callback)); |
| 119 MOCK_METHOD1(SetFenceSyncReleaseCallback, | 122 MOCK_METHOD1(SetFenceSyncReleaseCallback, |
| 120 void(const FenceSyncReleaseCallback& callback)); | 123 void(const FenceSyncReleaseCallback& callback)); |
| 121 MOCK_METHOD1(SetWaitFenceSyncCallback, | 124 MOCK_METHOD1(SetWaitFenceSyncCallback, |
| 122 void(const WaitFenceSyncCallback& callback)); | 125 void(const WaitFenceSyncCallback& callback)); |
| 123 MOCK_METHOD1(WaitForReadPixels, | 126 MOCK_METHOD1(WaitForReadPixels, |
| 124 void(base::Closure callback)); | 127 void(base::Closure callback)); |
| 125 MOCK_METHOD0(GetTextureUploadCount, uint32()); | 128 MOCK_METHOD0(GetTextureUploadCount, uint32_t()); |
| 126 MOCK_METHOD0(GetTotalTextureUploadTime, base::TimeDelta()); | 129 MOCK_METHOD0(GetTotalTextureUploadTime, base::TimeDelta()); |
| 127 MOCK_METHOD0(GetTotalProcessingCommandsTime, base::TimeDelta()); | 130 MOCK_METHOD0(GetTotalProcessingCommandsTime, base::TimeDelta()); |
| 128 MOCK_METHOD1(AddProcessingCommandsTime, void(base::TimeDelta)); | 131 MOCK_METHOD1(AddProcessingCommandsTime, void(base::TimeDelta)); |
| 129 MOCK_CONST_METHOD0(WasContextLost, bool()); | 132 MOCK_CONST_METHOD0(WasContextLost, bool()); |
| 130 MOCK_CONST_METHOD0(WasContextLostByRobustnessExtension, bool()); | 133 MOCK_CONST_METHOD0(WasContextLostByRobustnessExtension, bool()); |
| 131 MOCK_METHOD1(MarkContextLost, void(gpu::error::ContextLostReason reason)); | 134 MOCK_METHOD1(MarkContextLost, void(gpu::error::ContextLostReason reason)); |
| 132 | 135 |
| 133 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); | 136 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); |
| 134 }; | 137 }; |
| 135 | 138 |
| 136 } // namespace gles2 | 139 } // namespace gles2 |
| 137 } // namespace gpu | 140 } // namespace gpu |
| 138 | 141 |
| 139 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 142 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
| OLD | NEW |