1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_H_ 7 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 10 #include "gpu/command_buffer/service/buffer_manager.h" 11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 12 #include "gpu/command_buffer/service/context_group.h" 13 #include "gpu/command_buffer/service/framebuffer_manager.h" 14 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 15 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 16 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 17 #include "gpu/command_buffer/service/program_manager.h" 18 #include "gpu/command_buffer/service/query_manager.h" 19 #include "gpu/command_buffer/service/renderbuffer_manager.h" 20 #include "gpu/command_buffer/service/shader_manager.h" 21 #include "gpu/command_buffer/service/test_helper.h" 22 #include "gpu/command_buffer/service/texture_manager.h" 23 #include "gpu/command_buffer/service/vertex_array_manager.h" 24 #include "testing/gtest/include/gtest/gtest.h" 25 #include "ui/gl/gl_context_stub_with_extensions.h" 26 #include "ui/gl/gl_mock.h" 27 #include "ui/gl/gl_surface_stub.h" 28 29 namespace base { 30 class CommandLine; 31 } 32 33 namespace gpu { 34 namespace gles2 { 35 36 class GLES2DecoderTest : public GLES2DecoderTestBase { 37 public: GLES2DecoderTest()38 GLES2DecoderTest() {} 39 40 protected: 41 void CheckReadPixelsOutOfRange(GLint in_read_x, 42 GLint in_read_y, 43 GLsizei in_read_width, 44 GLsizei in_read_height, 45 bool init); 46 }; 47 48 class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase { 49 public: GLES2DecoderWithShaderTest()50 GLES2DecoderWithShaderTest() : GLES2DecoderWithShaderTestBase() {} 51 52 void CheckTextureChangesMarkFBOAsNotComplete(bool bound_fbo); 53 void CheckRenderbufferChangesMarkFBOAsNotComplete(bool bound_fbo); 54 }; 55 56 class GLES2DecoderRGBBackbufferTest : public GLES2DecoderWithShaderTest { 57 public: GLES2DecoderRGBBackbufferTest()58 GLES2DecoderRGBBackbufferTest() {} 59 60 virtual void SetUp(); 61 }; 62 63 class GLES2DecoderManualInitTest : public GLES2DecoderWithShaderTest { 64 public: GLES2DecoderManualInitTest()65 GLES2DecoderManualInitTest() {} 66 67 // Override default setup so nothing gets setup. 68 virtual void SetUp(); 69 70 void DirtyStateMaskTest(GLuint color_bits, 71 bool depth_mask, 72 GLuint front_stencil_mask, 73 GLuint back_stencil_mask); 74 void EnableDisableTest(GLenum cap, bool enable, bool expect_set); 75 }; 76 77 } // namespace gles2 78 } // namespace gpu 79 80 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_H_ 81