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 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2017 1, 1, GL_NO_ERROR); | 2017 1, 1, GL_NO_ERROR); |
2018 DoFramebufferRenderbuffer( | 2018 DoFramebufferRenderbuffer( |
2019 GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, | 2019 GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, |
2020 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); | 2020 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR); |
2021 | 2021 |
2022 // TODO(zmo): Set up expectations for the path where the attachment isn't | 2022 // TODO(zmo): Set up expectations for the path where the attachment isn't |
2023 // marked as cleared. | 2023 // marked as cleared. |
2024 Framebuffer* framebuffer = | 2024 Framebuffer* framebuffer = |
2025 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_); | 2025 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_); |
2026 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, | 2026 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, |
2027 GL_DEPTH_STENCIL_ATTACHMENT, true); | 2027 GL_DEPTH_ATTACHMENT, true); |
| 2028 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr, |
| 2029 GL_STENCIL_ATTACHMENT, true); |
2028 | 2030 |
2029 Enable cmd_enable; | 2031 Enable cmd_enable; |
2030 cmd_enable.Init(GL_STENCIL_TEST); | 2032 cmd_enable.Init(GL_STENCIL_TEST); |
2031 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); | 2033 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); |
2032 cmd_enable.Init(GL_DEPTH_TEST); | 2034 cmd_enable.Init(GL_DEPTH_TEST); |
2033 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); | 2035 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd_enable)); |
2034 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2036 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
2035 | 2037 |
2036 cmds::ClearBufferfi cmd; | 2038 cmds::ClearBufferfi cmd; |
2037 cmd.Init(GL_DEPTH_STENCIL, 0, 1.0f, 0); | 2039 cmd.Init(GL_DEPTH_STENCIL, 0, 1.0f, 0); |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3397 | 3399 |
3398 TEST_P(GLES3DecoderTest, FramebufferTextureLayerValidArgs) { | 3400 TEST_P(GLES3DecoderTest, FramebufferTextureLayerValidArgs) { |
3399 DoBindFramebuffer( | 3401 DoBindFramebuffer( |
3400 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); | 3402 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); |
3401 DoBindTexture(GL_TEXTURE_3D, client_texture_id_, kServiceTextureId); | 3403 DoBindTexture(GL_TEXTURE_3D, client_texture_id_, kServiceTextureId); |
3402 EXPECT_CALL(*gl_, FramebufferTextureLayer(GL_FRAMEBUFFER, | 3404 EXPECT_CALL(*gl_, FramebufferTextureLayer(GL_FRAMEBUFFER, |
3403 GL_COLOR_ATTACHMENT0, | 3405 GL_COLOR_ATTACHMENT0, |
3404 kServiceTextureId, 4, 5)) | 3406 kServiceTextureId, 4, 5)) |
3405 .Times(1) | 3407 .Times(1) |
3406 .RetiresOnSaturation(); | 3408 .RetiresOnSaturation(); |
| 3409 EXPECT_CALL(*gl_, GetError()) |
| 3410 .WillOnce(Return(GL_NO_ERROR)) |
| 3411 .WillOnce(Return(GL_NO_ERROR)) |
| 3412 .RetiresOnSaturation(); |
3407 cmds::FramebufferTextureLayer cmd; | 3413 cmds::FramebufferTextureLayer cmd; |
3408 cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, client_texture_id_, 4, 5); | 3414 cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, client_texture_id_, 4, 5); |
3409 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 3415 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
3410 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3416 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
3411 } | 3417 } |
3412 | 3418 |
3413 // TODO(gman): PixelStorei | 3419 // TODO(gman): PixelStorei |
3414 | 3420 |
3415 // TODO(gman): SwapBuffers | 3421 // TODO(gman): SwapBuffers |
3416 | 3422 |
3417 } // namespace gles2 | 3423 } // namespace gles2 |
3418 } // namespace gpu | 3424 } // namespace gpu |
OLD | NEW |