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/test_helper.h" | 5 #include "gpu/command_buffer/service/test_helper.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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | 487 void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( |
488 ::gl::MockGLInterface* gl, | 488 ::gl::MockGLInterface* gl, |
489 const char* extensions, | 489 const char* extensions, |
490 const char* gl_renderer, | 490 const char* gl_renderer, |
491 const char* gl_version, | 491 const char* gl_version, |
492 ContextType context_type) { | 492 ContextType context_type) { |
493 InSequence sequence; | 493 InSequence sequence; |
494 | 494 |
495 bool enable_es3 = context_type == CONTEXT_TYPE_WEBGL2 || | 495 bool enable_es3 = context_type == CONTEXT_TYPE_WEBGL2 || |
496 context_type == CONTEXT_TYPE_OPENGLES3; | 496 context_type == CONTEXT_TYPE_OPENGLES3; |
497 bool allow_float_buffers = context_type != CONTEXT_TYPE_WEBGL1; | |
498 | 497 |
499 EXPECT_CALL(*gl, GetString(GL_VERSION)) | 498 EXPECT_CALL(*gl, GetString(GL_VERSION)) |
500 .WillOnce(Return(reinterpret_cast<const uint8_t*>(gl_version))) | 499 .WillOnce(Return(reinterpret_cast<const uint8_t*>(gl_version))) |
501 .RetiresOnSaturation(); | 500 .RetiresOnSaturation(); |
502 | 501 |
503 // Persistent storage is needed for the split extension string. | 502 // Persistent storage is needed for the split extension string. |
504 split_extensions_.clear(); | 503 split_extensions_.clear(); |
505 if (extensions) { | 504 if (extensions) { |
506 split_extensions_ = base::SplitString( | 505 split_extensions_ = base::SplitString( |
507 extensions, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | 506 extensions, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 if (gl_info.is_es3) { | 584 if (gl_info.is_es3) { |
586 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 585 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
587 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) | 586 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
588 .RetiresOnSaturation(); | 587 .RetiresOnSaturation(); |
589 } else { | 588 } else { |
590 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 589 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
591 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 590 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
592 .RetiresOnSaturation(); | 591 .RetiresOnSaturation(); |
593 } | 592 } |
594 | 593 |
595 if (status_rgba == GL_FRAMEBUFFER_COMPLETE && allow_float_buffers) { | 594 if (status_rgba == GL_FRAMEBUFFER_COMPLETE && enable_es3) { |
596 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, | 595 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, |
597 0, GL_RED, GL_FLOAT, _)) | 596 0, GL_RED, GL_FLOAT, _)) |
598 .Times(1) | 597 .Times(1) |
599 .RetiresOnSaturation(); | 598 .RetiresOnSaturation(); |
600 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 599 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
601 .Times(1) | 600 .Times(1) |
602 .RetiresOnSaturation(); | 601 .RetiresOnSaturation(); |
603 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width, | 602 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width, |
604 0, GL_RG, GL_FLOAT, _)) | 603 0, GL_RG, GL_FLOAT, _)) |
605 .Times(1) | 604 .Times(1) |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 GLenum precision, | 1204 GLenum precision, |
1206 bool static_use, | 1205 bool static_use, |
1207 const std::string& name) { | 1206 const std::string& name) { |
1208 return ConstructShaderVariable<sh::OutputVariable>( | 1207 return ConstructShaderVariable<sh::OutputVariable>( |
1209 type, array_size, precision, static_use, name); | 1208 type, array_size, precision, static_use, name); |
1210 } | 1209 } |
1211 | 1210 |
1212 } // namespace gles2 | 1211 } // namespace gles2 |
1213 } // namespace gpu | 1212 } // namespace gpu |
1214 | 1213 |
OLD | NEW |