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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // Again, PixelStorei calls with unpack parameters are cached. | 443 // Again, PixelStorei calls with unpack parameters are cached. |
444 EXPECT_CALL(*gl_, PixelStorei(_, _)).Times(0); | 444 EXPECT_CALL(*gl_, PixelStorei(_, _)).Times(0); |
445 cmd.Init(GL_UNPACK_ROW_LENGTH, 32); | 445 cmd.Init(GL_UNPACK_ROW_LENGTH, 32); |
446 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 446 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
447 | 447 |
448 // Bind a PIXEL_UNPACK_BUFFER again. | 448 // Bind a PIXEL_UNPACK_BUFFER again. |
449 SetupUpdateES3UnpackParametersExpectations(gl_.get(), 32, 0); | 449 SetupUpdateES3UnpackParametersExpectations(gl_.get(), 32, 0); |
450 DoBindBuffer(GL_PIXEL_UNPACK_BUFFER, client_buffer_id_, kServiceBufferId); | 450 DoBindBuffer(GL_PIXEL_UNPACK_BUFFER, client_buffer_id_, kServiceBufferId); |
451 } | 451 } |
452 | 452 |
| 453 TEST_P(GLES2DecoderManualInitTest, MipmapHintOnCoreProfile) { |
| 454 // On a core profile, glHint(GL_GENERATE_MIPMAP_HINT) should be a noop |
| 455 InitState init; |
| 456 init.gl_version = "3.2"; |
| 457 InitDecoder(init); |
| 458 |
| 459 cmds::Hint cmd; |
| 460 cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_NICEST); |
| 461 |
| 462 EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_NICEST)).Times(0); |
| 463 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 464 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 465 } |
| 466 |
| 467 TEST_P(GLES2DecoderManualInitTest, MipmapHintOnCompatibilityProfile) { |
| 468 // On a compatibility profile, glHint(GL_GENERATE_MIPMAP_HINT) should be go |
| 469 // through |
| 470 InitState init; |
| 471 init.gl_version = "3.2"; |
| 472 init.extensions += " GL_ARB_compatibility"; |
| 473 InitDecoder(init); |
| 474 |
| 475 cmds::Hint cmd; |
| 476 cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_NICEST); |
| 477 |
| 478 EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_NICEST)) |
| 479 .Times(1) |
| 480 .RetiresOnSaturation(); |
| 481 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 482 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 483 } |
| 484 |
453 // TODO(vmiura): Tests for VAO restore. | 485 // TODO(vmiura): Tests for VAO restore. |
454 | 486 |
455 // TODO(vmiura): Tests for ContextState::RestoreAttribute(). | 487 // TODO(vmiura): Tests for ContextState::RestoreAttribute(). |
456 | 488 |
457 // TODO(vmiura): Tests for ContextState::RestoreBufferBindings(). | 489 // TODO(vmiura): Tests for ContextState::RestoreBufferBindings(). |
458 | 490 |
459 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). | 491 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). |
460 | 492 |
461 // TODO(vmiura): Tests for ContextState::RestoreRenderbufferBindings(). | 493 // TODO(vmiura): Tests for ContextState::RestoreRenderbufferBindings(). |
462 | 494 |
463 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). | 495 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). |
464 | 496 |
465 // TODO(vmiura): Tests for ContextState::RestoreGlobalState(). | 497 // TODO(vmiura): Tests for ContextState::RestoreGlobalState(). |
466 | 498 |
467 } // namespace gles2 | 499 } // namespace gles2 |
468 } // namespace gpu | 500 } // namespace gpu |
OLD | NEW |