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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 Result::ComputeSize(1)); | 600 Result::ComputeSize(1)); |
601 EXPECT_CALL(*gl_, GetAttachedShaders(_, _, _, _)).Times(0); | 601 EXPECT_CALL(*gl_, GetAttachedShaders(_, _, _, _)).Times(0); |
602 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 602 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
603 cmd.Init(client_program_id_, | 603 cmd.Init(client_program_id_, |
604 shared_memory_id_, | 604 shared_memory_id_, |
605 kInvalidSharedMemoryOffset, | 605 kInvalidSharedMemoryOffset, |
606 Result::ComputeSize(1)); | 606 Result::ComputeSize(1)); |
607 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 607 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
608 } | 608 } |
609 | 609 |
610 TEST_P(GLES2DecoderWithShaderTest, GetShaderPrecisionFormatSucceeds) { | 610 TEST_P(GLES2DecoderManualInitTest, GetShaderPrecisionFormatSucceeds) { |
611 ScopedGLImplementationSetter gl_impl(::gl::kGLImplementationEGLGLES2); | 611 // Force ES underlying implementation to ensure we check the shader precision |
| 612 // format. |
| 613 InitState init; |
| 614 init.gl_version = "opengl es 2.0"; |
| 615 init.bind_generates_resource = true; |
| 616 InitDecoder(init); |
| 617 |
612 GetShaderPrecisionFormat cmd; | 618 GetShaderPrecisionFormat cmd; |
613 typedef GetShaderPrecisionFormat::Result Result; | 619 typedef GetShaderPrecisionFormat::Result Result; |
614 Result* result = static_cast<Result*>(shared_memory_address_); | 620 Result* result = static_cast<Result*>(shared_memory_address_); |
615 result->success = 0; | 621 result->success = 0; |
616 const GLint range[2] = {62, 62}; | 622 const GLint range[2] = {62, 62}; |
617 const GLint precision = 16; | 623 const GLint precision = 16; |
618 EXPECT_CALL(*gl_, GetShaderPrecisionFormat(_, _, _, _)) | 624 EXPECT_CALL(*gl_, GetShaderPrecisionFormat(_, _, _, _)) |
619 .WillOnce(DoAll(SetArrayArgument<2>(range, range + 2), | 625 .WillOnce(DoAll(SetArrayArgument<2>(range, range + 2), |
620 SetArgPointee<3>(precision))) | 626 SetArgPointee<3>(precision))) |
621 .RetiresOnSaturation(); | 627 .RetiresOnSaturation(); |
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2341 } | 2347 } |
2342 | 2348 |
2343 // TODO(gman): DeleteProgram | 2349 // TODO(gman): DeleteProgram |
2344 | 2350 |
2345 // TODO(gman): UseProgram | 2351 // TODO(gman): UseProgram |
2346 | 2352 |
2347 // TODO(gman): DeleteShader | 2353 // TODO(gman): DeleteShader |
2348 | 2354 |
2349 } // namespace gles2 | 2355 } // namespace gles2 |
2350 } // namespace gpu | 2356 } // namespace gpu |
OLD | NEW |