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> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_split.h" | 16 #include "base/strings/string_split.h" |
17 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 17 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
18 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 18 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
19 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 19 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
20 #include "gpu/command_buffer/service/context_group.h" | 20 #include "gpu/command_buffer/service/context_group.h" |
21 #include "gpu/command_buffer/service/logger.h" | 21 #include "gpu/command_buffer/service/logger.h" |
22 #include "gpu/command_buffer/service/mailbox_manager.h" | 22 #include "gpu/command_buffer/service/mailbox_manager.h" |
23 #include "gpu/command_buffer/service/program_manager.h" | 23 #include "gpu/command_buffer/service/program_manager.h" |
24 #include "gpu/command_buffer/service/test_helper.h" | 24 #include "gpu/command_buffer/service/test_helper.h" |
25 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 25 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
27 #include "ui/gl/gl_implementation.h" | |
28 #include "ui/gl/gl_mock.h" | 27 #include "ui/gl/gl_mock.h" |
29 #include "ui/gl/init/gl_factory.h" | 28 #include "ui/gl/init/gl_factory.h" |
30 #include "ui/gl/test/gl_surface_test_support.h" | 29 #include "ui/gl/test/gl_surface_test_support.h" |
31 | 30 |
32 using ::gl::MockGLInterface; | 31 using ::gl::MockGLInterface; |
33 using ::testing::_; | 32 using ::testing::_; |
34 using ::testing::AnyNumber; | 33 using ::testing::AnyNumber; |
35 using ::testing::AtMost; | 34 using ::testing::AtMost; |
36 using ::testing::DoAll; | 35 using ::testing::DoAll; |
37 using ::testing::InSequence; | 36 using ::testing::InSequence; |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 .Times(1) | 386 .Times(1) |
388 .RetiresOnSaturation(); | 387 .RetiresOnSaturation(); |
389 } | 388 } |
390 | 389 |
391 if (group_->feature_info()->gl_version_info().IsAtLeastGL(3, 2)) { | 390 if (group_->feature_info()->gl_version_info().IsAtLeastGL(3, 2)) { |
392 EXPECT_CALL(*gl_, Enable(GL_TEXTURE_CUBE_MAP_SEAMLESS)) | 391 EXPECT_CALL(*gl_, Enable(GL_TEXTURE_CUBE_MAP_SEAMLESS)) |
393 .Times(1) | 392 .Times(1) |
394 .RetiresOnSaturation(); | 393 .RetiresOnSaturation(); |
395 } | 394 } |
396 | 395 |
| 396 if (group_->feature_info()->gl_version_info().is_es) { |
| 397 EXPECT_CALL( |
| 398 *gl_, GetShaderPrecisionFormat(GL_FRAGMENT_SHADER, GL_HIGH_FLOAT, _, _)) |
| 399 .RetiresOnSaturation(); |
| 400 } |
| 401 |
397 static GLint max_viewport_dims[] = { | 402 static GLint max_viewport_dims[] = { |
398 kMaxViewportWidth, | 403 kMaxViewportWidth, |
399 kMaxViewportHeight | 404 kMaxViewportHeight |
400 }; | 405 }; |
401 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_VIEWPORT_DIMS, _)) | 406 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_VIEWPORT_DIMS, _)) |
402 .WillOnce(SetArrayArgument<1>( | 407 .WillOnce(SetArrayArgument<1>( |
403 max_viewport_dims, max_viewport_dims + arraysize(max_viewport_dims))) | 408 max_viewport_dims, max_viewport_dims + arraysize(max_viewport_dims))) |
404 .RetiresOnSaturation(); | 409 .RetiresOnSaturation(); |
405 | 410 |
406 static GLfloat line_width_range[] = { 1.0f, 2.0f }; | 411 static GLfloat line_width_range[] = { 1.0f, 2.0f }; |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 .RetiresOnSaturation(); | 1484 .RetiresOnSaturation(); |
1480 | 1485 |
1481 EXPECT_CALL(*gl_, VertexAttribDivisorANGLE(attrib, _)) | 1486 EXPECT_CALL(*gl_, VertexAttribDivisorANGLE(attrib, _)) |
1482 .Times(testing::AtMost(1)) | 1487 .Times(testing::AtMost(1)) |
1483 .RetiresOnSaturation(); | 1488 .RetiresOnSaturation(); |
1484 | 1489 |
1485 EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, _)) | 1490 EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, _)) |
1486 .Times(1) | 1491 .Times(1) |
1487 .RetiresOnSaturation(); | 1492 .RetiresOnSaturation(); |
1488 | 1493 |
1489 if (attrib != 0 || | 1494 if (attrib != 0 || group_->feature_info()->gl_version_info().is_es) { |
1490 gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2) { | |
1491 // TODO(bajones): Not sure if I can tell which of these will be called | 1495 // TODO(bajones): Not sure if I can tell which of these will be called |
1492 EXPECT_CALL(*gl_, EnableVertexAttribArray(attrib)) | 1496 EXPECT_CALL(*gl_, EnableVertexAttribArray(attrib)) |
1493 .Times(testing::AtMost(1)) | 1497 .Times(testing::AtMost(1)) |
1494 .RetiresOnSaturation(); | 1498 .RetiresOnSaturation(); |
1495 | 1499 |
1496 EXPECT_CALL(*gl_, DisableVertexAttribArray(attrib)) | 1500 EXPECT_CALL(*gl_, DisableVertexAttribArray(attrib)) |
1497 .Times(testing::AtMost(1)) | 1501 .Times(testing::AtMost(1)) |
1498 .RetiresOnSaturation(); | 1502 .RetiresOnSaturation(); |
1499 } | 1503 } |
1500 } | 1504 } |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2110 SetupDefaultProgram(); | 2114 SetupDefaultProgram(); |
2111 } | 2115 } |
2112 | 2116 |
2113 // Include the auto-generated part of this file. We split this because it means | 2117 // Include the auto-generated part of this file. We split this because it means |
2114 // we can easily edit the non-auto generated parts right here in this file | 2118 // we can easily edit the non-auto generated parts right here in this file |
2115 // instead of having to edit some template or the code generator. | 2119 // instead of having to edit some template or the code generator. |
2116 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 2120 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
2117 | 2121 |
2118 } // namespace gles2 | 2122 } // namespace gles2 |
2119 } // namespace gpu | 2123 } // namespace gpu |
OLD | NEW |