Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc

Issue 2009073002: command_buffer: Guard on extension and profiles in the decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unittest + core profile mock expectations Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | gpu/command_buffer/service/test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698