| 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // We initialize the ContextGroup with a MockGLES2Decoder so that | 225 // We initialize the ContextGroup with a MockGLES2Decoder so that |
| 226 // we can use the ContextGroup to figure out how the real GLES2Decoder | 226 // we can use the ContextGroup to figure out how the real GLES2Decoder |
| 227 // will initialize itself. | 227 // will initialize itself. |
| 228 mock_decoder_.reset(new MockGLES2Decoder()); | 228 mock_decoder_.reset(new MockGLES2Decoder()); |
| 229 | 229 |
| 230 // Install FakeDoCommands handler so we can use individual DoCommand() | 230 // Install FakeDoCommands handler so we can use individual DoCommand() |
| 231 // expectations. | 231 // expectations. |
| 232 EXPECT_CALL(*mock_decoder_, DoCommands(_, _, _, _)).WillRepeatedly( | 232 EXPECT_CALL(*mock_decoder_, DoCommands(_, _, _, _)).WillRepeatedly( |
| 233 Invoke(mock_decoder_.get(), &MockGLES2Decoder::FakeDoCommands)); | 233 Invoke(mock_decoder_.get(), &MockGLES2Decoder::FakeDoCommands)); |
| 234 | 234 |
| 235 EXPECT_CALL(*gl_, GetString(GL_VERSION)) |
| 236 .WillOnce(Return( |
| 237 reinterpret_cast<const uint8_t*>( |
| 238 normalized_init.gl_version.c_str()))) |
| 239 .RetiresOnSaturation(); |
| 240 std::unique_ptr<gl::GLVersionInfo> version_info; |
| 241 version_info.reset( |
| 242 new gl::GLVersionInfo(normalized_init.gl_version.c_str(), "", "")); |
| 243 |
| 244 if (version_info->IsAtLeastGL(3, 2) || version_info->IsAtLeastGLES(3, 0)) { |
| 245 EXPECT_CALL(*gl_, BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)) |
| 246 .Times(1) |
| 247 .RetiresOnSaturation(); |
| 248 } |
| 249 |
| 235 EXPECT_TRUE(group_->Initialize(mock_decoder_.get(), init.context_type, | 250 EXPECT_TRUE(group_->Initialize(mock_decoder_.get(), init.context_type, |
| 236 DisallowedFeatures())); | 251 DisallowedFeatures())); |
| 237 | 252 |
| 238 if (init.context_type == CONTEXT_TYPE_WEBGL2 || | 253 if (init.context_type == CONTEXT_TYPE_WEBGL2 || |
| 239 init.context_type == CONTEXT_TYPE_OPENGLES3) { | 254 init.context_type == CONTEXT_TYPE_OPENGLES3) { |
| 240 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _)) | 255 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _)) |
| 241 .WillOnce(SetArgPointee<1>(kMaxColorAttachments)) | 256 .WillOnce(SetArgPointee<1>(kMaxColorAttachments)) |
| 242 .RetiresOnSaturation(); | 257 .RetiresOnSaturation(); |
| 243 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _)) | 258 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _)) |
| 244 .WillOnce(SetArgPointee<1>(kMaxDrawBuffers)) | 259 .WillOnce(SetArgPointee<1>(kMaxDrawBuffers)) |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 SetupDefaultProgram(); | 2139 SetupDefaultProgram(); |
| 2125 } | 2140 } |
| 2126 | 2141 |
| 2127 // Include the auto-generated part of this file. We split this because it means | 2142 // Include the auto-generated part of this file. We split this because it means |
| 2128 // we can easily edit the non-auto generated parts right here in this file | 2143 // we can easily edit the non-auto generated parts right here in this file |
| 2129 // instead of having to edit some template or the code generator. | 2144 // instead of having to edit some template or the code generator. |
| 2130 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 2145 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
| 2131 | 2146 |
| 2132 } // namespace gles2 | 2147 } // namespace gles2 |
| 2133 } // namespace gpu | 2148 } // namespace gpu |
| OLD | NEW |