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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 GLint fake_location; | 59 GLint fake_location; |
60 GLint real_location; | 60 GLint real_location; |
61 GLint desired_location; | 61 GLint desired_location; |
62 const char* good_name; | 62 const char* good_name; |
63 }; | 63 }; |
64 | 64 |
65 static void SetupContextGroupInitExpectations( | 65 static void SetupContextGroupInitExpectations( |
66 ::gfx::MockGLInterface* gl, | 66 ::gfx::MockGLInterface* gl, |
67 const DisallowedFeatures& disallowed_features, | 67 const DisallowedFeatures& disallowed_features, |
68 const char* extensions, | 68 const char* extensions, |
69 const char* gl_version); | 69 const char* gl_version, |
| 70 bool bind_generates_resource); |
70 static void SetupFeatureInfoInitExpectations( | 71 static void SetupFeatureInfoInitExpectations( |
71 ::gfx::MockGLInterface* gl, const char* extensions); | 72 ::gfx::MockGLInterface* gl, const char* extensions); |
72 static void SetupFeatureInfoInitExpectationsWithGLVersion( | 73 static void SetupFeatureInfoInitExpectationsWithGLVersion( |
73 ::gfx::MockGLInterface* gl, | 74 ::gfx::MockGLInterface* gl, |
74 const char* extensions, | 75 const char* extensions, |
75 const char* gl_renderer, | 76 const char* gl_renderer, |
76 const char* gl_version); | 77 const char* gl_version); |
77 static void SetupTextureManagerInitExpectations( | 78 static void SetupTextureManagerInitExpectations(::gfx::MockGLInterface* gl, |
78 ::gfx::MockGLInterface* gl, const char* extensions); | 79 const char* extensions, |
| 80 bool use_default_textures); |
79 static void SetupTextureManagerDestructionExpectations( | 81 static void SetupTextureManagerDestructionExpectations( |
80 ::gfx::MockGLInterface* gl, const char* extensions); | 82 ::gfx::MockGLInterface* gl, |
| 83 const char* extensions, |
| 84 bool use_default_textures); |
81 | 85 |
82 static void SetupExpectationsForClearingUniforms( | 86 static void SetupExpectationsForClearingUniforms( |
83 ::gfx::MockGLInterface* gl, UniformInfo* uniforms, size_t num_uniforms); | 87 ::gfx::MockGLInterface* gl, UniformInfo* uniforms, size_t num_uniforms); |
84 | 88 |
85 static void SetupShader( | 89 static void SetupShader( |
86 ::gfx::MockGLInterface* gl, | 90 ::gfx::MockGLInterface* gl, |
87 AttribInfo* attribs, size_t num_attribs, | 91 AttribInfo* attribs, size_t num_attribs, |
88 UniformInfo* uniforms, size_t num_uniforms, | 92 UniformInfo* uniforms, size_t num_uniforms, |
89 GLuint service_id); | 93 GLuint service_id); |
90 | 94 |
91 static void SetupProgramSuccessExpectations(::gfx::MockGLInterface* gl, | 95 static void SetupProgramSuccessExpectations(::gfx::MockGLInterface* gl, |
92 AttribInfo* attribs, size_t num_attribs, | 96 AttribInfo* attribs, size_t num_attribs, |
93 UniformInfo* uniforms, size_t num_uniforms, | 97 UniformInfo* uniforms, size_t num_uniforms, |
94 GLuint service_id); | 98 GLuint service_id); |
95 | 99 |
96 static void DoBufferData( | 100 static void DoBufferData( |
97 ::gfx::MockGLInterface* gl, MockErrorState* error_state, | 101 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
98 BufferManager* manager, Buffer* buffer, GLsizeiptr size, GLenum usage, | 102 BufferManager* manager, Buffer* buffer, GLsizeiptr size, GLenum usage, |
99 const GLvoid* data, GLenum error); | 103 const GLvoid* data, GLenum error); |
100 | 104 |
101 static void SetTexParameteriWithExpectations( | 105 static void SetTexParameteriWithExpectations( |
102 ::gfx::MockGLInterface* gl, MockErrorState* error_state, | 106 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
103 TextureManager* manager, TextureRef* texture_ref, | 107 TextureManager* manager, TextureRef* texture_ref, |
104 GLenum pname, GLint value, GLenum error); | 108 GLenum pname, GLint value, GLenum error); |
105 | 109 |
106 private: | 110 private: |
107 static void SetupTextureInitializationExpectations( | 111 static void SetupTextureInitializationExpectations(::gfx::MockGLInterface* gl, |
108 ::gfx::MockGLInterface* gl, GLenum target); | 112 GLenum target, |
109 static void SetupTextureDestructionExpectations( | 113 bool use_default_textures); |
110 ::gfx::MockGLInterface* gl, GLenum target); | 114 static void SetupTextureDestructionExpectations(::gfx::MockGLInterface* gl, |
| 115 GLenum target, |
| 116 bool use_default_textures); |
111 }; | 117 }; |
112 | 118 |
113 // This object temporaritly Sets what gfx::GetGLImplementation returns. During | 119 // This object temporaritly Sets what gfx::GetGLImplementation returns. During |
114 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of | 120 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of |
115 // code branches based on what gfx::GetGLImplementation returns. | 121 // code branches based on what gfx::GetGLImplementation returns. |
116 class ScopedGLImplementationSetter { | 122 class ScopedGLImplementationSetter { |
117 public: | 123 public: |
118 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); | 124 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); |
119 ~ScopedGLImplementationSetter(); | 125 ~ScopedGLImplementationSetter(); |
120 | 126 |
121 private: | 127 private: |
122 gfx::GLImplementation old_implementation_; | 128 gfx::GLImplementation old_implementation_; |
123 }; | 129 }; |
124 | 130 |
125 } // namespace gles2 | 131 } // namespace gles2 |
126 } // namespace gpu | 132 } // namespace gpu |
127 | 133 |
128 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 134 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
129 | 135 |
OLD | NEW |