Chromium Code Reviews| 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 568 EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[1])) | 568 EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[1])) |
| 569 .Times(1) | 569 .Times(1) |
| 570 .RetiresOnSaturation(); | 570 .RetiresOnSaturation(); |
| 571 EXPECT_CALL(*gl, FramebufferTexture2DEXT(GL_FRAMEBUFFER, | 571 EXPECT_CALL(*gl, FramebufferTexture2DEXT(GL_FRAMEBUFFER, |
| 572 GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tx_ids[1], 0)) | 572 GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tx_ids[1], 0)) |
| 573 .Times(1) | 573 .Times(1) |
| 574 .RetiresOnSaturation(); | 574 .RetiresOnSaturation(); |
| 575 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 575 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 576 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 576 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 577 .RetiresOnSaturation(); | 577 .RetiresOnSaturation(); |
| 578 GLenum status_rgba = GL_FRAMEBUFFER_COMPLETE; | |
|
qiankun
2016/10/21 10:51:04
See the actual executed code here:
https://cs.chro
| |
| 578 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, width, 0, | 579 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, width, 0, |
| 579 GL_RGB, GL_FLOAT, _)) | 580 GL_RGB, GL_FLOAT, _)) |
| 580 .Times(1) | 581 .Times(1) |
| 581 .RetiresOnSaturation(); | 582 .RetiresOnSaturation(); |
| 582 if (gl_info.is_es3) { | 583 if (gl_info.is_es3) { |
| 583 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 584 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 584 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) | 585 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
| 585 .RetiresOnSaturation(); | 586 .RetiresOnSaturation(); |
| 586 } else { | 587 } else { |
| 587 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 588 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 588 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 589 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 589 .RetiresOnSaturation(); | 590 .RetiresOnSaturation(); |
| 591 } | |
| 590 | 592 |
| 593 if (status_rgba == GL_FRAMEBUFFER_COMPLETE) { | |
|
Zhenyao Mo
2016/10/21 17:51:20
I don't think I understand the motivation of this
qiankun
2016/10/22 11:47:13
Yes, this always is true. I used it to align with
Zhenyao Mo
2016/10/25 22:41:14
I see. It's fine then.
| |
| 591 if (enable_es3 && gl_info.is_es3_capable) { | 594 if (enable_es3 && gl_info.is_es3_capable) { |
| 592 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, |
| 593 0, GL_RED, GL_FLOAT, _)) | 596 0, GL_RED, GL_FLOAT, _)) |
| 594 .Times(1) | 597 .Times(1) |
| 595 .RetiresOnSaturation(); | 598 .RetiresOnSaturation(); |
| 596 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 599 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 597 .Times(1) | 600 .Times(1) |
| 598 .RetiresOnSaturation(); | 601 .RetiresOnSaturation(); |
| 599 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, |
| 600 0, GL_RG, GL_FLOAT, _)) | 603 0, GL_RG, GL_FLOAT, _)) |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1202 GLenum precision, | 1205 GLenum precision, |
| 1203 bool static_use, | 1206 bool static_use, |
| 1204 const std::string& name) { | 1207 const std::string& name) { |
| 1205 return ConstructShaderVariable<sh::OutputVariable>( | 1208 return ConstructShaderVariable<sh::OutputVariable>( |
| 1206 type, array_size, precision, static_use, name); | 1209 type, array_size, precision, static_use, name); |
| 1207 } | 1210 } |
| 1208 | 1211 |
| 1209 } // namespace gles2 | 1212 } // namespace gles2 |
| 1210 } // namespace gpu | 1213 } // namespace gpu |
| 1211 | 1214 |
| OLD | NEW |