Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_mock.h

Issue 1136006: Calling OpenGL from the renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "gfx/size.h"
10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 11 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
11 #include "base/callback.h" 12 #include "base/callback.h"
12 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
13 14
14 namespace gpu { 15 namespace gpu {
15 namespace gles2 { 16 namespace gles2 {
16 17
17 class ContextGroup; 18 class ContextGroup;
18 class MockGLES2Decoder : public GLES2Decoder { 19 class MockGLES2Decoder : public GLES2Decoder {
19 public: 20 public:
20 explicit MockGLES2Decoder(ContextGroup* group) 21 explicit MockGLES2Decoder(ContextGroup* group)
21 : GLES2Decoder(group) { 22 : GLES2Decoder(group) {
22 ON_CALL(*this, GetCommandName(testing::_)) 23 ON_CALL(*this, GetCommandName(testing::_))
23 .WillByDefault(testing::Return("")); 24 .WillByDefault(testing::Return(""));
24 ON_CALL(*this, MakeCurrent()) 25 ON_CALL(*this, MakeCurrent())
25 .WillByDefault(testing::Return(true)); 26 .WillByDefault(testing::Return(true));
26 } 27 }
27 28
28 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
29 MOCK_METHOD2(SetWindowSize, uint64(int32 width, int32 height)); 30 MOCK_METHOD2(SetWindowSize, uint64(int32 width, int32 height));
30 #endif 31 #endif
31 MOCK_METHOD0(Initialize, bool()); 32 MOCK_METHOD3(Initialize, bool(GLES2Decoder* parent,
33 const gfx::Size& size,
34 uint32 parent_texture_id));
32 MOCK_METHOD0(Destroy, void()); 35 MOCK_METHOD0(Destroy, void());
36 MOCK_METHOD1(ResizeOffscreenFrameBuffer, void(const gfx::Size& size));
33 MOCK_METHOD0(MakeCurrent, bool()); 37 MOCK_METHOD0(MakeCurrent, bool());
34 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); 38 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id));
35 MOCK_METHOD0(GetGLES2Util, GLES2Util*()); 39 MOCK_METHOD0(GetGLES2Util, GLES2Util*());
36 MOCK_METHOD1(SetSwapBuffersCallback, void(Callback0::Type*)); 40 MOCK_METHOD1(SetSwapBuffersCallback, void(Callback0::Type*));
37 MOCK_METHOD3(DoCommand, error::Error(unsigned int command, 41 MOCK_METHOD3(DoCommand, error::Error(unsigned int command,
38 unsigned int arg_count, 42 unsigned int arg_count,
39 const void* cmd_data)); 43 const void* cmd_data));
40 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); 44 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id));
41 45
42 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); 46 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder);
43 }; 47 };
44 48
45 } // namespace gles2 49 } // namespace gles2
46 } // namespace gpu 50 } // namespace gpu
47 51
48 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ 52 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698