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_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
7 | 7 |
8 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
10 #include "gpu/command_buffer/service/buffer_manager.h" | 10 #include "gpu/command_buffer/service/buffer_manager.h" |
11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
12 #include "gpu/command_buffer/service/context_group.h" | 12 #include "gpu/command_buffer/service/context_group.h" |
13 #include "gpu/command_buffer/service/framebuffer_manager.h" | 13 #include "gpu/command_buffer/service/framebuffer_manager.h" |
14 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 14 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
15 #include "gpu/command_buffer/service/program_manager.h" | 15 #include "gpu/command_buffer/service/program_manager.h" |
16 #include "gpu/command_buffer/service/query_manager.h" | 16 #include "gpu/command_buffer/service/query_manager.h" |
17 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 17 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
18 #include "gpu/command_buffer/service/shader_manager.h" | 18 #include "gpu/command_buffer/service/shader_manager.h" |
19 #include "gpu/command_buffer/service/stream_texture_manager_mock.h" | 19 #include "gpu/command_buffer/service/stream_texture_manager_mock.h" |
20 #include "gpu/command_buffer/service/test_helper.h" | 20 #include "gpu/command_buffer/service/test_helper.h" |
21 #include "gpu/command_buffer/service/texture_manager.h" | 21 #include "gpu/command_buffer/service/texture_manager.h" |
22 #include "gpu/command_buffer/service/vertex_array_manager.h" | 22 #include "gpu/command_buffer/service/vertex_array_manager.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "ui/gl/gl_context_stub.h" | 24 #include "ui/gl/gl_context_stub_with_extensions.h" |
25 #include "ui/gl/gl_surface_stub.h" | 25 #include "ui/gl/gl_surface_stub.h" |
26 #include "ui/gl/gl_mock.h" | 26 #include "ui/gl/gl_mock.h" |
27 | 27 |
28 class CommandLine; | 28 class CommandLine; |
29 | 29 |
30 namespace gpu { | 30 namespace gpu { |
31 namespace gles2 { | 31 namespace gles2 { |
32 | 32 |
33 class MemoryTracker; | 33 class MemoryTracker; |
34 | 34 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 void DoCreateShader(GLenum shader_type, GLuint client_id, GLuint service_id); | 149 void DoCreateShader(GLenum shader_type, GLuint client_id, GLuint service_id); |
150 | 150 |
151 void SetBucketAsCString(uint32 bucket_id, const char* str); | 151 void SetBucketAsCString(uint32 bucket_id, const char* str); |
152 | 152 |
153 void set_memory_tracker(MemoryTracker* memory_tracker) { | 153 void set_memory_tracker(MemoryTracker* memory_tracker) { |
154 memory_tracker_ = memory_tracker; | 154 memory_tracker_ = memory_tracker; |
155 } | 155 } |
156 | 156 |
157 void InitDecoder( | 157 void InitDecoder( |
158 const char* extensions, | 158 const char* extensions, |
| 159 const char* gl_version, |
159 bool has_alpha, | 160 bool has_alpha, |
160 bool has_depth, | 161 bool has_depth, |
161 bool has_stencil, | 162 bool has_stencil, |
162 bool request_alpha, | 163 bool request_alpha, |
163 bool request_depth, | 164 bool request_depth, |
164 bool request_stencil, | 165 bool request_stencil, |
165 bool bind_generates_resource); | 166 bool bind_generates_resource); |
166 | 167 |
167 void InitDecoderWithCommandLine( | 168 void InitDecoderWithCommandLine( |
168 const char* extensions, | 169 const char* extensions, |
| 170 const char* gl_version, |
169 bool has_alpha, | 171 bool has_alpha, |
170 bool has_depth, | 172 bool has_depth, |
171 bool has_stencil, | 173 bool has_stencil, |
172 bool request_alpha, | 174 bool request_alpha, |
173 bool request_depth, | 175 bool request_depth, |
174 bool request_stencil, | 176 bool request_stencil, |
175 bool bind_generates_resource, | 177 bool bind_generates_resource, |
176 const CommandLine* command_line); | 178 const CommandLine* command_line); |
177 | 179 |
178 const ContextGroup& group() const { | 180 const ContextGroup& group() const { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 static const GLenum kUniform2Type = GL_INT_VEC2; | 482 static const GLenum kUniform2Type = GL_INT_VEC2; |
481 static const GLenum kUniform3Type = GL_FLOAT_VEC3; | 483 static const GLenum kUniform3Type = GL_FLOAT_VEC3; |
482 static const GLenum kUniformSamplerExternalType = GL_SAMPLER_EXTERNAL_OES; | 484 static const GLenum kUniformSamplerExternalType = GL_SAMPLER_EXTERNAL_OES; |
483 static const GLenum kUniformCubemapType = GL_SAMPLER_CUBE; | 485 static const GLenum kUniformCubemapType = GL_SAMPLER_CUBE; |
484 static const GLint kInvalidUniformLocation = 30; | 486 static const GLint kInvalidUniformLocation = 30; |
485 static const GLint kBadUniformIndex = 1000; | 487 static const GLint kBadUniformIndex = 1000; |
486 | 488 |
487 // Use StrictMock to make 100% sure we know how GL will be called. | 489 // Use StrictMock to make 100% sure we know how GL will be called. |
488 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; | 490 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; |
489 scoped_refptr<gfx::GLSurfaceStub> surface_; | 491 scoped_refptr<gfx::GLSurfaceStub> surface_; |
490 scoped_refptr<gfx::GLContextStub> context_; | 492 scoped_refptr<gfx::GLContextStubWithExtensions> context_; |
491 scoped_ptr<GLES2Decoder> mock_decoder_; | 493 scoped_ptr<GLES2Decoder> mock_decoder_; |
492 scoped_ptr<GLES2Decoder> decoder_; | 494 scoped_ptr<GLES2Decoder> decoder_; |
493 MemoryTracker* memory_tracker_; | 495 MemoryTracker* memory_tracker_; |
494 | 496 |
495 GLuint client_buffer_id_; | 497 GLuint client_buffer_id_; |
496 GLuint client_framebuffer_id_; | 498 GLuint client_framebuffer_id_; |
497 GLuint client_program_id_; | 499 GLuint client_program_id_; |
498 GLuint client_renderbuffer_id_; | 500 GLuint client_renderbuffer_id_; |
499 GLuint client_shader_id_; | 501 GLuint client_shader_id_; |
500 GLuint client_texture_id_; | 502 GLuint client_texture_id_; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 protected: | 559 protected: |
558 virtual void SetUp() OVERRIDE; | 560 virtual void SetUp() OVERRIDE; |
559 virtual void TearDown() OVERRIDE; | 561 virtual void TearDown() OVERRIDE; |
560 | 562 |
561 }; | 563 }; |
562 | 564 |
563 } // namespace gles2 | 565 } // namespace gles2 |
564 } // namespace gpu | 566 } // namespace gpu |
565 | 567 |
566 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 568 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
OLD | NEW |