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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 // This file is auto-generated from 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py 6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 387
388 TEST_P(GLES2DecoderTest1, ClearValidArgs) { 388 TEST_P(GLES2DecoderTest1, ClearValidArgs) {
389 EXPECT_CALL(*gl_, Clear(1)); 389 EXPECT_CALL(*gl_, Clear(1));
390 SpecializedSetup<cmds::Clear, 0>(true); 390 SpecializedSetup<cmds::Clear, 0>(true);
391 cmds::Clear cmd; 391 cmds::Clear cmd;
392 cmd.Init(1); 392 cmd.Init(1);
393 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 393 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
394 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 394 EXPECT_EQ(GL_NO_ERROR, GetGLError());
395 } 395 }
396 396
397 TEST_P(GLES2DecoderTest1, ClearBufferfiValidArgs) {
398 EXPECT_CALL(*gl_, ClearBufferfi(GL_COLOR, 2, 3, 4));
399 SpecializedSetup<cmds::ClearBufferfi, 0>(true);
400 cmds::ClearBufferfi cmd;
401 cmd.Init(GL_COLOR, 2, 3, 4);
402 decoder_->set_unsafe_es3_apis_enabled(true);
403 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
404 EXPECT_EQ(GL_NO_ERROR, GetGLError());
405 decoder_->set_unsafe_es3_apis_enabled(false);
406 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
407 }
408
409 TEST_P(GLES2DecoderTest1, ClearBufferfvImmediateValidArgs) {
410 cmds::ClearBufferfvImmediate& cmd =
411 *GetImmediateAs<cmds::ClearBufferfvImmediate>();
412 SpecializedSetup<cmds::ClearBufferfvImmediate, 0>(true);
413 GLfloat temp[4] = {
414 0,
415 };
416 cmd.Init(GL_COLOR, 2, &temp[0]);
417 EXPECT_CALL(*gl_,
418 ClearBufferfv(GL_COLOR, 2, reinterpret_cast<GLfloat*>(
419 ImmediateDataAddress(&cmd))));
420 decoder_->set_unsafe_es3_apis_enabled(true);
421 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
422 EXPECT_EQ(GL_NO_ERROR, GetGLError());
423 decoder_->set_unsafe_es3_apis_enabled(false);
424 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
425 }
426
427 TEST_P(GLES2DecoderTest1, ClearBufferivImmediateValidArgs) {
428 cmds::ClearBufferivImmediate& cmd =
429 *GetImmediateAs<cmds::ClearBufferivImmediate>();
430 SpecializedSetup<cmds::ClearBufferivImmediate, 0>(true);
431 GLint temp[4] = {
432 0,
433 };
434 cmd.Init(GL_COLOR, 2, &temp[0]);
435 EXPECT_CALL(*gl_, ClearBufferiv(
436 GL_COLOR, 2,
437 reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
438 decoder_->set_unsafe_es3_apis_enabled(true);
439 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
440 EXPECT_EQ(GL_NO_ERROR, GetGLError());
441 decoder_->set_unsafe_es3_apis_enabled(false);
442 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
443 }
444
445 TEST_P(GLES2DecoderTest1, ClearBufferuivImmediateValidArgs) {
446 cmds::ClearBufferuivImmediate& cmd =
447 *GetImmediateAs<cmds::ClearBufferuivImmediate>();
448 SpecializedSetup<cmds::ClearBufferuivImmediate, 0>(true);
449 GLuint temp[4] = {
450 0,
451 };
452 cmd.Init(GL_COLOR, 2, &temp[0]);
453 EXPECT_CALL(*gl_, ClearBufferuiv(
454 GL_COLOR, 2,
455 reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
456 decoder_->set_unsafe_es3_apis_enabled(true);
457 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
458 EXPECT_EQ(GL_NO_ERROR, GetGLError());
459 decoder_->set_unsafe_es3_apis_enabled(false);
460 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
461 }
462
397 TEST_P(GLES2DecoderTest1, ClearColorValidArgs) { 463 TEST_P(GLES2DecoderTest1, ClearColorValidArgs) {
398 EXPECT_CALL(*gl_, ClearColor(1, 2, 3, 4)); 464 EXPECT_CALL(*gl_, ClearColor(1, 2, 3, 4));
399 SpecializedSetup<cmds::ClearColor, 0>(true); 465 SpecializedSetup<cmds::ClearColor, 0>(true);
400 cmds::ClearColor cmd; 466 cmds::ClearColor cmd;
401 cmd.Init(1, 2, 3, 4); 467 cmd.Init(1, 2, 3, 4);
402 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 468 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
403 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 469 EXPECT_EQ(GL_NO_ERROR, GetGLError());
404 } 470 }
405 471
406 TEST_P(GLES2DecoderTest1, ClearDepthfValidArgs) { 472 TEST_P(GLES2DecoderTest1, ClearDepthfValidArgs) {
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 SpecializedSetup<cmds::GetVertexAttribiv, 0>(false); 1989 SpecializedSetup<cmds::GetVertexAttribiv, 0>(false);
1924 cmds::GetVertexAttribiv::Result* result = 1990 cmds::GetVertexAttribiv::Result* result =
1925 static_cast<cmds::GetVertexAttribiv::Result*>(shared_memory_address_); 1991 static_cast<cmds::GetVertexAttribiv::Result*>(shared_memory_address_);
1926 result->size = 0; 1992 result->size = 0;
1927 cmds::GetVertexAttribiv cmd; 1993 cmds::GetVertexAttribiv cmd;
1928 cmd.Init(1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, shared_memory_id_, 1994 cmd.Init(1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, shared_memory_id_,
1929 kInvalidSharedMemoryOffset); 1995 kInvalidSharedMemoryOffset);
1930 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1996 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1931 EXPECT_EQ(0u, result->size); 1997 EXPECT_EQ(0u, result->size);
1932 } 1998 }
1933 // TODO(gman): GetVertexAttribPointerv
1934
1935 TEST_P(GLES2DecoderTest1, HintValidArgs) {
1936 EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST));
1937 SpecializedSetup<cmds::Hint, 0>(true);
1938 cmds::Hint cmd;
1939 cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
1940 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1941 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1942 }
1943
1944 TEST_P(GLES2DecoderTest1, HintInvalidArgs0_0) {
1945 EXPECT_CALL(*gl_, Hint(_, _)).Times(0);
1946 SpecializedSetup<cmds::Hint, 0>(false);
1947 cmds::Hint cmd;
1948 cmd.Init(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
1949 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1950 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
1951 }
1952 // TODO(gman): InvalidateFramebufferImmediate
1953 // TODO(gman): InvalidateSubFramebufferImmediate
1954 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 1999 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698