| 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 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 static void SetupProgramSuccessExpectations(::gfx::MockGLInterface* gl, | 91 static void SetupProgramSuccessExpectations(::gfx::MockGLInterface* gl, |
| 92 AttribInfo* attribs, size_t num_attribs, | 92 AttribInfo* attribs, size_t num_attribs, |
| 93 UniformInfo* uniforms, size_t num_uniforms, | 93 UniformInfo* uniforms, size_t num_uniforms, |
| 94 GLuint service_id); | 94 GLuint service_id); |
| 95 | 95 |
| 96 static void DoBufferData( | 96 static void DoBufferData( |
| 97 ::gfx::MockGLInterface* gl, MockErrorState* error_state, | 97 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
| 98 BufferManager* manager, Buffer* buffer, GLsizeiptr size, GLenum usage, | 98 BufferManager* manager, Buffer* buffer, GLsizeiptr size, GLenum usage, |
| 99 const GLvoid* data, GLenum error); | 99 const GLvoid* data, GLenum error); |
| 100 | 100 |
| 101 static void SetTexParameterWithExpectations( | 101 static void SetTexParameteriWithExpectations( |
| 102 ::gfx::MockGLInterface* gl, MockErrorState* error_state, | 102 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
| 103 TextureManager* manager, TextureRef* texture_ref, | 103 TextureManager* manager, TextureRef* texture_ref, |
| 104 GLenum pname, GLint value, GLenum error); | 104 GLenum pname, GLint value, GLenum error); |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 static void SetupTextureInitializationExpectations( | 107 static void SetupTextureInitializationExpectations( |
| 108 ::gfx::MockGLInterface* gl, GLenum target); | 108 ::gfx::MockGLInterface* gl, GLenum target); |
| 109 static void SetupTextureDestructionExpectations( | 109 static void SetupTextureDestructionExpectations( |
| 110 ::gfx::MockGLInterface* gl, GLenum target); | 110 ::gfx::MockGLInterface* gl, GLenum target); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 // This object temporaritly Sets what gfx::GetGLImplementation returns. During | 113 // This object temporaritly Sets what gfx::GetGLImplementation returns. During |
| 114 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of | 114 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of |
| 115 // code branches based on what gfx::GetGLImplementation returns. | 115 // code branches based on what gfx::GetGLImplementation returns. |
| 116 class ScopedGLImplementationSetter { | 116 class ScopedGLImplementationSetter { |
| 117 public: | 117 public: |
| 118 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); | 118 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); |
| 119 ~ScopedGLImplementationSetter(); | 119 ~ScopedGLImplementationSetter(); |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 gfx::GLImplementation old_implementation_; | 122 gfx::GLImplementation old_implementation_; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace gles2 | 125 } // namespace gles2 |
| 126 } // namespace gpu | 126 } // namespace gpu |
| 127 | 127 |
| 128 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 128 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
| 129 | 129 |
| OLD | NEW |