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)); | |
Zhenyao Mo
2016/05/25 21:42:38
You should check no GL error here.
| |
464 } | |
465 | |
466 TEST_P(GLES2DecoderManualInitTest, MipmapHintOnCompatibilityProfile) { | |
467 // On a compatibility profile, glHint(GL_GENERATE_MIPMAP_HINT) should be go | |
468 // through | |
469 InitState init; | |
470 init.gl_version = "3.2"; | |
471 init.extensions += " GL_ARB_compatibility"; | |
472 InitDecoder(init); | |
473 | |
474 cmds::Hint cmd; | |
475 cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_NICEST); | |
476 | |
477 EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_NICEST)) | |
478 .Times(1) | |
479 .RetiresOnSaturation(); | |
480 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | |
481 } | |
482 | |
453 // TODO(vmiura): Tests for VAO restore. | 483 // TODO(vmiura): Tests for VAO restore. |
454 | 484 |
455 // TODO(vmiura): Tests for ContextState::RestoreAttribute(). | 485 // TODO(vmiura): Tests for ContextState::RestoreAttribute(). |
456 | 486 |
457 // TODO(vmiura): Tests for ContextState::RestoreBufferBindings(). | 487 // TODO(vmiura): Tests for ContextState::RestoreBufferBindings(). |
458 | 488 |
459 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). | 489 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). |
460 | 490 |
461 // TODO(vmiura): Tests for ContextState::RestoreRenderbufferBindings(). | 491 // TODO(vmiura): Tests for ContextState::RestoreRenderbufferBindings(). |
462 | 492 |
463 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). | 493 // TODO(vmiura): Tests for ContextState::RestoreProgramBindings(). |
464 | 494 |
465 // TODO(vmiura): Tests for ContextState::RestoreGlobalState(). | 495 // TODO(vmiura): Tests for ContextState::RestoreGlobalState(). |
466 | 496 |
467 } // namespace gles2 | 497 } // namespace gles2 |
468 } // namespace gpu | 498 } // namespace gpu |
OLD | NEW |