| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2114 DoBindRenderbuffer( | 2114 DoBindRenderbuffer( |
| 2115 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); | 2115 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); |
| 2116 DoRenderbufferStorage( | 2116 DoRenderbufferStorage( |
| 2117 GL_RENDERBUFFER, GL_RGBA8I, GL_RGBA8I, 1, 1, GL_NO_ERROR); | 2117 GL_RENDERBUFFER, GL_RGBA8I, GL_RGBA8I, 1, 1, GL_NO_ERROR); |
| 2118 DoFramebufferRenderbuffer( | 2118 DoFramebufferRenderbuffer( |
| 2119 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, | 2119 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 2120 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 2120 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
| 2121 | 2121 |
| 2122 // TODO(zmo): Set up expectations for the path where the attachment isn't | 2122 // TODO(zmo): Set up expectations for the path where the attachment isn't |
| 2123 // marked as cleared. | 2123 // marked as cleared. |
| 2124 Framebuffer* framebuffer = | 2124 Framebuffer* framebuffer = GetFramebuffer(client_framebuffer_id_); |
| 2125 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_); | |
| 2126 framebuffer->MarkAttachmentAsCleared( | 2125 framebuffer->MarkAttachmentAsCleared( |
| 2127 group().renderbuffer_manager(), nullptr, GL_COLOR_ATTACHMENT0, true); | 2126 group().renderbuffer_manager(), nullptr, GL_COLOR_ATTACHMENT0, true); |
| 2128 | 2127 |
| 2129 ClearBufferivImmediate& cmd = | 2128 ClearBufferivImmediate& cmd = |
| 2130 *GetImmediateAs<ClearBufferivImmediate>(); | 2129 *GetImmediateAs<ClearBufferivImmediate>(); |
| 2131 GLint temp[4] = { 0 }; | 2130 GLint temp[4] = { 0 }; |
| 2132 cmd.Init(GL_COLOR, 0, &temp[0]); | 2131 cmd.Init(GL_COLOR, 0, &temp[0]); |
| 2133 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER)) | 2132 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER)) |
| 2134 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 2133 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 2135 .RetiresOnSaturation(); | 2134 .RetiresOnSaturation(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2146 DoBindRenderbuffer( | 2145 DoBindRenderbuffer( |
| 2147 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); | 2146 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); |
| 2148 DoRenderbufferStorage( | 2147 DoRenderbufferStorage( |
| 2149 GL_RENDERBUFFER, GL_RGBA8UI, GL_RGBA8UI, 1, 1, GL_NO_ERROR); | 2148 GL_RENDERBUFFER, GL_RGBA8UI, GL_RGBA8UI, 1, 1, GL_NO_ERROR); |
| 2150 DoFramebufferRenderbuffer( | 2149 DoFramebufferRenderbuffer( |
| 2151 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, | 2150 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 2152 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 2151 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
| 2153 | 2152 |
| 2154 // TODO(zmo): Set up expectations for the path where the attachment isn't | 2153 // TODO(zmo): Set up expectations for the path where the attachment isn't |
| 2155 // marked as cleared. | 2154 // marked as cleared. |
| 2156 Framebuffer* framebuffer = | 2155 Framebuffer* framebuffer = GetFramebuffer(client_framebuffer_id_); |
| 2157 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_); | |
| 2158 framebuffer->MarkAttachmentAsCleared( | 2156 framebuffer->MarkAttachmentAsCleared( |
| 2159 group().renderbuffer_manager(), nullptr, GL_COLOR_ATTACHMENT0, true); | 2157 group().renderbuffer_manager(), nullptr, GL_COLOR_ATTACHMENT0, true); |
| 2160 | 2158 |
| 2161 ClearBufferuivImmediate& cmd = | 2159 ClearBufferuivImmediate& cmd = |
| 2162 *GetImmediateAs<ClearBufferuivImmediate>(); | 2160 *GetImmediateAs<ClearBufferuivImmediate>(); |
| 2163 GLuint temp[4] = { 0u }; | 2161 GLuint temp[4] = { 0u }; |
| 2164 cmd.Init(GL_COLOR, 0, &temp[0]); | 2162 cmd.Init(GL_COLOR, 0, &temp[0]); |
| 2165 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER)) | 2163 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER)) |
| 2166 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 2164 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 2167 .RetiresOnSaturation(); | 2165 .RetiresOnSaturation(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2179 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); | 2177 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); |
| 2180 DoRenderbufferStorage( | 2178 DoRenderbufferStorage( |
| 2181 GL_RENDERBUFFER, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, | 2179 GL_RENDERBUFFER, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, |
| 2182 1, 1, GL_NO_ERROR); | 2180 1, 1, GL_NO_ERROR); |
| 2183 DoFramebufferRenderbuffer( | 2181 DoFramebufferRenderbuffer( |
| 2184 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, | 2182 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, |
| 2185 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 2183 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
| 2186 | 2184 |
| 2187 // TODO(zmo): Set up expectations for the path where the attachment isn't | 2185 // TODO(zmo): Set up expectations for the path where the attachment isn't |
| 2188 // marked as cleared. | 2186 // marked as cleared. |
| 2189 Framebuffer* framebuffer = | 2187 Framebuffer* framebuffer = GetFramebuffer(client_framebuffer_id_); |
| 2190 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_); | |
| 2191 framebuffer->MarkAttachmentAsCleared( | 2188 framebuffer->MarkAttachmentAsCleared( |
| 2192 group().renderbuffer_manager(), nullptr, GL_DEPTH_ATTACHMENT, true); | 2189 group().renderbuffer_manager(), nullptr, GL_DEPTH_ATTACHMENT, true); |
| 2193 | 2190 |
| 2194 Enable cmd_enable; | 2191 Enable cmd_enable; |
| 2195 cmd_enable.Init(GL_DEPTH_TEST); | 2192 cmd_enable.Init(GL_DEPTH_TEST); |
| 2196 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); | 2193 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); |
| 2197 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2194 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2198 | 2195 |
| 2199 ClearBufferfvImmediate& cmd = | 2196 ClearBufferfvImmediate& cmd = |
| 2200 *GetImmediateAs<ClearBufferfvImmediate>(); | 2197 *GetImmediateAs<ClearBufferfvImmediate>(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2217 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); | 2214 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); |
| 2218 DoRenderbufferStorage( | 2215 DoRenderbufferStorage( |
| 2219 GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, | 2216 GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, |
| 2220 1, 1, GL_NO_ERROR); | 2217 1, 1, GL_NO_ERROR); |
| 2221 DoFramebufferRenderbuffer( | 2218 DoFramebufferRenderbuffer( |
| 2222 GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, | 2219 GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, |
| 2223 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 2220 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
| 2224 | 2221 |
| 2225 // TODO(zmo): Set up expectations for the path where the attachment isn't | 2222 // TODO(zmo): Set up expectations for the path where the attachment isn't |
| 2226 // marked as cleared. | 2223 // marked as cleared. |
| 2227 Framebuffer* framebuffer = | 2224 Framebuffer* framebuffer = GetFramebuffer(client_framebuffer_id_); |
| 2228 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_); | |
| 2229 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, | 2225 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, |
| 2230 GL_DEPTH_ATTACHMENT, true); | 2226 GL_DEPTH_ATTACHMENT, true); |
| 2231 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, | 2227 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, |
| 2232 GL_STENCIL_ATTACHMENT, true); | 2228 GL_STENCIL_ATTACHMENT, true); |
| 2233 | 2229 |
| 2234 Enable cmd_enable; | 2230 Enable cmd_enable; |
| 2235 cmd_enable.Init(GL_STENCIL_TEST); | 2231 cmd_enable.Init(GL_STENCIL_TEST); |
| 2236 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); | 2232 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); |
| 2237 cmd_enable.Init(GL_DEPTH_TEST); | 2233 cmd_enable.Init(GL_DEPTH_TEST); |
| 2238 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); | 2234 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3122 .Times(0) | 3118 .Times(0) |
| 3123 .RetiresOnSaturation(); | 3119 .RetiresOnSaturation(); |
| 3124 CopyTexImage2D cmd; | 3120 CopyTexImage2D cmd; |
| 3125 cmd.Init(target, level, internal_format, 0, 0, width, height); | 3121 cmd.Init(target, level, internal_format, 0, 0, width, height); |
| 3126 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 3122 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 3127 EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError()); | 3123 EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError()); |
| 3128 } | 3124 } |
| 3129 | 3125 |
| 3130 void GLES2DecoderWithShaderTest::CheckRenderbufferChangesMarkFBOAsNotComplete( | 3126 void GLES2DecoderWithShaderTest::CheckRenderbufferChangesMarkFBOAsNotComplete( |
| 3131 bool bound_fbo) { | 3127 bool bound_fbo) { |
| 3132 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); | 3128 FramebufferManager* framebuffer_manager = GetFramebufferManager(); |
| 3133 SetupTexture(); | 3129 SetupTexture(); |
| 3134 DoBindRenderbuffer( | 3130 DoBindRenderbuffer( |
| 3135 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); | 3131 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); |
| 3136 DoBindFramebuffer( | 3132 DoBindFramebuffer( |
| 3137 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); | 3133 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); |
| 3138 DoRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); | 3134 DoRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); |
| 3139 DoFramebufferRenderbuffer(GL_FRAMEBUFFER, | 3135 DoFramebufferRenderbuffer(GL_FRAMEBUFFER, |
| 3140 GL_COLOR_ATTACHMENT0, | 3136 GL_COLOR_ATTACHMENT0, |
| 3141 GL_RENDERBUFFER, | 3137 GL_RENDERBUFFER, |
| 3142 client_renderbuffer_id_, | 3138 client_renderbuffer_id_, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3182 CheckRenderbufferChangesMarkFBOAsNotComplete(true); | 3178 CheckRenderbufferChangesMarkFBOAsNotComplete(true); |
| 3183 } | 3179 } |
| 3184 | 3180 |
| 3185 TEST_P(GLES2DecoderWithShaderTest, | 3181 TEST_P(GLES2DecoderWithShaderTest, |
| 3186 RenderbufferChangesMarkFBOAsNotCompleteUnboundFBO) { | 3182 RenderbufferChangesMarkFBOAsNotCompleteUnboundFBO) { |
| 3187 CheckRenderbufferChangesMarkFBOAsNotComplete(false); | 3183 CheckRenderbufferChangesMarkFBOAsNotComplete(false); |
| 3188 } | 3184 } |
| 3189 | 3185 |
| 3190 void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete( | 3186 void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete( |
| 3191 bool bound_fbo) { | 3187 bool bound_fbo) { |
| 3192 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); | 3188 FramebufferManager* framebuffer_manager = GetFramebufferManager(); |
| 3193 const GLuint kFBOClientTextureId = 4100; | 3189 const GLuint kFBOClientTextureId = 4100; |
| 3194 const GLuint kFBOServiceTextureId = 4101; | 3190 const GLuint kFBOServiceTextureId = 4101; |
| 3195 | 3191 |
| 3196 // Register a texture id. | 3192 // Register a texture id. |
| 3197 EXPECT_CALL(*gl_, GenTextures(_, _)) | 3193 EXPECT_CALL(*gl_, GenTextures(_, _)) |
| 3198 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId)) | 3194 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId)) |
| 3199 .RetiresOnSaturation(); | 3195 .RetiresOnSaturation(); |
| 3200 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); | 3196 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); |
| 3201 | 3197 |
| 3202 SetupTexture(); | 3198 SetupTexture(); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3458 SetupTexture(); | 3454 SetupTexture(); |
| 3459 DoBindFramebuffer( | 3455 DoBindFramebuffer( |
| 3460 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); | 3456 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); |
| 3461 DoFramebufferTexture2D(GL_FRAMEBUFFER, | 3457 DoFramebufferTexture2D(GL_FRAMEBUFFER, |
| 3462 GL_COLOR_ATTACHMENT0, | 3458 GL_COLOR_ATTACHMENT0, |
| 3463 GL_TEXTURE_2D, | 3459 GL_TEXTURE_2D, |
| 3464 client_texture_id_, | 3460 client_texture_id_, |
| 3465 kServiceTextureId, | 3461 kServiceTextureId, |
| 3466 0, | 3462 0, |
| 3467 GL_NO_ERROR); | 3463 GL_NO_ERROR); |
| 3468 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); | 3464 FramebufferManager* framebuffer_manager = GetFramebufferManager(); |
| 3469 Framebuffer* framebuffer = | 3465 Framebuffer* framebuffer = |
| 3470 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); | 3466 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); |
| 3471 EXPECT_TRUE(framebuffer->IsCleared()); | 3467 EXPECT_TRUE(framebuffer->IsCleared()); |
| 3472 | 3468 |
| 3473 EXPECT_CALL(*gl_, DiscardFramebufferEXT(target, count, _)) | 3469 EXPECT_CALL(*gl_, DiscardFramebufferEXT(target, count, _)) |
| 3474 .Times(1) | 3470 .Times(1) |
| 3475 .RetiresOnSaturation(); | 3471 .RetiresOnSaturation(); |
| 3476 DiscardFramebufferEXTImmediate& cmd = | 3472 DiscardFramebufferEXTImmediate& cmd = |
| 3477 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); | 3473 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); |
| 3478 cmd.Init(target, count, attachments); | 3474 cmd.Init(target, count, attachments); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3564 SetupTexture(); | 3560 SetupTexture(); |
| 3565 DoBindFramebuffer( | 3561 DoBindFramebuffer( |
| 3566 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); | 3562 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); |
| 3567 DoFramebufferTexture2D(GL_FRAMEBUFFER, | 3563 DoFramebufferTexture2D(GL_FRAMEBUFFER, |
| 3568 GL_COLOR_ATTACHMENT0, | 3564 GL_COLOR_ATTACHMENT0, |
| 3569 GL_TEXTURE_2D, | 3565 GL_TEXTURE_2D, |
| 3570 client_texture_id_, | 3566 client_texture_id_, |
| 3571 kServiceTextureId, | 3567 kServiceTextureId, |
| 3572 0, | 3568 0, |
| 3573 GL_NO_ERROR); | 3569 GL_NO_ERROR); |
| 3574 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); | 3570 FramebufferManager* framebuffer_manager = GetFramebufferManager(); |
| 3575 Framebuffer* framebuffer = | 3571 Framebuffer* framebuffer = |
| 3576 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); | 3572 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); |
| 3577 EXPECT_TRUE(framebuffer->IsCleared()); | 3573 EXPECT_TRUE(framebuffer->IsCleared()); |
| 3578 | 3574 |
| 3579 EXPECT_CALL(*gl_, InvalidateFramebuffer(target, count, _)).Times(0); | 3575 EXPECT_CALL(*gl_, InvalidateFramebuffer(target, count, _)).Times(0); |
| 3580 DiscardFramebufferEXTImmediate& cmd = | 3576 DiscardFramebufferEXTImmediate& cmd = |
| 3581 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); | 3577 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); |
| 3582 cmd.Init(target, count, attachments); | 3578 cmd.Init(target, count, attachments); |
| 3583 | 3579 |
| 3584 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(attachments))); | 3580 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(attachments))); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 3614 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 3610 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 3615 kSharedMemoryId, kSharedMemoryOffset); | 3611 kSharedMemoryId, kSharedMemoryOffset); |
| 3616 DoFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, | 3612 DoFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, |
| 3617 GL_COLOR_ATTACHMENT0, | 3613 GL_COLOR_ATTACHMENT0, |
| 3618 GL_TEXTURE_2D, | 3614 GL_TEXTURE_2D, |
| 3619 client_texture_id_ + 1, | 3615 client_texture_id_ + 1, |
| 3620 kServiceTextureId + 1, | 3616 kServiceTextureId + 1, |
| 3621 0, | 3617 0, |
| 3622 GL_NO_ERROR); | 3618 GL_NO_ERROR); |
| 3623 | 3619 |
| 3624 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); | 3620 FramebufferManager* framebuffer_manager = GetFramebufferManager(); |
| 3625 Framebuffer* framebuffer = | 3621 Framebuffer* framebuffer = |
| 3626 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); | 3622 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); |
| 3627 EXPECT_TRUE(framebuffer->IsCleared()); | 3623 EXPECT_TRUE(framebuffer->IsCleared()); |
| 3628 Framebuffer* other_framebuffer = | 3624 Framebuffer* other_framebuffer = |
| 3629 framebuffer_manager->GetFramebuffer(client_framebuffer_id_ + 1); | 3625 framebuffer_manager->GetFramebuffer(client_framebuffer_id_ + 1); |
| 3630 EXPECT_TRUE(other_framebuffer->IsCleared()); | 3626 EXPECT_TRUE(other_framebuffer->IsCleared()); |
| 3631 | 3627 |
| 3632 EXPECT_CALL(*gl_, InvalidateFramebuffer(target, count, _)) | 3628 EXPECT_CALL(*gl_, InvalidateFramebuffer(target, count, _)) |
| 3633 .Times(1) | 3629 .Times(1) |
| 3634 .RetiresOnSaturation(); | 3630 .RetiresOnSaturation(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3698 false); // stencil enabled | 3694 false); // stencil enabled |
| 3699 | 3695 |
| 3700 EXPECT_CALL(*gl_, Clear(GL_COLOR_BUFFER_BIT)).Times(1).RetiresOnSaturation(); | 3696 EXPECT_CALL(*gl_, Clear(GL_COLOR_BUFFER_BIT)).Times(1).RetiresOnSaturation(); |
| 3701 | 3697 |
| 3702 Clear clear_cmd; | 3698 Clear clear_cmd; |
| 3703 clear_cmd.Init(GL_COLOR_BUFFER_BIT); | 3699 clear_cmd.Init(GL_COLOR_BUFFER_BIT); |
| 3704 EXPECT_EQ(error::kNoError, ExecuteCmd(clear_cmd)); | 3700 EXPECT_EQ(error::kNoError, ExecuteCmd(clear_cmd)); |
| 3705 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3701 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3706 | 3702 |
| 3707 // Check that framebuffer is cleared and complete. | 3703 // Check that framebuffer is cleared and complete. |
| 3708 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); | 3704 FramebufferManager* framebuffer_manager = GetFramebufferManager(); |
| 3709 Framebuffer* framebuffer = | 3705 Framebuffer* framebuffer = |
| 3710 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); | 3706 framebuffer_manager->GetFramebuffer(client_framebuffer_id_); |
| 3711 EXPECT_TRUE(framebuffer->IsCleared()); | 3707 EXPECT_TRUE(framebuffer->IsCleared()); |
| 3712 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); | 3708 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); |
| 3713 | 3709 |
| 3714 // Check that Discard GL_COLOR_ATTACHMENT0, sets the attachment as uncleared | 3710 // Check that Discard GL_COLOR_ATTACHMENT0, sets the attachment as uncleared |
| 3715 // and the framebuffer as incomplete. | 3711 // and the framebuffer as incomplete. |
| 3716 EXPECT_TRUE( | 3712 EXPECT_TRUE( |
| 3717 gl::MockGLInterface::GetGLProcAddress("glDiscardFramebufferEXT") == | 3713 gl::MockGLInterface::GetGLProcAddress("glDiscardFramebufferEXT") == |
| 3718 reinterpret_cast<gl::GLFunctionPointerType>( | 3714 reinterpret_cast<gl::GLFunctionPointerType>( |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3842 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); | 3838 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); |
| 3843 DoBindRenderbuffer( | 3839 DoBindRenderbuffer( |
| 3844 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); | 3840 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); |
| 3845 DoRenderbufferStorage( | 3841 DoRenderbufferStorage( |
| 3846 GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, | 3842 GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, |
| 3847 1, 1, GL_NO_ERROR); | 3843 1, 1, GL_NO_ERROR); |
| 3848 DoFramebufferRenderbuffer( | 3844 DoFramebufferRenderbuffer( |
| 3849 GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, | 3845 GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, |
| 3850 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 3846 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
| 3851 | 3847 |
| 3852 Framebuffer* framebuffer = | 3848 Framebuffer* framebuffer = GetFramebuffer(client_framebuffer_id_); |
| 3853 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_); | |
| 3854 ASSERT_TRUE(framebuffer); | 3849 ASSERT_TRUE(framebuffer); |
| 3855 ASSERT_FALSE(framebuffer->GetAttachment(GL_DEPTH_STENCIL_ATTACHMENT)); | 3850 ASSERT_FALSE(framebuffer->GetAttachment(GL_DEPTH_STENCIL_ATTACHMENT)); |
| 3856 ASSERT_TRUE(framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT)); | 3851 ASSERT_TRUE(framebuffer->GetAttachment(GL_DEPTH_ATTACHMENT)); |
| 3857 ASSERT_TRUE(framebuffer->GetAttachment(GL_STENCIL_ATTACHMENT)); | 3852 ASSERT_TRUE(framebuffer->GetAttachment(GL_STENCIL_ATTACHMENT)); |
| 3858 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, | 3853 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, |
| 3859 GL_DEPTH_ATTACHMENT, true); | 3854 GL_DEPTH_ATTACHMENT, true); |
| 3860 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, | 3855 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, |
| 3861 GL_STENCIL_ATTACHMENT, true); | 3856 GL_STENCIL_ATTACHMENT, true); |
| 3862 EXPECT_TRUE(framebuffer->IsCleared()); | 3857 EXPECT_TRUE(framebuffer->IsCleared()); |
| 3863 | 3858 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4137 INSTANTIATE_TEST_CASE_P(Service, | 4132 INSTANTIATE_TEST_CASE_P(Service, |
| 4138 GLES2DecoderTestWithDrawRectangle, | 4133 GLES2DecoderTestWithDrawRectangle, |
| 4139 ::testing::Bool()); | 4134 ::testing::Bool()); |
| 4140 | 4135 |
| 4141 // TODO(gman): PixelStorei | 4136 // TODO(gman): PixelStorei |
| 4142 | 4137 |
| 4143 // TODO(gman): SwapBuffers | 4138 // TODO(gman): SwapBuffers |
| 4144 | 4139 |
| 4145 } // namespace gles2 | 4140 } // namespace gles2 |
| 4146 } // namespace gpu | 4141 } // namespace gpu |
| OLD | NEW |