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

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: Check for GL errors in the unittest Created 4 years, 7 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));
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
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