OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include "app/gfx/gl/gl_mock.h" | 7 #include "app/gfx/gl/gl_mock.h" |
8 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 if (valid) { | 65 if (valid) { |
66 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 66 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
67 DoTexImage2D( | 67 DoTexImage2D( |
68 GL_TEXTURE_2D, 2, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 68 GL_TEXTURE_2D, 2, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
69 0, 0); | 69 0, 0); |
70 } | 70 } |
71 }; | 71 }; |
72 | 72 |
73 template <> | 73 template <> |
74 void GLES2DecoderTestBase::SpecializedSetup<FramebufferRenderbuffer, 0>( | 74 void GLES2DecoderTestBase::SpecializedSetup<FramebufferRenderbuffer, 0>( |
75 bool /* valid */) { | 75 bool valid) { |
76 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 76 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
77 kServiceFramebufferId); | 77 kServiceFramebufferId); |
| 78 if (valid) { |
| 79 // Return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT so the code |
| 80 // doesn't try to clear the buffer. That is tested else where. |
| 81 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 82 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
| 83 .RetiresOnSaturation(); |
| 84 } |
78 }; | 85 }; |
79 | 86 |
80 template <> | 87 template <> |
81 void GLES2DecoderTestBase::SpecializedSetup<FramebufferTexture2D, 0>( | 88 void GLES2DecoderTestBase::SpecializedSetup<FramebufferTexture2D, 0>( |
82 bool /* valid */) { | 89 bool valid) { |
83 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 90 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
84 kServiceFramebufferId); | 91 kServiceFramebufferId); |
| 92 if (valid) { |
| 93 // Return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT so the code |
| 94 // doesn't try to clear the buffer. That is tested else where. |
| 95 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 96 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
| 97 .RetiresOnSaturation(); |
| 98 } |
85 }; | 99 }; |
86 | 100 |
87 template <> | 101 template <> |
88 void GLES2DecoderTestBase::SpecializedSetup<GetFramebufferAttachmentParameteriv, | 102 void GLES2DecoderTestBase::SpecializedSetup<GetFramebufferAttachmentParameteriv, |
89 0>(bool /* valid */) { | 103 0>(bool /* valid */) { |
90 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 104 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
91 kServiceFramebufferId); | 105 kServiceFramebufferId); |
92 }; | 106 }; |
93 | 107 |
94 template <> | 108 template <> |
95 void GLES2DecoderTestBase::SpecializedSetup<GetRenderbufferParameteriv, 0>( | 109 void GLES2DecoderTestBase::SpecializedSetup<GetRenderbufferParameteriv, 0>( |
96 bool /* valid */) { | 110 bool /* valid */) { |
97 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 111 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
98 kServiceRenderbufferId); | 112 kServiceRenderbufferId); |
99 }; | 113 }; |
100 | 114 |
101 template <> | 115 template <> |
102 void GLES2DecoderTestBase::SpecializedSetup<GetProgramInfoLog, 0>( | 116 void GLES2DecoderTestBase::SpecializedSetup<GetProgramInfoLog, 0>( |
103 bool /* valid */) { | 117 bool /* valid */) { |
104 ProgramManager::ProgramInfo* info = GetProgramInfo(client_program_id_); | 118 ProgramManager::ProgramInfo* info = GetProgramInfo(client_program_id_); |
105 info->set_log_info("hello"); | 119 info->set_log_info("hello"); |
106 }; | 120 }; |
107 | 121 |
108 | 122 |
109 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h" | 123 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h" |
110 | 124 |
111 } // namespace gles2 | 125 } // namespace gles2 |
112 } // namespace gpu | 126 } // namespace gpu |
113 | 127 |
OLD | NEW |