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

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

Issue 118203002: During virtual context switches only restore texture units that have changed from the previous cont… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change mock GetContextState to return const ContextState* instead of non-const Created 6 years, 11 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
OLDNEW
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 <vector> 10 #include <vector>
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 namespace gpu { 23 namespace gpu {
24 class StreamTextureManager; 24 class StreamTextureManager;
25 25
26 namespace gles2 { 26 namespace gles2 {
27 27
28 class ContextGroup; 28 class ContextGroup;
29 class ErrorState; 29 class ErrorState;
30 class QueryManager; 30 class QueryManager;
31 struct ContextState;
31 32
32 class MockGLES2Decoder : public GLES2Decoder { 33 class MockGLES2Decoder : public GLES2Decoder {
33 public: 34 public:
34 MockGLES2Decoder(); 35 MockGLES2Decoder();
35 virtual ~MockGLES2Decoder(); 36 virtual ~MockGLES2Decoder();
36 37
37 MOCK_METHOD6(Initialize, 38 MOCK_METHOD6(Initialize,
38 bool(const scoped_refptr<gfx::GLSurface>& surface, 39 bool(const scoped_refptr<gfx::GLSurface>& surface,
39 const scoped_refptr<gfx::GLContext>& context, 40 const scoped_refptr<gfx::GLContext>& context,
40 bool offscreen, 41 bool offscreen,
41 const gfx::Size& size, 42 const gfx::Size& size,
42 const DisallowedFeatures& disallowed_features, 43 const DisallowedFeatures& disallowed_features,
43 const std::vector<int32>& attribs)); 44 const std::vector<int32>& attribs));
44 MOCK_METHOD1(Destroy, void(bool have_context)); 45 MOCK_METHOD1(Destroy, void(bool have_context));
45 MOCK_METHOD1(SetSurface, void(const scoped_refptr<gfx::GLSurface>& surface)); 46 MOCK_METHOD1(SetSurface, void(const scoped_refptr<gfx::GLSurface>& surface));
46 MOCK_METHOD1(ProduceFrontBuffer, bool(const Mailbox& mailbox)); 47 MOCK_METHOD1(ProduceFrontBuffer, bool(const Mailbox& mailbox));
47 MOCK_METHOD1(ResizeOffscreenFrameBuffer, bool(const gfx::Size& size)); 48 MOCK_METHOD1(ResizeOffscreenFrameBuffer, bool(const gfx::Size& size));
48 MOCK_METHOD0(MakeCurrent, bool()); 49 MOCK_METHOD0(MakeCurrent, bool());
49 MOCK_METHOD0(ReleaseCurrent, void()); 50 MOCK_METHOD0(ReleaseCurrent, void());
50 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); 51 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id));
51 MOCK_METHOD0(GetGLES2Util, GLES2Util*()); 52 MOCK_METHOD0(GetGLES2Util, GLES2Util*());
52 MOCK_METHOD0(GetGLSurface, gfx::GLSurface*()); 53 MOCK_METHOD0(GetGLSurface, gfx::GLSurface*());
53 MOCK_METHOD0(GetGLContext, gfx::GLContext*()); 54 MOCK_METHOD0(GetGLContext, gfx::GLContext*());
54 MOCK_METHOD0(GetContextGroup, ContextGroup*()); 55 MOCK_METHOD0(GetContextGroup, ContextGroup*());
56 MOCK_METHOD0(GetContextState, const ContextState*());
55 MOCK_METHOD0(GetCapabilities, Capabilities()); 57 MOCK_METHOD0(GetCapabilities, Capabilities());
56 MOCK_METHOD0(ProcessPendingQueries, bool()); 58 MOCK_METHOD0(ProcessPendingQueries, bool());
57 MOCK_METHOD0(HasMoreIdleWork, bool()); 59 MOCK_METHOD0(HasMoreIdleWork, bool());
58 MOCK_METHOD0(PerformIdleWork, void()); 60 MOCK_METHOD0(PerformIdleWork, void());
59 MOCK_CONST_METHOD0(RestoreState, void()); 61 MOCK_CONST_METHOD1(RestoreState, void(const ContextState* prev_state));
60 MOCK_CONST_METHOD0(RestoreActiveTexture, void()); 62 MOCK_CONST_METHOD0(RestoreActiveTexture, void());
61 MOCK_CONST_METHOD0(RestoreAllTextureUnitBindings, void()); 63 MOCK_CONST_METHOD1(
64 RestoreAllTextureUnitBindings, void(const ContextState* state));
62 MOCK_CONST_METHOD1(RestoreAttribute, void(unsigned index)); 65 MOCK_CONST_METHOD1(RestoreAttribute, void(unsigned index));
63 MOCK_CONST_METHOD0(RestoreBufferBindings, void()); 66 MOCK_CONST_METHOD0(RestoreBufferBindings, void());
64 MOCK_CONST_METHOD0(RestoreFramebufferBindings, void()); 67 MOCK_CONST_METHOD0(RestoreFramebufferBindings, void());
65 MOCK_CONST_METHOD0(RestoreGlobalState, void()); 68 MOCK_CONST_METHOD0(RestoreGlobalState, void());
66 MOCK_CONST_METHOD0(RestoreProgramBindings, void()); 69 MOCK_CONST_METHOD0(RestoreProgramBindings, void());
67 MOCK_CONST_METHOD0(RestoreRenderbufferBindings, void()); 70 MOCK_CONST_METHOD0(RestoreRenderbufferBindings, void());
68 MOCK_CONST_METHOD1(RestoreTextureState, void(unsigned service_id)); 71 MOCK_CONST_METHOD1(RestoreTextureState, void(unsigned service_id));
69 MOCK_CONST_METHOD1(RestoreTextureUnitBindings, void(unsigned unit)); 72 MOCK_CONST_METHOD1(RestoreTextureUnitBindings, void(unsigned unit));
70 MOCK_METHOD0(GetQueryManager, gpu::gles2::QueryManager*()); 73 MOCK_METHOD0(GetQueryManager, gpu::gles2::QueryManager*());
71 MOCK_METHOD0(GetVertexArrayManager, gpu::gles2::VertexArrayManager*()); 74 MOCK_METHOD0(GetVertexArrayManager, gpu::gles2::VertexArrayManager*());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 MOCK_METHOD0(WasContextLostByRobustnessExtension, bool()); 115 MOCK_METHOD0(WasContextLostByRobustnessExtension, bool());
113 MOCK_METHOD1(LoseContext, void(uint32 reset_status)); 116 MOCK_METHOD1(LoseContext, void(uint32 reset_status));
114 117
115 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); 118 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder);
116 }; 119 };
117 120
118 } // namespace gles2 121 } // namespace gles2
119 } // namespace gpu 122 } // namespace gpu
120 123
121 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ 124 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698