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 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
7 | 7 |
8 #include "ui/gl/gl_implementation.h" | 8 #include "ui/gl/gl_implementation.h" |
9 #include "ui/gl/gl_mock.h" | 9 #include "ui/gl/gl_mock.h" |
10 | 10 |
11 namespace gpu { | 11 namespace gpu { |
12 namespace gles2 { | 12 namespace gles2 { |
13 | 13 |
14 struct DisallowedFeatures; | 14 struct DisallowedFeatures; |
15 class Buffer; | 15 class Buffer; |
16 class BufferManager; | 16 class BufferManager; |
17 class MockGLES2Decoder; | 17 class MockErrorState; |
18 class Texture; | 18 class Texture; |
19 class TextureManager; | 19 class TextureManager; |
20 | 20 |
21 class TestHelper { | 21 class TestHelper { |
22 public: | 22 public: |
23 static const GLuint kServiceBlackTexture2dId = 701; | 23 static const GLuint kServiceBlackTexture2dId = 701; |
24 static const GLuint kServiceDefaultTexture2dId = 702; | 24 static const GLuint kServiceDefaultTexture2dId = 702; |
25 static const GLuint kServiceBlackTextureCubemapId = 703; | 25 static const GLuint kServiceBlackTextureCubemapId = 703; |
26 static const GLuint kServiceDefaultTextureCubemapId = 704; | 26 static const GLuint kServiceDefaultTextureCubemapId = 704; |
27 static const GLuint kServiceBlackExternalTextureId = 705; | 27 static const GLuint kServiceBlackExternalTextureId = 705; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 AttribInfo* attribs, size_t num_attribs, | 85 AttribInfo* attribs, size_t num_attribs, |
86 UniformInfo* uniforms, size_t num_uniforms, | 86 UniformInfo* uniforms, size_t num_uniforms, |
87 GLuint service_id); | 87 GLuint service_id); |
88 | 88 |
89 static void SetupProgramSuccessExpectations(::gfx::MockGLInterface* gl, | 89 static void SetupProgramSuccessExpectations(::gfx::MockGLInterface* gl, |
90 AttribInfo* attribs, size_t num_attribs, | 90 AttribInfo* attribs, size_t num_attribs, |
91 UniformInfo* uniforms, size_t num_uniforms, | 91 UniformInfo* uniforms, size_t num_uniforms, |
92 GLuint service_id); | 92 GLuint service_id); |
93 | 93 |
94 static void DoBufferData( | 94 static void DoBufferData( |
95 ::gfx::MockGLInterface* gl, MockGLES2Decoder* decoder, | 95 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
96 BufferManager* manager, Buffer* buffer, GLsizeiptr size, GLenum usage, | 96 BufferManager* manager, Buffer* buffer, GLsizeiptr size, GLenum usage, |
97 const GLvoid* data, GLenum error); | 97 const GLvoid* data, GLenum error); |
98 | 98 |
99 static void SetTexParameterWithExpectations( | 99 static void SetTexParameterWithExpectations( |
100 ::gfx::MockGLInterface* gl, MockGLES2Decoder* decoder, | 100 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
101 TextureManager* manager, Texture* texture, | 101 TextureManager* manager, Texture* texture, |
102 GLenum pname, GLint value, GLenum error); | 102 GLenum pname, GLint value, GLenum error); |
103 | 103 |
104 private: | 104 private: |
105 static void SetupTextureInitializationExpectations( | 105 static void SetupTextureInitializationExpectations( |
106 ::gfx::MockGLInterface* gl, GLenum target); | 106 ::gfx::MockGLInterface* gl, GLenum target); |
107 static void SetupTextureDestructionExpectations( | 107 static void SetupTextureDestructionExpectations( |
108 ::gfx::MockGLInterface* gl, GLenum target); | 108 ::gfx::MockGLInterface* gl, GLenum target); |
109 }; | 109 }; |
110 | 110 |
111 // This object temporaritly Sets what gfx::GetGLImplementation returns. During | 111 // This object temporaritly Sets what gfx::GetGLImplementation returns. During |
112 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of | 112 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of |
113 // code branches based on what gfx::GetGLImplementation returns. | 113 // code branches based on what gfx::GetGLImplementation returns. |
114 class ScopedGLImplementationSetter { | 114 class ScopedGLImplementationSetter { |
115 public: | 115 public: |
116 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); | 116 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); |
117 ~ScopedGLImplementationSetter(); | 117 ~ScopedGLImplementationSetter(); |
118 | 118 |
119 private: | 119 private: |
120 gfx::GLImplementation old_implementation_; | 120 gfx::GLImplementation old_implementation_; |
121 }; | 121 }; |
122 | 122 |
123 } // namespace gles2 | 123 } // namespace gles2 |
124 } // namespace gpu | 124 } // namespace gpu |
125 | 125 |
126 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 126 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
127 | 127 |
OLD | NEW |