Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / gpu / command_buffer / service / gles2_cmd_decoder_mock.h
blob3a1e9a9dd1bff309f78c124a3af9724985edebef
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
3 // found in the LICENSE file.
5 // This file contains the mock GLES2Decoder class.
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_
8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_
10 #include <vector>
12 #include "gpu/command_buffer/common/mailbox.h"
13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
14 #include "base/callback_forward.h"
15 #include "testing/gmock/include/gmock/gmock.h"
16 #include "ui/gfx/size.h"
18 namespace gfx {
19 class GLContext;
20 class GLSurface;
23 namespace gpu {
24 namespace gles2 {
26 class ContextGroup;
27 class ErrorState;
28 class QueryManager;
29 struct ContextState;
31 class MockGLES2Decoder : public GLES2Decoder {
32 public:
33 MockGLES2Decoder();
34 virtual ~MockGLES2Decoder();
36 MOCK_METHOD6(Initialize,
37 bool(const scoped_refptr<gfx::GLSurface>& surface,
38 const scoped_refptr<gfx::GLContext>& context,
39 bool offscreen,
40 const gfx::Size& size,
41 const DisallowedFeatures& disallowed_features,
42 const std::vector<int32>& attribs));
43 MOCK_METHOD1(Destroy, void(bool have_context));
44 MOCK_METHOD1(SetSurface, void(const scoped_refptr<gfx::GLSurface>& surface));
45 MOCK_METHOD1(ProduceFrontBuffer, void(const Mailbox& mailbox));
46 MOCK_METHOD1(ResizeOffscreenFrameBuffer, bool(const gfx::Size& size));
47 MOCK_METHOD0(MakeCurrent, bool());
48 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id));
49 MOCK_METHOD0(GetGLES2Util, GLES2Util*());
50 MOCK_METHOD0(GetGLSurface, gfx::GLSurface*());
51 MOCK_METHOD0(GetGLContext, gfx::GLContext*());
52 MOCK_METHOD0(GetContextGroup, ContextGroup*());
53 MOCK_METHOD0(GetContextState, const ContextState*());
54 MOCK_METHOD0(GetCapabilities, Capabilities());
55 MOCK_METHOD0(ProcessPendingQueries, bool());
56 MOCK_METHOD0(HasMoreIdleWork, bool());
57 MOCK_METHOD0(PerformIdleWork, void());
58 MOCK_METHOD1(RestoreState, void(const ContextState* prev_state));
59 MOCK_CONST_METHOD0(RestoreActiveTexture, void());
60 MOCK_CONST_METHOD1(
61 RestoreAllTextureUnitBindings, void(const ContextState* state));
62 MOCK_CONST_METHOD1(
63 RestoreActiveTextureUnitBinding, void(unsigned int target));
64 MOCK_CONST_METHOD0(RestoreBufferBindings, void());
65 MOCK_CONST_METHOD0(RestoreFramebufferBindings, void());
66 MOCK_CONST_METHOD0(RestoreGlobalState, void());
67 MOCK_CONST_METHOD0(RestoreProgramBindings, void());
68 MOCK_METHOD0(RestoreRenderbufferBindings, void());
69 MOCK_CONST_METHOD1(RestoreTextureState, void(unsigned service_id));
70 MOCK_CONST_METHOD1(RestoreTextureUnitBindings, void(unsigned unit));
71 MOCK_CONST_METHOD0(ClearAllAttributes, void());
72 MOCK_CONST_METHOD0(RestoreAllAttributes, void());
73 MOCK_METHOD0(GetQueryManager, gpu::gles2::QueryManager*());
74 MOCK_METHOD0(GetVertexArrayManager, gpu::gles2::VertexArrayManager*());
75 MOCK_METHOD0(GetImageManager, gpu::gles2::ImageManager*());
76 MOCK_METHOD1(
77 SetResizeCallback, void(const base::Callback<void(gfx::Size, float)>&));
78 MOCK_METHOD0(GetAsyncPixelTransferDelegate,
79 AsyncPixelTransferDelegate*());
80 MOCK_METHOD0(GetAsyncPixelTransferManager,
81 AsyncPixelTransferManager*());
82 MOCK_METHOD0(ResetAsyncPixelTransferManagerForTest, void());
83 MOCK_METHOD1(SetAsyncPixelTransferManagerForTest,
84 void(AsyncPixelTransferManager*));
85 MOCK_METHOD1(SetIgnoreCachedStateForTest, void(bool ignore));
86 MOCK_METHOD3(DoCommand, error::Error(unsigned int command,
87 unsigned int arg_count,
88 const void* cmd_data));
89 MOCK_METHOD2(GetServiceTextureId, bool(uint32 client_texture_id,
90 uint32* service_texture_id));
91 MOCK_METHOD0(GetContextLostReason, error::ContextLostReason());
92 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id));
93 MOCK_METHOD10(ClearLevel, bool(
94 unsigned service_id,
95 unsigned bind_target,
96 unsigned target,
97 int level,
98 unsigned internal_format,
99 unsigned format,
100 unsigned type,
101 int width,
102 int height,
103 bool is_texture_immutable));
104 MOCK_METHOD0(GetErrorState, ErrorState *());
106 MOCK_METHOD0(GetLogger, Logger*());
107 MOCK_METHOD1(SetShaderCacheCallback,
108 void(const ShaderCacheCallback& callback));
109 MOCK_METHOD1(SetWaitSyncPointCallback,
110 void(const WaitSyncPointCallback& callback));
111 MOCK_METHOD1(WaitForReadPixels,
112 void(base::Closure callback));
113 MOCK_METHOD0(GetTextureUploadCount, uint32());
114 MOCK_METHOD0(GetTotalTextureUploadTime, base::TimeDelta());
115 MOCK_METHOD0(GetTotalProcessingCommandsTime, base::TimeDelta());
116 MOCK_METHOD1(AddProcessingCommandsTime, void(base::TimeDelta));
117 MOCK_METHOD0(WasContextLost, bool());
118 MOCK_METHOD0(WasContextLostByRobustnessExtension, bool());
119 MOCK_METHOD1(LoseContext, void(uint32 reset_status));
121 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder);
124 } // namespace gles2
125 } // namespace gpu
127 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_