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 // 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 LOCAL_SET_GL_ERROR_INVALID_ENUM("glCullFace", mode, "mode"); | 468 LOCAL_SET_GL_ERROR_INVALID_ENUM("glCullFace", mode, "mode"); |
469 return error::kNoError; | 469 return error::kNoError; |
470 } | 470 } |
471 if (state_.cull_mode != mode) { | 471 if (state_.cull_mode != mode) { |
472 state_.cull_mode = mode; | 472 state_.cull_mode = mode; |
473 glCullFace(mode); | 473 glCullFace(mode); |
474 } | 474 } |
475 return error::kNoError; | 475 return error::kNoError; |
476 } | 476 } |
477 | 477 |
478 error::Error GLES2DecoderImpl::HandleDeleteBuffers( | |
479 uint32_t immediate_data_size, | |
480 const gles2::cmds::DeleteBuffers& c) { | |
481 GLsizei n = static_cast<GLsizei>(c.n); | |
482 uint32_t data_size; | |
483 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
484 return error::kOutOfBounds; | |
485 } | |
486 const GLuint* buffers = GetSharedMemoryAs<const GLuint*>( | |
487 c.buffers_shm_id, c.buffers_shm_offset, data_size); | |
488 if (buffers == NULL) { | |
489 return error::kOutOfBounds; | |
490 } | |
491 DeleteBuffersHelper(n, buffers); | |
492 return error::kNoError; | |
493 } | |
494 | |
495 error::Error GLES2DecoderImpl::HandleDeleteBuffersImmediate( | 478 error::Error GLES2DecoderImpl::HandleDeleteBuffersImmediate( |
496 uint32_t immediate_data_size, | 479 uint32_t immediate_data_size, |
497 const gles2::cmds::DeleteBuffersImmediate& c) { | 480 const gles2::cmds::DeleteBuffersImmediate& c) { |
498 GLsizei n = static_cast<GLsizei>(c.n); | 481 GLsizei n = static_cast<GLsizei>(c.n); |
499 uint32_t data_size; | 482 uint32_t data_size; |
500 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 483 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
501 return error::kOutOfBounds; | 484 return error::kOutOfBounds; |
502 } | 485 } |
503 const GLuint* buffers = | 486 const GLuint* buffers = |
504 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | 487 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
505 if (buffers == NULL) { | 488 if (buffers == NULL) { |
506 return error::kOutOfBounds; | 489 return error::kOutOfBounds; |
507 } | 490 } |
508 DeleteBuffersHelper(n, buffers); | 491 DeleteBuffersHelper(n, buffers); |
509 return error::kNoError; | 492 return error::kNoError; |
510 } | 493 } |
511 | 494 |
512 error::Error GLES2DecoderImpl::HandleDeleteFramebuffers( | |
513 uint32_t immediate_data_size, | |
514 const gles2::cmds::DeleteFramebuffers& c) { | |
515 GLsizei n = static_cast<GLsizei>(c.n); | |
516 uint32_t data_size; | |
517 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
518 return error::kOutOfBounds; | |
519 } | |
520 const GLuint* framebuffers = GetSharedMemoryAs<const GLuint*>( | |
521 c.framebuffers_shm_id, c.framebuffers_shm_offset, data_size); | |
522 if (framebuffers == NULL) { | |
523 return error::kOutOfBounds; | |
524 } | |
525 DeleteFramebuffersHelper(n, framebuffers); | |
526 return error::kNoError; | |
527 } | |
528 | |
529 error::Error GLES2DecoderImpl::HandleDeleteFramebuffersImmediate( | 495 error::Error GLES2DecoderImpl::HandleDeleteFramebuffersImmediate( |
530 uint32_t immediate_data_size, | 496 uint32_t immediate_data_size, |
531 const gles2::cmds::DeleteFramebuffersImmediate& c) { | 497 const gles2::cmds::DeleteFramebuffersImmediate& c) { |
532 GLsizei n = static_cast<GLsizei>(c.n); | 498 GLsizei n = static_cast<GLsizei>(c.n); |
533 uint32_t data_size; | 499 uint32_t data_size; |
534 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 500 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
535 return error::kOutOfBounds; | 501 return error::kOutOfBounds; |
536 } | 502 } |
537 const GLuint* framebuffers = | 503 const GLuint* framebuffers = |
538 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | 504 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
539 if (framebuffers == NULL) { | 505 if (framebuffers == NULL) { |
540 return error::kOutOfBounds; | 506 return error::kOutOfBounds; |
541 } | 507 } |
542 DeleteFramebuffersHelper(n, framebuffers); | 508 DeleteFramebuffersHelper(n, framebuffers); |
543 return error::kNoError; | 509 return error::kNoError; |
544 } | 510 } |
545 | 511 |
546 error::Error GLES2DecoderImpl::HandleDeleteRenderbuffers( | |
547 uint32_t immediate_data_size, | |
548 const gles2::cmds::DeleteRenderbuffers& c) { | |
549 GLsizei n = static_cast<GLsizei>(c.n); | |
550 uint32_t data_size; | |
551 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
552 return error::kOutOfBounds; | |
553 } | |
554 const GLuint* renderbuffers = GetSharedMemoryAs<const GLuint*>( | |
555 c.renderbuffers_shm_id, c.renderbuffers_shm_offset, data_size); | |
556 if (renderbuffers == NULL) { | |
557 return error::kOutOfBounds; | |
558 } | |
559 DeleteRenderbuffersHelper(n, renderbuffers); | |
560 return error::kNoError; | |
561 } | |
562 | |
563 error::Error GLES2DecoderImpl::HandleDeleteRenderbuffersImmediate( | 512 error::Error GLES2DecoderImpl::HandleDeleteRenderbuffersImmediate( |
564 uint32_t immediate_data_size, | 513 uint32_t immediate_data_size, |
565 const gles2::cmds::DeleteRenderbuffersImmediate& c) { | 514 const gles2::cmds::DeleteRenderbuffersImmediate& c) { |
566 GLsizei n = static_cast<GLsizei>(c.n); | 515 GLsizei n = static_cast<GLsizei>(c.n); |
567 uint32_t data_size; | 516 uint32_t data_size; |
568 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 517 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
569 return error::kOutOfBounds; | 518 return error::kOutOfBounds; |
570 } | 519 } |
571 const GLuint* renderbuffers = | 520 const GLuint* renderbuffers = |
572 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | 521 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
573 if (renderbuffers == NULL) { | 522 if (renderbuffers == NULL) { |
574 return error::kOutOfBounds; | 523 return error::kOutOfBounds; |
575 } | 524 } |
576 DeleteRenderbuffersHelper(n, renderbuffers); | 525 DeleteRenderbuffersHelper(n, renderbuffers); |
577 return error::kNoError; | 526 return error::kNoError; |
578 } | 527 } |
579 | 528 |
580 error::Error GLES2DecoderImpl::HandleDeleteTextures( | |
581 uint32_t immediate_data_size, | |
582 const gles2::cmds::DeleteTextures& c) { | |
583 GLsizei n = static_cast<GLsizei>(c.n); | |
584 uint32_t data_size; | |
585 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
586 return error::kOutOfBounds; | |
587 } | |
588 const GLuint* textures = GetSharedMemoryAs<const GLuint*>( | |
589 c.textures_shm_id, c.textures_shm_offset, data_size); | |
590 if (textures == NULL) { | |
591 return error::kOutOfBounds; | |
592 } | |
593 DeleteTexturesHelper(n, textures); | |
594 return error::kNoError; | |
595 } | |
596 | |
597 error::Error GLES2DecoderImpl::HandleDeleteTexturesImmediate( | 529 error::Error GLES2DecoderImpl::HandleDeleteTexturesImmediate( |
598 uint32_t immediate_data_size, | 530 uint32_t immediate_data_size, |
599 const gles2::cmds::DeleteTexturesImmediate& c) { | 531 const gles2::cmds::DeleteTexturesImmediate& c) { |
600 GLsizei n = static_cast<GLsizei>(c.n); | 532 GLsizei n = static_cast<GLsizei>(c.n); |
601 uint32_t data_size; | 533 uint32_t data_size; |
602 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 534 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
603 return error::kOutOfBounds; | 535 return error::kOutOfBounds; |
604 } | 536 } |
605 const GLuint* textures = | 537 const GLuint* textures = |
606 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | 538 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 LOCAL_SET_GL_ERROR_INVALID_ENUM("glFrontFace", mode, "mode"); | 702 LOCAL_SET_GL_ERROR_INVALID_ENUM("glFrontFace", mode, "mode"); |
771 return error::kNoError; | 703 return error::kNoError; |
772 } | 704 } |
773 if (state_.front_face != mode) { | 705 if (state_.front_face != mode) { |
774 state_.front_face = mode; | 706 state_.front_face = mode; |
775 glFrontFace(mode); | 707 glFrontFace(mode); |
776 } | 708 } |
777 return error::kNoError; | 709 return error::kNoError; |
778 } | 710 } |
779 | 711 |
780 error::Error GLES2DecoderImpl::HandleGenBuffers( | |
781 uint32_t immediate_data_size, | |
782 const gles2::cmds::GenBuffers& c) { | |
783 GLsizei n = static_cast<GLsizei>(c.n); | |
784 uint32_t data_size; | |
785 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
786 return error::kOutOfBounds; | |
787 } | |
788 GLuint* buffers = GetSharedMemoryAs<GLuint*>( | |
789 c.buffers_shm_id, c.buffers_shm_offset, data_size); | |
790 if (buffers == NULL) { | |
791 return error::kOutOfBounds; | |
792 } | |
793 if (!GenBuffersHelper(n, buffers)) { | |
794 return error::kInvalidArguments; | |
795 } | |
796 return error::kNoError; | |
797 } | |
798 | |
799 error::Error GLES2DecoderImpl::HandleGenBuffersImmediate( | 712 error::Error GLES2DecoderImpl::HandleGenBuffersImmediate( |
800 uint32_t immediate_data_size, | 713 uint32_t immediate_data_size, |
801 const gles2::cmds::GenBuffersImmediate& c) { | 714 const gles2::cmds::GenBuffersImmediate& c) { |
802 GLsizei n = static_cast<GLsizei>(c.n); | 715 GLsizei n = static_cast<GLsizei>(c.n); |
803 uint32_t data_size; | 716 uint32_t data_size; |
804 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 717 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
805 return error::kOutOfBounds; | 718 return error::kOutOfBounds; |
806 } | 719 } |
807 GLuint* buffers = | 720 GLuint* buffers = |
808 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | 721 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
(...skipping 11 matching lines...) Expand all Loading... |
820 const gles2::cmds::GenerateMipmap& c) { | 733 const gles2::cmds::GenerateMipmap& c) { |
821 GLenum target = static_cast<GLenum>(c.target); | 734 GLenum target = static_cast<GLenum>(c.target); |
822 if (!validators_->texture_bind_target.IsValid(target)) { | 735 if (!validators_->texture_bind_target.IsValid(target)) { |
823 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGenerateMipmap", target, "target"); | 736 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGenerateMipmap", target, "target"); |
824 return error::kNoError; | 737 return error::kNoError; |
825 } | 738 } |
826 DoGenerateMipmap(target); | 739 DoGenerateMipmap(target); |
827 return error::kNoError; | 740 return error::kNoError; |
828 } | 741 } |
829 | 742 |
830 error::Error GLES2DecoderImpl::HandleGenFramebuffers( | |
831 uint32_t immediate_data_size, | |
832 const gles2::cmds::GenFramebuffers& c) { | |
833 GLsizei n = static_cast<GLsizei>(c.n); | |
834 uint32_t data_size; | |
835 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
836 return error::kOutOfBounds; | |
837 } | |
838 GLuint* framebuffers = GetSharedMemoryAs<GLuint*>( | |
839 c.framebuffers_shm_id, c.framebuffers_shm_offset, data_size); | |
840 if (framebuffers == NULL) { | |
841 return error::kOutOfBounds; | |
842 } | |
843 if (!GenFramebuffersHelper(n, framebuffers)) { | |
844 return error::kInvalidArguments; | |
845 } | |
846 return error::kNoError; | |
847 } | |
848 | |
849 error::Error GLES2DecoderImpl::HandleGenFramebuffersImmediate( | 743 error::Error GLES2DecoderImpl::HandleGenFramebuffersImmediate( |
850 uint32_t immediate_data_size, | 744 uint32_t immediate_data_size, |
851 const gles2::cmds::GenFramebuffersImmediate& c) { | 745 const gles2::cmds::GenFramebuffersImmediate& c) { |
852 GLsizei n = static_cast<GLsizei>(c.n); | 746 GLsizei n = static_cast<GLsizei>(c.n); |
853 uint32_t data_size; | 747 uint32_t data_size; |
854 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 748 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
855 return error::kOutOfBounds; | 749 return error::kOutOfBounds; |
856 } | 750 } |
857 GLuint* framebuffers = | 751 GLuint* framebuffers = |
858 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | 752 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
859 if (framebuffers == NULL) { | 753 if (framebuffers == NULL) { |
860 return error::kOutOfBounds; | 754 return error::kOutOfBounds; |
861 } | 755 } |
862 if (!GenFramebuffersHelper(n, framebuffers)) { | 756 if (!GenFramebuffersHelper(n, framebuffers)) { |
863 return error::kInvalidArguments; | 757 return error::kInvalidArguments; |
864 } | 758 } |
865 return error::kNoError; | 759 return error::kNoError; |
866 } | 760 } |
867 | 761 |
868 error::Error GLES2DecoderImpl::HandleGenRenderbuffers( | |
869 uint32_t immediate_data_size, | |
870 const gles2::cmds::GenRenderbuffers& c) { | |
871 GLsizei n = static_cast<GLsizei>(c.n); | |
872 uint32_t data_size; | |
873 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
874 return error::kOutOfBounds; | |
875 } | |
876 GLuint* renderbuffers = GetSharedMemoryAs<GLuint*>( | |
877 c.renderbuffers_shm_id, c.renderbuffers_shm_offset, data_size); | |
878 if (renderbuffers == NULL) { | |
879 return error::kOutOfBounds; | |
880 } | |
881 if (!GenRenderbuffersHelper(n, renderbuffers)) { | |
882 return error::kInvalidArguments; | |
883 } | |
884 return error::kNoError; | |
885 } | |
886 | |
887 error::Error GLES2DecoderImpl::HandleGenRenderbuffersImmediate( | 762 error::Error GLES2DecoderImpl::HandleGenRenderbuffersImmediate( |
888 uint32_t immediate_data_size, | 763 uint32_t immediate_data_size, |
889 const gles2::cmds::GenRenderbuffersImmediate& c) { | 764 const gles2::cmds::GenRenderbuffersImmediate& c) { |
890 GLsizei n = static_cast<GLsizei>(c.n); | 765 GLsizei n = static_cast<GLsizei>(c.n); |
891 uint32_t data_size; | 766 uint32_t data_size; |
892 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 767 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
893 return error::kOutOfBounds; | 768 return error::kOutOfBounds; |
894 } | 769 } |
895 GLuint* renderbuffers = | 770 GLuint* renderbuffers = |
896 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | 771 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
897 if (renderbuffers == NULL) { | 772 if (renderbuffers == NULL) { |
898 return error::kOutOfBounds; | 773 return error::kOutOfBounds; |
899 } | 774 } |
900 if (!GenRenderbuffersHelper(n, renderbuffers)) { | 775 if (!GenRenderbuffersHelper(n, renderbuffers)) { |
901 return error::kInvalidArguments; | 776 return error::kInvalidArguments; |
902 } | 777 } |
903 return error::kNoError; | 778 return error::kNoError; |
904 } | 779 } |
905 | 780 |
906 error::Error GLES2DecoderImpl::HandleGenTextures( | |
907 uint32_t immediate_data_size, | |
908 const gles2::cmds::GenTextures& c) { | |
909 GLsizei n = static_cast<GLsizei>(c.n); | |
910 uint32_t data_size; | |
911 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
912 return error::kOutOfBounds; | |
913 } | |
914 GLuint* textures = GetSharedMemoryAs<GLuint*>( | |
915 c.textures_shm_id, c.textures_shm_offset, data_size); | |
916 if (textures == NULL) { | |
917 return error::kOutOfBounds; | |
918 } | |
919 if (!GenTexturesHelper(n, textures)) { | |
920 return error::kInvalidArguments; | |
921 } | |
922 return error::kNoError; | |
923 } | |
924 | |
925 error::Error GLES2DecoderImpl::HandleGenTexturesImmediate( | 781 error::Error GLES2DecoderImpl::HandleGenTexturesImmediate( |
926 uint32_t immediate_data_size, | 782 uint32_t immediate_data_size, |
927 const gles2::cmds::GenTexturesImmediate& c) { | 783 const gles2::cmds::GenTexturesImmediate& c) { |
928 GLsizei n = static_cast<GLsizei>(c.n); | 784 GLsizei n = static_cast<GLsizei>(c.n); |
929 uint32_t data_size; | 785 uint32_t data_size; |
930 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 786 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
931 return error::kOutOfBounds; | 787 return error::kOutOfBounds; |
932 } | 788 } |
933 GLuint* textures = | 789 GLuint* textures = |
934 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | 790 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 return error::kNoError; | 1665 return error::kNoError; |
1810 } | 1666 } |
1811 if (!validators_->texture_parameter.IsValid(pname)) { | 1667 if (!validators_->texture_parameter.IsValid(pname)) { |
1812 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameterf", pname, "pname"); | 1668 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameterf", pname, "pname"); |
1813 return error::kNoError; | 1669 return error::kNoError; |
1814 } | 1670 } |
1815 DoTexParameterf(target, pname, param); | 1671 DoTexParameterf(target, pname, param); |
1816 return error::kNoError; | 1672 return error::kNoError; |
1817 } | 1673 } |
1818 | 1674 |
1819 error::Error GLES2DecoderImpl::HandleTexParameterfv( | |
1820 uint32_t immediate_data_size, | |
1821 const gles2::cmds::TexParameterfv& c) { | |
1822 GLenum target = static_cast<GLenum>(c.target); | |
1823 GLenum pname = static_cast<GLenum>(c.pname); | |
1824 uint32_t data_size; | |
1825 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | |
1826 return error::kOutOfBounds; | |
1827 } | |
1828 const GLfloat* params = GetSharedMemoryAs<const GLfloat*>( | |
1829 c.params_shm_id, c.params_shm_offset, data_size); | |
1830 if (!validators_->texture_bind_target.IsValid(target)) { | |
1831 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameterfv", target, "target"); | |
1832 return error::kNoError; | |
1833 } | |
1834 if (!validators_->texture_parameter.IsValid(pname)) { | |
1835 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameterfv", pname, "pname"); | |
1836 return error::kNoError; | |
1837 } | |
1838 if (params == NULL) { | |
1839 return error::kOutOfBounds; | |
1840 } | |
1841 DoTexParameterfv(target, pname, params); | |
1842 return error::kNoError; | |
1843 } | |
1844 | |
1845 error::Error GLES2DecoderImpl::HandleTexParameterfvImmediate( | 1675 error::Error GLES2DecoderImpl::HandleTexParameterfvImmediate( |
1846 uint32_t immediate_data_size, | 1676 uint32_t immediate_data_size, |
1847 const gles2::cmds::TexParameterfvImmediate& c) { | 1677 const gles2::cmds::TexParameterfvImmediate& c) { |
1848 GLenum target = static_cast<GLenum>(c.target); | 1678 GLenum target = static_cast<GLenum>(c.target); |
1849 GLenum pname = static_cast<GLenum>(c.pname); | 1679 GLenum pname = static_cast<GLenum>(c.pname); |
1850 uint32_t data_size; | 1680 uint32_t data_size; |
1851 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | 1681 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
1852 return error::kOutOfBounds; | 1682 return error::kOutOfBounds; |
1853 } | 1683 } |
1854 if (data_size > immediate_data_size) { | 1684 if (data_size > immediate_data_size) { |
(...skipping 27 matching lines...) Expand all Loading... |
1882 return error::kNoError; | 1712 return error::kNoError; |
1883 } | 1713 } |
1884 if (!validators_->texture_parameter.IsValid(pname)) { | 1714 if (!validators_->texture_parameter.IsValid(pname)) { |
1885 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameteri", pname, "pname"); | 1715 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameteri", pname, "pname"); |
1886 return error::kNoError; | 1716 return error::kNoError; |
1887 } | 1717 } |
1888 DoTexParameteri(target, pname, param); | 1718 DoTexParameteri(target, pname, param); |
1889 return error::kNoError; | 1719 return error::kNoError; |
1890 } | 1720 } |
1891 | 1721 |
1892 error::Error GLES2DecoderImpl::HandleTexParameteriv( | |
1893 uint32_t immediate_data_size, | |
1894 const gles2::cmds::TexParameteriv& c) { | |
1895 GLenum target = static_cast<GLenum>(c.target); | |
1896 GLenum pname = static_cast<GLenum>(c.pname); | |
1897 uint32_t data_size; | |
1898 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | |
1899 return error::kOutOfBounds; | |
1900 } | |
1901 const GLint* params = GetSharedMemoryAs<const GLint*>( | |
1902 c.params_shm_id, c.params_shm_offset, data_size); | |
1903 if (!validators_->texture_bind_target.IsValid(target)) { | |
1904 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameteriv", target, "target"); | |
1905 return error::kNoError; | |
1906 } | |
1907 if (!validators_->texture_parameter.IsValid(pname)) { | |
1908 LOCAL_SET_GL_ERROR_INVALID_ENUM("glTexParameteriv", pname, "pname"); | |
1909 return error::kNoError; | |
1910 } | |
1911 if (params == NULL) { | |
1912 return error::kOutOfBounds; | |
1913 } | |
1914 DoTexParameteriv(target, pname, params); | |
1915 return error::kNoError; | |
1916 } | |
1917 | |
1918 error::Error GLES2DecoderImpl::HandleTexParameterivImmediate( | 1722 error::Error GLES2DecoderImpl::HandleTexParameterivImmediate( |
1919 uint32_t immediate_data_size, | 1723 uint32_t immediate_data_size, |
1920 const gles2::cmds::TexParameterivImmediate& c) { | 1724 const gles2::cmds::TexParameterivImmediate& c) { |
1921 GLenum target = static_cast<GLenum>(c.target); | 1725 GLenum target = static_cast<GLenum>(c.target); |
1922 GLenum pname = static_cast<GLenum>(c.pname); | 1726 GLenum pname = static_cast<GLenum>(c.pname); |
1923 uint32_t data_size; | 1727 uint32_t data_size; |
1924 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | 1728 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { |
1925 return error::kOutOfBounds; | 1729 return error::kOutOfBounds; |
1926 } | 1730 } |
1927 if (data_size > immediate_data_size) { | 1731 if (data_size > immediate_data_size) { |
(...skipping 21 matching lines...) Expand all Loading... |
1949 const gles2::cmds::Uniform1f& c) { | 1753 const gles2::cmds::Uniform1f& c) { |
1950 GLint location = static_cast<GLint>(c.location); | 1754 GLint location = static_cast<GLint>(c.location); |
1951 GLfloat x = static_cast<GLfloat>(c.x); | 1755 GLfloat x = static_cast<GLfloat>(c.x); |
1952 GLfloat temp[1] = { | 1756 GLfloat temp[1] = { |
1953 x, | 1757 x, |
1954 }; | 1758 }; |
1955 DoUniform1fv(location, 1, &temp[0]); | 1759 DoUniform1fv(location, 1, &temp[0]); |
1956 return error::kNoError; | 1760 return error::kNoError; |
1957 } | 1761 } |
1958 | 1762 |
1959 error::Error GLES2DecoderImpl::HandleUniform1fv( | |
1960 uint32_t immediate_data_size, | |
1961 const gles2::cmds::Uniform1fv& c) { | |
1962 GLint location = static_cast<GLint>(c.location); | |
1963 GLsizei count = static_cast<GLsizei>(c.count); | |
1964 uint32_t data_size; | |
1965 if (!ComputeDataSize(count, sizeof(GLfloat), 1, &data_size)) { | |
1966 return error::kOutOfBounds; | |
1967 } | |
1968 const GLfloat* v = | |
1969 GetSharedMemoryAs<const GLfloat*>(c.v_shm_id, c.v_shm_offset, data_size); | |
1970 if (v == NULL) { | |
1971 return error::kOutOfBounds; | |
1972 } | |
1973 DoUniform1fv(location, count, v); | |
1974 return error::kNoError; | |
1975 } | |
1976 | |
1977 error::Error GLES2DecoderImpl::HandleUniform1fvImmediate( | 1763 error::Error GLES2DecoderImpl::HandleUniform1fvImmediate( |
1978 uint32_t immediate_data_size, | 1764 uint32_t immediate_data_size, |
1979 const gles2::cmds::Uniform1fvImmediate& c) { | 1765 const gles2::cmds::Uniform1fvImmediate& c) { |
1980 GLint location = static_cast<GLint>(c.location); | 1766 GLint location = static_cast<GLint>(c.location); |
1981 GLsizei count = static_cast<GLsizei>(c.count); | 1767 GLsizei count = static_cast<GLsizei>(c.count); |
1982 uint32_t data_size; | 1768 uint32_t data_size; |
1983 if (!ComputeDataSize(count, sizeof(GLfloat), 1, &data_size)) { | 1769 if (!ComputeDataSize(count, sizeof(GLfloat), 1, &data_size)) { |
1984 return error::kOutOfBounds; | 1770 return error::kOutOfBounds; |
1985 } | 1771 } |
1986 if (data_size > immediate_data_size) { | 1772 if (data_size > immediate_data_size) { |
(...skipping 10 matching lines...) Expand all Loading... |
1997 | 1783 |
1998 error::Error GLES2DecoderImpl::HandleUniform1i( | 1784 error::Error GLES2DecoderImpl::HandleUniform1i( |
1999 uint32_t immediate_data_size, | 1785 uint32_t immediate_data_size, |
2000 const gles2::cmds::Uniform1i& c) { | 1786 const gles2::cmds::Uniform1i& c) { |
2001 GLint location = static_cast<GLint>(c.location); | 1787 GLint location = static_cast<GLint>(c.location); |
2002 GLint x = static_cast<GLint>(c.x); | 1788 GLint x = static_cast<GLint>(c.x); |
2003 DoUniform1i(location, x); | 1789 DoUniform1i(location, x); |
2004 return error::kNoError; | 1790 return error::kNoError; |
2005 } | 1791 } |
2006 | 1792 |
2007 error::Error GLES2DecoderImpl::HandleUniform1iv( | |
2008 uint32_t immediate_data_size, | |
2009 const gles2::cmds::Uniform1iv& c) { | |
2010 GLint location = static_cast<GLint>(c.location); | |
2011 GLsizei count = static_cast<GLsizei>(c.count); | |
2012 uint32_t data_size; | |
2013 if (!ComputeDataSize(count, sizeof(GLint), 1, &data_size)) { | |
2014 return error::kOutOfBounds; | |
2015 } | |
2016 const GLint* v = | |
2017 GetSharedMemoryAs<const GLint*>(c.v_shm_id, c.v_shm_offset, data_size); | |
2018 if (v == NULL) { | |
2019 return error::kOutOfBounds; | |
2020 } | |
2021 DoUniform1iv(location, count, v); | |
2022 return error::kNoError; | |
2023 } | |
2024 | |
2025 error::Error GLES2DecoderImpl::HandleUniform1ivImmediate( | 1793 error::Error GLES2DecoderImpl::HandleUniform1ivImmediate( |
2026 uint32_t immediate_data_size, | 1794 uint32_t immediate_data_size, |
2027 const gles2::cmds::Uniform1ivImmediate& c) { | 1795 const gles2::cmds::Uniform1ivImmediate& c) { |
2028 GLint location = static_cast<GLint>(c.location); | 1796 GLint location = static_cast<GLint>(c.location); |
2029 GLsizei count = static_cast<GLsizei>(c.count); | 1797 GLsizei count = static_cast<GLsizei>(c.count); |
2030 uint32_t data_size; | 1798 uint32_t data_size; |
2031 if (!ComputeDataSize(count, sizeof(GLint), 1, &data_size)) { | 1799 if (!ComputeDataSize(count, sizeof(GLint), 1, &data_size)) { |
2032 return error::kOutOfBounds; | 1800 return error::kOutOfBounds; |
2033 } | 1801 } |
2034 if (data_size > immediate_data_size) { | 1802 if (data_size > immediate_data_size) { |
(...skipping 14 matching lines...) Expand all Loading... |
2049 GLint location = static_cast<GLint>(c.location); | 1817 GLint location = static_cast<GLint>(c.location); |
2050 GLfloat x = static_cast<GLfloat>(c.x); | 1818 GLfloat x = static_cast<GLfloat>(c.x); |
2051 GLfloat y = static_cast<GLfloat>(c.y); | 1819 GLfloat y = static_cast<GLfloat>(c.y); |
2052 GLfloat temp[2] = { | 1820 GLfloat temp[2] = { |
2053 x, y, | 1821 x, y, |
2054 }; | 1822 }; |
2055 DoUniform2fv(location, 1, &temp[0]); | 1823 DoUniform2fv(location, 1, &temp[0]); |
2056 return error::kNoError; | 1824 return error::kNoError; |
2057 } | 1825 } |
2058 | 1826 |
2059 error::Error GLES2DecoderImpl::HandleUniform2fv( | |
2060 uint32_t immediate_data_size, | |
2061 const gles2::cmds::Uniform2fv& c) { | |
2062 GLint location = static_cast<GLint>(c.location); | |
2063 GLsizei count = static_cast<GLsizei>(c.count); | |
2064 uint32_t data_size; | |
2065 if (!ComputeDataSize(count, sizeof(GLfloat), 2, &data_size)) { | |
2066 return error::kOutOfBounds; | |
2067 } | |
2068 const GLfloat* v = | |
2069 GetSharedMemoryAs<const GLfloat*>(c.v_shm_id, c.v_shm_offset, data_size); | |
2070 if (v == NULL) { | |
2071 return error::kOutOfBounds; | |
2072 } | |
2073 DoUniform2fv(location, count, v); | |
2074 return error::kNoError; | |
2075 } | |
2076 | |
2077 error::Error GLES2DecoderImpl::HandleUniform2fvImmediate( | 1827 error::Error GLES2DecoderImpl::HandleUniform2fvImmediate( |
2078 uint32_t immediate_data_size, | 1828 uint32_t immediate_data_size, |
2079 const gles2::cmds::Uniform2fvImmediate& c) { | 1829 const gles2::cmds::Uniform2fvImmediate& c) { |
2080 GLint location = static_cast<GLint>(c.location); | 1830 GLint location = static_cast<GLint>(c.location); |
2081 GLsizei count = static_cast<GLsizei>(c.count); | 1831 GLsizei count = static_cast<GLsizei>(c.count); |
2082 uint32_t data_size; | 1832 uint32_t data_size; |
2083 if (!ComputeDataSize(count, sizeof(GLfloat), 2, &data_size)) { | 1833 if (!ComputeDataSize(count, sizeof(GLfloat), 2, &data_size)) { |
2084 return error::kOutOfBounds; | 1834 return error::kOutOfBounds; |
2085 } | 1835 } |
2086 if (data_size > immediate_data_size) { | 1836 if (data_size > immediate_data_size) { |
(...skipping 14 matching lines...) Expand all Loading... |
2101 GLint location = static_cast<GLint>(c.location); | 1851 GLint location = static_cast<GLint>(c.location); |
2102 GLint x = static_cast<GLint>(c.x); | 1852 GLint x = static_cast<GLint>(c.x); |
2103 GLint y = static_cast<GLint>(c.y); | 1853 GLint y = static_cast<GLint>(c.y); |
2104 GLint temp[2] = { | 1854 GLint temp[2] = { |
2105 x, y, | 1855 x, y, |
2106 }; | 1856 }; |
2107 DoUniform2iv(location, 1, &temp[0]); | 1857 DoUniform2iv(location, 1, &temp[0]); |
2108 return error::kNoError; | 1858 return error::kNoError; |
2109 } | 1859 } |
2110 | 1860 |
2111 error::Error GLES2DecoderImpl::HandleUniform2iv( | |
2112 uint32_t immediate_data_size, | |
2113 const gles2::cmds::Uniform2iv& c) { | |
2114 GLint location = static_cast<GLint>(c.location); | |
2115 GLsizei count = static_cast<GLsizei>(c.count); | |
2116 uint32_t data_size; | |
2117 if (!ComputeDataSize(count, sizeof(GLint), 2, &data_size)) { | |
2118 return error::kOutOfBounds; | |
2119 } | |
2120 const GLint* v = | |
2121 GetSharedMemoryAs<const GLint*>(c.v_shm_id, c.v_shm_offset, data_size); | |
2122 if (v == NULL) { | |
2123 return error::kOutOfBounds; | |
2124 } | |
2125 DoUniform2iv(location, count, v); | |
2126 return error::kNoError; | |
2127 } | |
2128 | |
2129 error::Error GLES2DecoderImpl::HandleUniform2ivImmediate( | 1861 error::Error GLES2DecoderImpl::HandleUniform2ivImmediate( |
2130 uint32_t immediate_data_size, | 1862 uint32_t immediate_data_size, |
2131 const gles2::cmds::Uniform2ivImmediate& c) { | 1863 const gles2::cmds::Uniform2ivImmediate& c) { |
2132 GLint location = static_cast<GLint>(c.location); | 1864 GLint location = static_cast<GLint>(c.location); |
2133 GLsizei count = static_cast<GLsizei>(c.count); | 1865 GLsizei count = static_cast<GLsizei>(c.count); |
2134 uint32_t data_size; | 1866 uint32_t data_size; |
2135 if (!ComputeDataSize(count, sizeof(GLint), 2, &data_size)) { | 1867 if (!ComputeDataSize(count, sizeof(GLint), 2, &data_size)) { |
2136 return error::kOutOfBounds; | 1868 return error::kOutOfBounds; |
2137 } | 1869 } |
2138 if (data_size > immediate_data_size) { | 1870 if (data_size > immediate_data_size) { |
(...skipping 15 matching lines...) Expand all Loading... |
2154 GLfloat x = static_cast<GLfloat>(c.x); | 1886 GLfloat x = static_cast<GLfloat>(c.x); |
2155 GLfloat y = static_cast<GLfloat>(c.y); | 1887 GLfloat y = static_cast<GLfloat>(c.y); |
2156 GLfloat z = static_cast<GLfloat>(c.z); | 1888 GLfloat z = static_cast<GLfloat>(c.z); |
2157 GLfloat temp[3] = { | 1889 GLfloat temp[3] = { |
2158 x, y, z, | 1890 x, y, z, |
2159 }; | 1891 }; |
2160 DoUniform3fv(location, 1, &temp[0]); | 1892 DoUniform3fv(location, 1, &temp[0]); |
2161 return error::kNoError; | 1893 return error::kNoError; |
2162 } | 1894 } |
2163 | 1895 |
2164 error::Error GLES2DecoderImpl::HandleUniform3fv( | |
2165 uint32_t immediate_data_size, | |
2166 const gles2::cmds::Uniform3fv& c) { | |
2167 GLint location = static_cast<GLint>(c.location); | |
2168 GLsizei count = static_cast<GLsizei>(c.count); | |
2169 uint32_t data_size; | |
2170 if (!ComputeDataSize(count, sizeof(GLfloat), 3, &data_size)) { | |
2171 return error::kOutOfBounds; | |
2172 } | |
2173 const GLfloat* v = | |
2174 GetSharedMemoryAs<const GLfloat*>(c.v_shm_id, c.v_shm_offset, data_size); | |
2175 if (v == NULL) { | |
2176 return error::kOutOfBounds; | |
2177 } | |
2178 DoUniform3fv(location, count, v); | |
2179 return error::kNoError; | |
2180 } | |
2181 | |
2182 error::Error GLES2DecoderImpl::HandleUniform3fvImmediate( | 1896 error::Error GLES2DecoderImpl::HandleUniform3fvImmediate( |
2183 uint32_t immediate_data_size, | 1897 uint32_t immediate_data_size, |
2184 const gles2::cmds::Uniform3fvImmediate& c) { | 1898 const gles2::cmds::Uniform3fvImmediate& c) { |
2185 GLint location = static_cast<GLint>(c.location); | 1899 GLint location = static_cast<GLint>(c.location); |
2186 GLsizei count = static_cast<GLsizei>(c.count); | 1900 GLsizei count = static_cast<GLsizei>(c.count); |
2187 uint32_t data_size; | 1901 uint32_t data_size; |
2188 if (!ComputeDataSize(count, sizeof(GLfloat), 3, &data_size)) { | 1902 if (!ComputeDataSize(count, sizeof(GLfloat), 3, &data_size)) { |
2189 return error::kOutOfBounds; | 1903 return error::kOutOfBounds; |
2190 } | 1904 } |
2191 if (data_size > immediate_data_size) { | 1905 if (data_size > immediate_data_size) { |
(...skipping 15 matching lines...) Expand all Loading... |
2207 GLint x = static_cast<GLint>(c.x); | 1921 GLint x = static_cast<GLint>(c.x); |
2208 GLint y = static_cast<GLint>(c.y); | 1922 GLint y = static_cast<GLint>(c.y); |
2209 GLint z = static_cast<GLint>(c.z); | 1923 GLint z = static_cast<GLint>(c.z); |
2210 GLint temp[3] = { | 1924 GLint temp[3] = { |
2211 x, y, z, | 1925 x, y, z, |
2212 }; | 1926 }; |
2213 DoUniform3iv(location, 1, &temp[0]); | 1927 DoUniform3iv(location, 1, &temp[0]); |
2214 return error::kNoError; | 1928 return error::kNoError; |
2215 } | 1929 } |
2216 | 1930 |
2217 error::Error GLES2DecoderImpl::HandleUniform3iv( | |
2218 uint32_t immediate_data_size, | |
2219 const gles2::cmds::Uniform3iv& c) { | |
2220 GLint location = static_cast<GLint>(c.location); | |
2221 GLsizei count = static_cast<GLsizei>(c.count); | |
2222 uint32_t data_size; | |
2223 if (!ComputeDataSize(count, sizeof(GLint), 3, &data_size)) { | |
2224 return error::kOutOfBounds; | |
2225 } | |
2226 const GLint* v = | |
2227 GetSharedMemoryAs<const GLint*>(c.v_shm_id, c.v_shm_offset, data_size); | |
2228 if (v == NULL) { | |
2229 return error::kOutOfBounds; | |
2230 } | |
2231 DoUniform3iv(location, count, v); | |
2232 return error::kNoError; | |
2233 } | |
2234 | |
2235 error::Error GLES2DecoderImpl::HandleUniform3ivImmediate( | 1931 error::Error GLES2DecoderImpl::HandleUniform3ivImmediate( |
2236 uint32_t immediate_data_size, | 1932 uint32_t immediate_data_size, |
2237 const gles2::cmds::Uniform3ivImmediate& c) { | 1933 const gles2::cmds::Uniform3ivImmediate& c) { |
2238 GLint location = static_cast<GLint>(c.location); | 1934 GLint location = static_cast<GLint>(c.location); |
2239 GLsizei count = static_cast<GLsizei>(c.count); | 1935 GLsizei count = static_cast<GLsizei>(c.count); |
2240 uint32_t data_size; | 1936 uint32_t data_size; |
2241 if (!ComputeDataSize(count, sizeof(GLint), 3, &data_size)) { | 1937 if (!ComputeDataSize(count, sizeof(GLint), 3, &data_size)) { |
2242 return error::kOutOfBounds; | 1938 return error::kOutOfBounds; |
2243 } | 1939 } |
2244 if (data_size > immediate_data_size) { | 1940 if (data_size > immediate_data_size) { |
(...skipping 16 matching lines...) Expand all Loading... |
2261 GLfloat y = static_cast<GLfloat>(c.y); | 1957 GLfloat y = static_cast<GLfloat>(c.y); |
2262 GLfloat z = static_cast<GLfloat>(c.z); | 1958 GLfloat z = static_cast<GLfloat>(c.z); |
2263 GLfloat w = static_cast<GLfloat>(c.w); | 1959 GLfloat w = static_cast<GLfloat>(c.w); |
2264 GLfloat temp[4] = { | 1960 GLfloat temp[4] = { |
2265 x, y, z, w, | 1961 x, y, z, w, |
2266 }; | 1962 }; |
2267 DoUniform4fv(location, 1, &temp[0]); | 1963 DoUniform4fv(location, 1, &temp[0]); |
2268 return error::kNoError; | 1964 return error::kNoError; |
2269 } | 1965 } |
2270 | 1966 |
2271 error::Error GLES2DecoderImpl::HandleUniform4fv( | |
2272 uint32_t immediate_data_size, | |
2273 const gles2::cmds::Uniform4fv& c) { | |
2274 GLint location = static_cast<GLint>(c.location); | |
2275 GLsizei count = static_cast<GLsizei>(c.count); | |
2276 uint32_t data_size; | |
2277 if (!ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { | |
2278 return error::kOutOfBounds; | |
2279 } | |
2280 const GLfloat* v = | |
2281 GetSharedMemoryAs<const GLfloat*>(c.v_shm_id, c.v_shm_offset, data_size); | |
2282 if (v == NULL) { | |
2283 return error::kOutOfBounds; | |
2284 } | |
2285 DoUniform4fv(location, count, v); | |
2286 return error::kNoError; | |
2287 } | |
2288 | |
2289 error::Error GLES2DecoderImpl::HandleUniform4fvImmediate( | 1967 error::Error GLES2DecoderImpl::HandleUniform4fvImmediate( |
2290 uint32_t immediate_data_size, | 1968 uint32_t immediate_data_size, |
2291 const gles2::cmds::Uniform4fvImmediate& c) { | 1969 const gles2::cmds::Uniform4fvImmediate& c) { |
2292 GLint location = static_cast<GLint>(c.location); | 1970 GLint location = static_cast<GLint>(c.location); |
2293 GLsizei count = static_cast<GLsizei>(c.count); | 1971 GLsizei count = static_cast<GLsizei>(c.count); |
2294 uint32_t data_size; | 1972 uint32_t data_size; |
2295 if (!ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { | 1973 if (!ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { |
2296 return error::kOutOfBounds; | 1974 return error::kOutOfBounds; |
2297 } | 1975 } |
2298 if (data_size > immediate_data_size) { | 1976 if (data_size > immediate_data_size) { |
(...skipping 16 matching lines...) Expand all Loading... |
2315 GLint y = static_cast<GLint>(c.y); | 1993 GLint y = static_cast<GLint>(c.y); |
2316 GLint z = static_cast<GLint>(c.z); | 1994 GLint z = static_cast<GLint>(c.z); |
2317 GLint w = static_cast<GLint>(c.w); | 1995 GLint w = static_cast<GLint>(c.w); |
2318 GLint temp[4] = { | 1996 GLint temp[4] = { |
2319 x, y, z, w, | 1997 x, y, z, w, |
2320 }; | 1998 }; |
2321 DoUniform4iv(location, 1, &temp[0]); | 1999 DoUniform4iv(location, 1, &temp[0]); |
2322 return error::kNoError; | 2000 return error::kNoError; |
2323 } | 2001 } |
2324 | 2002 |
2325 error::Error GLES2DecoderImpl::HandleUniform4iv( | |
2326 uint32_t immediate_data_size, | |
2327 const gles2::cmds::Uniform4iv& c) { | |
2328 GLint location = static_cast<GLint>(c.location); | |
2329 GLsizei count = static_cast<GLsizei>(c.count); | |
2330 uint32_t data_size; | |
2331 if (!ComputeDataSize(count, sizeof(GLint), 4, &data_size)) { | |
2332 return error::kOutOfBounds; | |
2333 } | |
2334 const GLint* v = | |
2335 GetSharedMemoryAs<const GLint*>(c.v_shm_id, c.v_shm_offset, data_size); | |
2336 if (v == NULL) { | |
2337 return error::kOutOfBounds; | |
2338 } | |
2339 DoUniform4iv(location, count, v); | |
2340 return error::kNoError; | |
2341 } | |
2342 | |
2343 error::Error GLES2DecoderImpl::HandleUniform4ivImmediate( | 2003 error::Error GLES2DecoderImpl::HandleUniform4ivImmediate( |
2344 uint32_t immediate_data_size, | 2004 uint32_t immediate_data_size, |
2345 const gles2::cmds::Uniform4ivImmediate& c) { | 2005 const gles2::cmds::Uniform4ivImmediate& c) { |
2346 GLint location = static_cast<GLint>(c.location); | 2006 GLint location = static_cast<GLint>(c.location); |
2347 GLsizei count = static_cast<GLsizei>(c.count); | 2007 GLsizei count = static_cast<GLsizei>(c.count); |
2348 uint32_t data_size; | 2008 uint32_t data_size; |
2349 if (!ComputeDataSize(count, sizeof(GLint), 4, &data_size)) { | 2009 if (!ComputeDataSize(count, sizeof(GLint), 4, &data_size)) { |
2350 return error::kOutOfBounds; | 2010 return error::kOutOfBounds; |
2351 } | 2011 } |
2352 if (data_size > immediate_data_size) { | 2012 if (data_size > immediate_data_size) { |
2353 return error::kOutOfBounds; | 2013 return error::kOutOfBounds; |
2354 } | 2014 } |
2355 const GLint* v = | 2015 const GLint* v = |
2356 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | 2016 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
2357 if (v == NULL) { | 2017 if (v == NULL) { |
2358 return error::kOutOfBounds; | 2018 return error::kOutOfBounds; |
2359 } | 2019 } |
2360 DoUniform4iv(location, count, v); | 2020 DoUniform4iv(location, count, v); |
2361 return error::kNoError; | 2021 return error::kNoError; |
2362 } | 2022 } |
2363 | 2023 |
2364 error::Error GLES2DecoderImpl::HandleUniformMatrix2fv( | |
2365 uint32_t immediate_data_size, | |
2366 const gles2::cmds::UniformMatrix2fv& c) { | |
2367 GLint location = static_cast<GLint>(c.location); | |
2368 GLsizei count = static_cast<GLsizei>(c.count); | |
2369 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
2370 uint32_t data_size; | |
2371 if (!ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { | |
2372 return error::kOutOfBounds; | |
2373 } | |
2374 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( | |
2375 c.value_shm_id, c.value_shm_offset, data_size); | |
2376 if (value == NULL) { | |
2377 return error::kOutOfBounds; | |
2378 } | |
2379 DoUniformMatrix2fv(location, count, transpose, value); | |
2380 return error::kNoError; | |
2381 } | |
2382 | |
2383 error::Error GLES2DecoderImpl::HandleUniformMatrix2fvImmediate( | 2024 error::Error GLES2DecoderImpl::HandleUniformMatrix2fvImmediate( |
2384 uint32_t immediate_data_size, | 2025 uint32_t immediate_data_size, |
2385 const gles2::cmds::UniformMatrix2fvImmediate& c) { | 2026 const gles2::cmds::UniformMatrix2fvImmediate& c) { |
2386 GLint location = static_cast<GLint>(c.location); | 2027 GLint location = static_cast<GLint>(c.location); |
2387 GLsizei count = static_cast<GLsizei>(c.count); | 2028 GLsizei count = static_cast<GLsizei>(c.count); |
2388 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2029 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
2389 uint32_t data_size; | 2030 uint32_t data_size; |
2390 if (!ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { | 2031 if (!ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { |
2391 return error::kOutOfBounds; | 2032 return error::kOutOfBounds; |
2392 } | 2033 } |
2393 if (data_size > immediate_data_size) { | 2034 if (data_size > immediate_data_size) { |
2394 return error::kOutOfBounds; | 2035 return error::kOutOfBounds; |
2395 } | 2036 } |
2396 const GLfloat* value = | 2037 const GLfloat* value = |
2397 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | 2038 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
2398 if (value == NULL) { | 2039 if (value == NULL) { |
2399 return error::kOutOfBounds; | 2040 return error::kOutOfBounds; |
2400 } | 2041 } |
2401 DoUniformMatrix2fv(location, count, transpose, value); | 2042 DoUniformMatrix2fv(location, count, transpose, value); |
2402 return error::kNoError; | 2043 return error::kNoError; |
2403 } | 2044 } |
2404 | 2045 |
2405 error::Error GLES2DecoderImpl::HandleUniformMatrix3fv( | |
2406 uint32_t immediate_data_size, | |
2407 const gles2::cmds::UniformMatrix3fv& c) { | |
2408 GLint location = static_cast<GLint>(c.location); | |
2409 GLsizei count = static_cast<GLsizei>(c.count); | |
2410 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
2411 uint32_t data_size; | |
2412 if (!ComputeDataSize(count, sizeof(GLfloat), 9, &data_size)) { | |
2413 return error::kOutOfBounds; | |
2414 } | |
2415 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( | |
2416 c.value_shm_id, c.value_shm_offset, data_size); | |
2417 if (value == NULL) { | |
2418 return error::kOutOfBounds; | |
2419 } | |
2420 DoUniformMatrix3fv(location, count, transpose, value); | |
2421 return error::kNoError; | |
2422 } | |
2423 | |
2424 error::Error GLES2DecoderImpl::HandleUniformMatrix3fvImmediate( | 2046 error::Error GLES2DecoderImpl::HandleUniformMatrix3fvImmediate( |
2425 uint32_t immediate_data_size, | 2047 uint32_t immediate_data_size, |
2426 const gles2::cmds::UniformMatrix3fvImmediate& c) { | 2048 const gles2::cmds::UniformMatrix3fvImmediate& c) { |
2427 GLint location = static_cast<GLint>(c.location); | 2049 GLint location = static_cast<GLint>(c.location); |
2428 GLsizei count = static_cast<GLsizei>(c.count); | 2050 GLsizei count = static_cast<GLsizei>(c.count); |
2429 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2051 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
2430 uint32_t data_size; | 2052 uint32_t data_size; |
2431 if (!ComputeDataSize(count, sizeof(GLfloat), 9, &data_size)) { | 2053 if (!ComputeDataSize(count, sizeof(GLfloat), 9, &data_size)) { |
2432 return error::kOutOfBounds; | 2054 return error::kOutOfBounds; |
2433 } | 2055 } |
2434 if (data_size > immediate_data_size) { | 2056 if (data_size > immediate_data_size) { |
2435 return error::kOutOfBounds; | 2057 return error::kOutOfBounds; |
2436 } | 2058 } |
2437 const GLfloat* value = | 2059 const GLfloat* value = |
2438 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | 2060 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
2439 if (value == NULL) { | 2061 if (value == NULL) { |
2440 return error::kOutOfBounds; | 2062 return error::kOutOfBounds; |
2441 } | 2063 } |
2442 DoUniformMatrix3fv(location, count, transpose, value); | 2064 DoUniformMatrix3fv(location, count, transpose, value); |
2443 return error::kNoError; | 2065 return error::kNoError; |
2444 } | 2066 } |
2445 | 2067 |
2446 error::Error GLES2DecoderImpl::HandleUniformMatrix4fv( | |
2447 uint32_t immediate_data_size, | |
2448 const gles2::cmds::UniformMatrix4fv& c) { | |
2449 GLint location = static_cast<GLint>(c.location); | |
2450 GLsizei count = static_cast<GLsizei>(c.count); | |
2451 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
2452 uint32_t data_size; | |
2453 if (!ComputeDataSize(count, sizeof(GLfloat), 16, &data_size)) { | |
2454 return error::kOutOfBounds; | |
2455 } | |
2456 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( | |
2457 c.value_shm_id, c.value_shm_offset, data_size); | |
2458 if (value == NULL) { | |
2459 return error::kOutOfBounds; | |
2460 } | |
2461 DoUniformMatrix4fv(location, count, transpose, value); | |
2462 return error::kNoError; | |
2463 } | |
2464 | |
2465 error::Error GLES2DecoderImpl::HandleUniformMatrix4fvImmediate( | 2068 error::Error GLES2DecoderImpl::HandleUniformMatrix4fvImmediate( |
2466 uint32_t immediate_data_size, | 2069 uint32_t immediate_data_size, |
2467 const gles2::cmds::UniformMatrix4fvImmediate& c) { | 2070 const gles2::cmds::UniformMatrix4fvImmediate& c) { |
2468 GLint location = static_cast<GLint>(c.location); | 2071 GLint location = static_cast<GLint>(c.location); |
2469 GLsizei count = static_cast<GLsizei>(c.count); | 2072 GLsizei count = static_cast<GLsizei>(c.count); |
2470 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2073 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
2471 uint32_t data_size; | 2074 uint32_t data_size; |
2472 if (!ComputeDataSize(count, sizeof(GLfloat), 16, &data_size)) { | 2075 if (!ComputeDataSize(count, sizeof(GLfloat), 16, &data_size)) { |
2473 return error::kOutOfBounds; | 2076 return error::kOutOfBounds; |
2474 } | 2077 } |
(...skipping 27 matching lines...) Expand all Loading... |
2502 | 2105 |
2503 error::Error GLES2DecoderImpl::HandleVertexAttrib1f( | 2106 error::Error GLES2DecoderImpl::HandleVertexAttrib1f( |
2504 uint32_t immediate_data_size, | 2107 uint32_t immediate_data_size, |
2505 const gles2::cmds::VertexAttrib1f& c) { | 2108 const gles2::cmds::VertexAttrib1f& c) { |
2506 GLuint indx = static_cast<GLuint>(c.indx); | 2109 GLuint indx = static_cast<GLuint>(c.indx); |
2507 GLfloat x = static_cast<GLfloat>(c.x); | 2110 GLfloat x = static_cast<GLfloat>(c.x); |
2508 DoVertexAttrib1f(indx, x); | 2111 DoVertexAttrib1f(indx, x); |
2509 return error::kNoError; | 2112 return error::kNoError; |
2510 } | 2113 } |
2511 | 2114 |
2512 error::Error GLES2DecoderImpl::HandleVertexAttrib1fv( | |
2513 uint32_t immediate_data_size, | |
2514 const gles2::cmds::VertexAttrib1fv& c) { | |
2515 GLuint indx = static_cast<GLuint>(c.indx); | |
2516 uint32_t data_size; | |
2517 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | |
2518 return error::kOutOfBounds; | |
2519 } | |
2520 const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( | |
2521 c.values_shm_id, c.values_shm_offset, data_size); | |
2522 if (values == NULL) { | |
2523 return error::kOutOfBounds; | |
2524 } | |
2525 DoVertexAttrib1fv(indx, values); | |
2526 return error::kNoError; | |
2527 } | |
2528 | |
2529 error::Error GLES2DecoderImpl::HandleVertexAttrib1fvImmediate( | 2115 error::Error GLES2DecoderImpl::HandleVertexAttrib1fvImmediate( |
2530 uint32_t immediate_data_size, | 2116 uint32_t immediate_data_size, |
2531 const gles2::cmds::VertexAttrib1fvImmediate& c) { | 2117 const gles2::cmds::VertexAttrib1fvImmediate& c) { |
2532 GLuint indx = static_cast<GLuint>(c.indx); | 2118 GLuint indx = static_cast<GLuint>(c.indx); |
2533 uint32_t data_size; | 2119 uint32_t data_size; |
2534 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | 2120 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
2535 return error::kOutOfBounds; | 2121 return error::kOutOfBounds; |
2536 } | 2122 } |
2537 if (data_size > immediate_data_size) { | 2123 if (data_size > immediate_data_size) { |
2538 return error::kOutOfBounds; | 2124 return error::kOutOfBounds; |
(...skipping 10 matching lines...) Expand all Loading... |
2549 error::Error GLES2DecoderImpl::HandleVertexAttrib2f( | 2135 error::Error GLES2DecoderImpl::HandleVertexAttrib2f( |
2550 uint32_t immediate_data_size, | 2136 uint32_t immediate_data_size, |
2551 const gles2::cmds::VertexAttrib2f& c) { | 2137 const gles2::cmds::VertexAttrib2f& c) { |
2552 GLuint indx = static_cast<GLuint>(c.indx); | 2138 GLuint indx = static_cast<GLuint>(c.indx); |
2553 GLfloat x = static_cast<GLfloat>(c.x); | 2139 GLfloat x = static_cast<GLfloat>(c.x); |
2554 GLfloat y = static_cast<GLfloat>(c.y); | 2140 GLfloat y = static_cast<GLfloat>(c.y); |
2555 DoVertexAttrib2f(indx, x, y); | 2141 DoVertexAttrib2f(indx, x, y); |
2556 return error::kNoError; | 2142 return error::kNoError; |
2557 } | 2143 } |
2558 | 2144 |
2559 error::Error GLES2DecoderImpl::HandleVertexAttrib2fv( | |
2560 uint32_t immediate_data_size, | |
2561 const gles2::cmds::VertexAttrib2fv& c) { | |
2562 GLuint indx = static_cast<GLuint>(c.indx); | |
2563 uint32_t data_size; | |
2564 if (!ComputeDataSize(1, sizeof(GLfloat), 2, &data_size)) { | |
2565 return error::kOutOfBounds; | |
2566 } | |
2567 const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( | |
2568 c.values_shm_id, c.values_shm_offset, data_size); | |
2569 if (values == NULL) { | |
2570 return error::kOutOfBounds; | |
2571 } | |
2572 DoVertexAttrib2fv(indx, values); | |
2573 return error::kNoError; | |
2574 } | |
2575 | |
2576 error::Error GLES2DecoderImpl::HandleVertexAttrib2fvImmediate( | 2145 error::Error GLES2DecoderImpl::HandleVertexAttrib2fvImmediate( |
2577 uint32_t immediate_data_size, | 2146 uint32_t immediate_data_size, |
2578 const gles2::cmds::VertexAttrib2fvImmediate& c) { | 2147 const gles2::cmds::VertexAttrib2fvImmediate& c) { |
2579 GLuint indx = static_cast<GLuint>(c.indx); | 2148 GLuint indx = static_cast<GLuint>(c.indx); |
2580 uint32_t data_size; | 2149 uint32_t data_size; |
2581 if (!ComputeDataSize(1, sizeof(GLfloat), 2, &data_size)) { | 2150 if (!ComputeDataSize(1, sizeof(GLfloat), 2, &data_size)) { |
2582 return error::kOutOfBounds; | 2151 return error::kOutOfBounds; |
2583 } | 2152 } |
2584 if (data_size > immediate_data_size) { | 2153 if (data_size > immediate_data_size) { |
2585 return error::kOutOfBounds; | 2154 return error::kOutOfBounds; |
(...skipping 11 matching lines...) Expand all Loading... |
2597 uint32_t immediate_data_size, | 2166 uint32_t immediate_data_size, |
2598 const gles2::cmds::VertexAttrib3f& c) { | 2167 const gles2::cmds::VertexAttrib3f& c) { |
2599 GLuint indx = static_cast<GLuint>(c.indx); | 2168 GLuint indx = static_cast<GLuint>(c.indx); |
2600 GLfloat x = static_cast<GLfloat>(c.x); | 2169 GLfloat x = static_cast<GLfloat>(c.x); |
2601 GLfloat y = static_cast<GLfloat>(c.y); | 2170 GLfloat y = static_cast<GLfloat>(c.y); |
2602 GLfloat z = static_cast<GLfloat>(c.z); | 2171 GLfloat z = static_cast<GLfloat>(c.z); |
2603 DoVertexAttrib3f(indx, x, y, z); | 2172 DoVertexAttrib3f(indx, x, y, z); |
2604 return error::kNoError; | 2173 return error::kNoError; |
2605 } | 2174 } |
2606 | 2175 |
2607 error::Error GLES2DecoderImpl::HandleVertexAttrib3fv( | |
2608 uint32_t immediate_data_size, | |
2609 const gles2::cmds::VertexAttrib3fv& c) { | |
2610 GLuint indx = static_cast<GLuint>(c.indx); | |
2611 uint32_t data_size; | |
2612 if (!ComputeDataSize(1, sizeof(GLfloat), 3, &data_size)) { | |
2613 return error::kOutOfBounds; | |
2614 } | |
2615 const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( | |
2616 c.values_shm_id, c.values_shm_offset, data_size); | |
2617 if (values == NULL) { | |
2618 return error::kOutOfBounds; | |
2619 } | |
2620 DoVertexAttrib3fv(indx, values); | |
2621 return error::kNoError; | |
2622 } | |
2623 | |
2624 error::Error GLES2DecoderImpl::HandleVertexAttrib3fvImmediate( | 2176 error::Error GLES2DecoderImpl::HandleVertexAttrib3fvImmediate( |
2625 uint32_t immediate_data_size, | 2177 uint32_t immediate_data_size, |
2626 const gles2::cmds::VertexAttrib3fvImmediate& c) { | 2178 const gles2::cmds::VertexAttrib3fvImmediate& c) { |
2627 GLuint indx = static_cast<GLuint>(c.indx); | 2179 GLuint indx = static_cast<GLuint>(c.indx); |
2628 uint32_t data_size; | 2180 uint32_t data_size; |
2629 if (!ComputeDataSize(1, sizeof(GLfloat), 3, &data_size)) { | 2181 if (!ComputeDataSize(1, sizeof(GLfloat), 3, &data_size)) { |
2630 return error::kOutOfBounds; | 2182 return error::kOutOfBounds; |
2631 } | 2183 } |
2632 if (data_size > immediate_data_size) { | 2184 if (data_size > immediate_data_size) { |
2633 return error::kOutOfBounds; | 2185 return error::kOutOfBounds; |
(...skipping 12 matching lines...) Expand all Loading... |
2646 const gles2::cmds::VertexAttrib4f& c) { | 2198 const gles2::cmds::VertexAttrib4f& c) { |
2647 GLuint indx = static_cast<GLuint>(c.indx); | 2199 GLuint indx = static_cast<GLuint>(c.indx); |
2648 GLfloat x = static_cast<GLfloat>(c.x); | 2200 GLfloat x = static_cast<GLfloat>(c.x); |
2649 GLfloat y = static_cast<GLfloat>(c.y); | 2201 GLfloat y = static_cast<GLfloat>(c.y); |
2650 GLfloat z = static_cast<GLfloat>(c.z); | 2202 GLfloat z = static_cast<GLfloat>(c.z); |
2651 GLfloat w = static_cast<GLfloat>(c.w); | 2203 GLfloat w = static_cast<GLfloat>(c.w); |
2652 DoVertexAttrib4f(indx, x, y, z, w); | 2204 DoVertexAttrib4f(indx, x, y, z, w); |
2653 return error::kNoError; | 2205 return error::kNoError; |
2654 } | 2206 } |
2655 | 2207 |
2656 error::Error GLES2DecoderImpl::HandleVertexAttrib4fv( | |
2657 uint32_t immediate_data_size, | |
2658 const gles2::cmds::VertexAttrib4fv& c) { | |
2659 GLuint indx = static_cast<GLuint>(c.indx); | |
2660 uint32_t data_size; | |
2661 if (!ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { | |
2662 return error::kOutOfBounds; | |
2663 } | |
2664 const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( | |
2665 c.values_shm_id, c.values_shm_offset, data_size); | |
2666 if (values == NULL) { | |
2667 return error::kOutOfBounds; | |
2668 } | |
2669 DoVertexAttrib4fv(indx, values); | |
2670 return error::kNoError; | |
2671 } | |
2672 | |
2673 error::Error GLES2DecoderImpl::HandleVertexAttrib4fvImmediate( | 2208 error::Error GLES2DecoderImpl::HandleVertexAttrib4fvImmediate( |
2674 uint32_t immediate_data_size, | 2209 uint32_t immediate_data_size, |
2675 const gles2::cmds::VertexAttrib4fvImmediate& c) { | 2210 const gles2::cmds::VertexAttrib4fvImmediate& c) { |
2676 GLuint indx = static_cast<GLuint>(c.indx); | 2211 GLuint indx = static_cast<GLuint>(c.indx); |
2677 uint32_t data_size; | 2212 uint32_t data_size; |
2678 if (!ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { | 2213 if (!ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { |
2679 return error::kOutOfBounds; | 2214 return error::kOutOfBounds; |
2680 } | 2215 } |
2681 if (data_size > immediate_data_size) { | 2216 if (data_size > immediate_data_size) { |
2682 return error::kOutOfBounds; | 2217 return error::kOutOfBounds; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2908 return error::kNoError; | 2443 return error::kNoError; |
2909 } | 2444 } |
2910 if (height < 0) { | 2445 if (height < 0) { |
2911 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage2DEXT", "height < 0"); | 2446 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage2DEXT", "height < 0"); |
2912 return error::kNoError; | 2447 return error::kNoError; |
2913 } | 2448 } |
2914 DoTexStorage2DEXT(target, levels, internalFormat, width, height); | 2449 DoTexStorage2DEXT(target, levels, internalFormat, width, height); |
2915 return error::kNoError; | 2450 return error::kNoError; |
2916 } | 2451 } |
2917 | 2452 |
2918 error::Error GLES2DecoderImpl::HandleGenQueriesEXT( | |
2919 uint32_t immediate_data_size, | |
2920 const gles2::cmds::GenQueriesEXT& c) { | |
2921 GLsizei n = static_cast<GLsizei>(c.n); | |
2922 uint32_t data_size; | |
2923 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
2924 return error::kOutOfBounds; | |
2925 } | |
2926 GLuint* queries = GetSharedMemoryAs<GLuint*>( | |
2927 c.queries_shm_id, c.queries_shm_offset, data_size); | |
2928 if (queries == NULL) { | |
2929 return error::kOutOfBounds; | |
2930 } | |
2931 if (!GenQueriesEXTHelper(n, queries)) { | |
2932 return error::kInvalidArguments; | |
2933 } | |
2934 return error::kNoError; | |
2935 } | |
2936 | |
2937 error::Error GLES2DecoderImpl::HandleGenQueriesEXTImmediate( | 2453 error::Error GLES2DecoderImpl::HandleGenQueriesEXTImmediate( |
2938 uint32_t immediate_data_size, | 2454 uint32_t immediate_data_size, |
2939 const gles2::cmds::GenQueriesEXTImmediate& c) { | 2455 const gles2::cmds::GenQueriesEXTImmediate& c) { |
2940 GLsizei n = static_cast<GLsizei>(c.n); | 2456 GLsizei n = static_cast<GLsizei>(c.n); |
2941 uint32_t data_size; | 2457 uint32_t data_size; |
2942 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 2458 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
2943 return error::kOutOfBounds; | 2459 return error::kOutOfBounds; |
2944 } | 2460 } |
2945 GLuint* queries = | 2461 GLuint* queries = |
2946 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | 2462 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
2947 if (queries == NULL) { | 2463 if (queries == NULL) { |
2948 return error::kOutOfBounds; | 2464 return error::kOutOfBounds; |
2949 } | 2465 } |
2950 if (!GenQueriesEXTHelper(n, queries)) { | 2466 if (!GenQueriesEXTHelper(n, queries)) { |
2951 return error::kInvalidArguments; | 2467 return error::kInvalidArguments; |
2952 } | 2468 } |
2953 return error::kNoError; | 2469 return error::kNoError; |
2954 } | 2470 } |
2955 | 2471 |
2956 error::Error GLES2DecoderImpl::HandleDeleteQueriesEXT( | |
2957 uint32_t immediate_data_size, | |
2958 const gles2::cmds::DeleteQueriesEXT& c) { | |
2959 GLsizei n = static_cast<GLsizei>(c.n); | |
2960 uint32_t data_size; | |
2961 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
2962 return error::kOutOfBounds; | |
2963 } | |
2964 const GLuint* queries = GetSharedMemoryAs<const GLuint*>( | |
2965 c.queries_shm_id, c.queries_shm_offset, data_size); | |
2966 if (queries == NULL) { | |
2967 return error::kOutOfBounds; | |
2968 } | |
2969 DeleteQueriesEXTHelper(n, queries); | |
2970 return error::kNoError; | |
2971 } | |
2972 | |
2973 error::Error GLES2DecoderImpl::HandleDeleteQueriesEXTImmediate( | 2472 error::Error GLES2DecoderImpl::HandleDeleteQueriesEXTImmediate( |
2974 uint32_t immediate_data_size, | 2473 uint32_t immediate_data_size, |
2975 const gles2::cmds::DeleteQueriesEXTImmediate& c) { | 2474 const gles2::cmds::DeleteQueriesEXTImmediate& c) { |
2976 GLsizei n = static_cast<GLsizei>(c.n); | 2475 GLsizei n = static_cast<GLsizei>(c.n); |
2977 uint32_t data_size; | 2476 uint32_t data_size; |
2978 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 2477 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
2979 return error::kOutOfBounds; | 2478 return error::kOutOfBounds; |
2980 } | 2479 } |
2981 const GLuint* queries = | 2480 const GLuint* queries = |
2982 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | 2481 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3019 return error::kNoError; | 2518 return error::kNoError; |
3020 } | 2519 } |
3021 | 2520 |
3022 error::Error GLES2DecoderImpl::HandlePopGroupMarkerEXT( | 2521 error::Error GLES2DecoderImpl::HandlePopGroupMarkerEXT( |
3023 uint32_t immediate_data_size, | 2522 uint32_t immediate_data_size, |
3024 const gles2::cmds::PopGroupMarkerEXT& c) { | 2523 const gles2::cmds::PopGroupMarkerEXT& c) { |
3025 DoPopGroupMarkerEXT(); | 2524 DoPopGroupMarkerEXT(); |
3026 return error::kNoError; | 2525 return error::kNoError; |
3027 } | 2526 } |
3028 | 2527 |
3029 error::Error GLES2DecoderImpl::HandleGenVertexArraysOES( | |
3030 uint32_t immediate_data_size, | |
3031 const gles2::cmds::GenVertexArraysOES& c) { | |
3032 GLsizei n = static_cast<GLsizei>(c.n); | |
3033 uint32_t data_size; | |
3034 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
3035 return error::kOutOfBounds; | |
3036 } | |
3037 GLuint* arrays = GetSharedMemoryAs<GLuint*>( | |
3038 c.arrays_shm_id, c.arrays_shm_offset, data_size); | |
3039 if (arrays == NULL) { | |
3040 return error::kOutOfBounds; | |
3041 } | |
3042 if (!GenVertexArraysOESHelper(n, arrays)) { | |
3043 return error::kInvalidArguments; | |
3044 } | |
3045 return error::kNoError; | |
3046 } | |
3047 | |
3048 error::Error GLES2DecoderImpl::HandleGenVertexArraysOESImmediate( | 2528 error::Error GLES2DecoderImpl::HandleGenVertexArraysOESImmediate( |
3049 uint32_t immediate_data_size, | 2529 uint32_t immediate_data_size, |
3050 const gles2::cmds::GenVertexArraysOESImmediate& c) { | 2530 const gles2::cmds::GenVertexArraysOESImmediate& c) { |
3051 GLsizei n = static_cast<GLsizei>(c.n); | 2531 GLsizei n = static_cast<GLsizei>(c.n); |
3052 uint32_t data_size; | 2532 uint32_t data_size; |
3053 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 2533 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
3054 return error::kOutOfBounds; | 2534 return error::kOutOfBounds; |
3055 } | 2535 } |
3056 GLuint* arrays = | 2536 GLuint* arrays = |
3057 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | 2537 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
3058 if (arrays == NULL) { | 2538 if (arrays == NULL) { |
3059 return error::kOutOfBounds; | 2539 return error::kOutOfBounds; |
3060 } | 2540 } |
3061 if (!GenVertexArraysOESHelper(n, arrays)) { | 2541 if (!GenVertexArraysOESHelper(n, arrays)) { |
3062 return error::kInvalidArguments; | 2542 return error::kInvalidArguments; |
3063 } | 2543 } |
3064 return error::kNoError; | 2544 return error::kNoError; |
3065 } | 2545 } |
3066 | 2546 |
3067 error::Error GLES2DecoderImpl::HandleDeleteVertexArraysOES( | |
3068 uint32_t immediate_data_size, | |
3069 const gles2::cmds::DeleteVertexArraysOES& c) { | |
3070 GLsizei n = static_cast<GLsizei>(c.n); | |
3071 uint32_t data_size; | |
3072 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
3073 return error::kOutOfBounds; | |
3074 } | |
3075 const GLuint* arrays = GetSharedMemoryAs<const GLuint*>( | |
3076 c.arrays_shm_id, c.arrays_shm_offset, data_size); | |
3077 if (arrays == NULL) { | |
3078 return error::kOutOfBounds; | |
3079 } | |
3080 DeleteVertexArraysOESHelper(n, arrays); | |
3081 return error::kNoError; | |
3082 } | |
3083 | |
3084 error::Error GLES2DecoderImpl::HandleDeleteVertexArraysOESImmediate( | 2547 error::Error GLES2DecoderImpl::HandleDeleteVertexArraysOESImmediate( |
3085 uint32_t immediate_data_size, | 2548 uint32_t immediate_data_size, |
3086 const gles2::cmds::DeleteVertexArraysOESImmediate& c) { | 2549 const gles2::cmds::DeleteVertexArraysOESImmediate& c) { |
3087 GLsizei n = static_cast<GLsizei>(c.n); | 2550 GLsizei n = static_cast<GLsizei>(c.n); |
3088 uint32_t data_size; | 2551 uint32_t data_size; |
3089 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 2552 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
3090 return error::kOutOfBounds; | 2553 return error::kOutOfBounds; |
3091 } | 2554 } |
3092 const GLuint* arrays = | 2555 const GLuint* arrays = |
3093 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | 2556 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3199 if (!validators_->pixel_type.IsValid(dest_type)) { | 2662 if (!validators_->pixel_type.IsValid(dest_type)) { |
3200 LOCAL_SET_GL_ERROR_INVALID_ENUM( | 2663 LOCAL_SET_GL_ERROR_INVALID_ENUM( |
3201 "glCopyTextureCHROMIUM", dest_type, "dest_type"); | 2664 "glCopyTextureCHROMIUM", dest_type, "dest_type"); |
3202 return error::kNoError; | 2665 return error::kNoError; |
3203 } | 2666 } |
3204 DoCopyTextureCHROMIUM( | 2667 DoCopyTextureCHROMIUM( |
3205 target, source_id, dest_id, level, internalformat, dest_type); | 2668 target, source_id, dest_id, level, internalformat, dest_type); |
3206 return error::kNoError; | 2669 return error::kNoError; |
3207 } | 2670 } |
3208 | 2671 |
3209 error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUM( | |
3210 uint32_t immediate_data_size, | |
3211 const gles2::cmds::ProduceTextureCHROMIUM& c) { | |
3212 GLenum target = static_cast<GLenum>(c.target); | |
3213 uint32_t data_size; | |
3214 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | |
3215 return error::kOutOfBounds; | |
3216 } | |
3217 const GLbyte* mailbox = GetSharedMemoryAs<const GLbyte*>( | |
3218 c.mailbox_shm_id, c.mailbox_shm_offset, data_size); | |
3219 if (!validators_->texture_bind_target.IsValid(target)) { | |
3220 LOCAL_SET_GL_ERROR_INVALID_ENUM( | |
3221 "glProduceTextureCHROMIUM", target, "target"); | |
3222 return error::kNoError; | |
3223 } | |
3224 if (mailbox == NULL) { | |
3225 return error::kOutOfBounds; | |
3226 } | |
3227 DoProduceTextureCHROMIUM(target, mailbox); | |
3228 return error::kNoError; | |
3229 } | |
3230 | |
3231 error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUMImmediate( | 2672 error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUMImmediate( |
3232 uint32_t immediate_data_size, | 2673 uint32_t immediate_data_size, |
3233 const gles2::cmds::ProduceTextureCHROMIUMImmediate& c) { | 2674 const gles2::cmds::ProduceTextureCHROMIUMImmediate& c) { |
3234 GLenum target = static_cast<GLenum>(c.target); | 2675 GLenum target = static_cast<GLenum>(c.target); |
3235 uint32_t data_size; | 2676 uint32_t data_size; |
3236 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | 2677 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
3237 return error::kOutOfBounds; | 2678 return error::kOutOfBounds; |
3238 } | 2679 } |
3239 if (data_size > immediate_data_size) { | 2680 if (data_size > immediate_data_size) { |
3240 return error::kOutOfBounds; | 2681 return error::kOutOfBounds; |
3241 } | 2682 } |
3242 const GLbyte* mailbox = | 2683 const GLbyte* mailbox = |
3243 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); | 2684 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); |
3244 if (!validators_->texture_bind_target.IsValid(target)) { | 2685 if (!validators_->texture_bind_target.IsValid(target)) { |
3245 LOCAL_SET_GL_ERROR_INVALID_ENUM( | 2686 LOCAL_SET_GL_ERROR_INVALID_ENUM( |
3246 "glProduceTextureCHROMIUM", target, "target"); | 2687 "glProduceTextureCHROMIUM", target, "target"); |
3247 return error::kNoError; | 2688 return error::kNoError; |
3248 } | 2689 } |
3249 if (mailbox == NULL) { | 2690 if (mailbox == NULL) { |
3250 return error::kOutOfBounds; | 2691 return error::kOutOfBounds; |
3251 } | 2692 } |
3252 DoProduceTextureCHROMIUM(target, mailbox); | 2693 DoProduceTextureCHROMIUM(target, mailbox); |
3253 return error::kNoError; | 2694 return error::kNoError; |
3254 } | 2695 } |
3255 | 2696 |
3256 error::Error GLES2DecoderImpl::HandleConsumeTextureCHROMIUM( | |
3257 uint32_t immediate_data_size, | |
3258 const gles2::cmds::ConsumeTextureCHROMIUM& c) { | |
3259 GLenum target = static_cast<GLenum>(c.target); | |
3260 uint32_t data_size; | |
3261 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | |
3262 return error::kOutOfBounds; | |
3263 } | |
3264 const GLbyte* mailbox = GetSharedMemoryAs<const GLbyte*>( | |
3265 c.mailbox_shm_id, c.mailbox_shm_offset, data_size); | |
3266 if (!validators_->texture_bind_target.IsValid(target)) { | |
3267 LOCAL_SET_GL_ERROR_INVALID_ENUM( | |
3268 "glConsumeTextureCHROMIUM", target, "target"); | |
3269 return error::kNoError; | |
3270 } | |
3271 if (mailbox == NULL) { | |
3272 return error::kOutOfBounds; | |
3273 } | |
3274 DoConsumeTextureCHROMIUM(target, mailbox); | |
3275 return error::kNoError; | |
3276 } | |
3277 | |
3278 error::Error GLES2DecoderImpl::HandleConsumeTextureCHROMIUMImmediate( | 2697 error::Error GLES2DecoderImpl::HandleConsumeTextureCHROMIUMImmediate( |
3279 uint32_t immediate_data_size, | 2698 uint32_t immediate_data_size, |
3280 const gles2::cmds::ConsumeTextureCHROMIUMImmediate& c) { | 2699 const gles2::cmds::ConsumeTextureCHROMIUMImmediate& c) { |
3281 GLenum target = static_cast<GLenum>(c.target); | 2700 GLenum target = static_cast<GLenum>(c.target); |
3282 uint32_t data_size; | 2701 uint32_t data_size; |
3283 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | 2702 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
3284 return error::kOutOfBounds; | 2703 return error::kOutOfBounds; |
3285 } | 2704 } |
3286 if (data_size > immediate_data_size) { | 2705 if (data_size > immediate_data_size) { |
3287 return error::kOutOfBounds; | 2706 return error::kOutOfBounds; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3328 return error::kNoError; | 2747 return error::kNoError; |
3329 } | 2748 } |
3330 | 2749 |
3331 error::Error GLES2DecoderImpl::HandleTraceEndCHROMIUM( | 2750 error::Error GLES2DecoderImpl::HandleTraceEndCHROMIUM( |
3332 uint32_t immediate_data_size, | 2751 uint32_t immediate_data_size, |
3333 const gles2::cmds::TraceEndCHROMIUM& c) { | 2752 const gles2::cmds::TraceEndCHROMIUM& c) { |
3334 DoTraceEndCHROMIUM(); | 2753 DoTraceEndCHROMIUM(); |
3335 return error::kNoError; | 2754 return error::kNoError; |
3336 } | 2755 } |
3337 | 2756 |
3338 error::Error GLES2DecoderImpl::HandleDiscardFramebufferEXT( | |
3339 uint32_t immediate_data_size, | |
3340 const gles2::cmds::DiscardFramebufferEXT& c) { | |
3341 if (!features().ext_discard_framebuffer) { | |
3342 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | |
3343 "glDiscardFramebufferEXT", | |
3344 "function not available"); | |
3345 return error::kNoError; | |
3346 } | |
3347 | |
3348 GLenum target = static_cast<GLenum>(c.target); | |
3349 GLsizei count = static_cast<GLsizei>(c.count); | |
3350 uint32_t data_size; | |
3351 if (!ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { | |
3352 return error::kOutOfBounds; | |
3353 } | |
3354 const GLenum* attachments = GetSharedMemoryAs<const GLenum*>( | |
3355 c.attachments_shm_id, c.attachments_shm_offset, data_size); | |
3356 if (count < 0) { | |
3357 LOCAL_SET_GL_ERROR( | |
3358 GL_INVALID_VALUE, "glDiscardFramebufferEXT", "count < 0"); | |
3359 return error::kNoError; | |
3360 } | |
3361 if (attachments == NULL) { | |
3362 return error::kOutOfBounds; | |
3363 } | |
3364 DoDiscardFramebufferEXT(target, count, attachments); | |
3365 return error::kNoError; | |
3366 } | |
3367 | |
3368 error::Error GLES2DecoderImpl::HandleDiscardFramebufferEXTImmediate( | 2757 error::Error GLES2DecoderImpl::HandleDiscardFramebufferEXTImmediate( |
3369 uint32_t immediate_data_size, | 2758 uint32_t immediate_data_size, |
3370 const gles2::cmds::DiscardFramebufferEXTImmediate& c) { | 2759 const gles2::cmds::DiscardFramebufferEXTImmediate& c) { |
3371 if (!features().ext_discard_framebuffer) { | 2760 if (!features().ext_discard_framebuffer) { |
3372 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 2761 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
3373 "glDiscardFramebufferEXT", | 2762 "glDiscardFramebufferEXT", |
3374 "function not available"); | 2763 "function not available"); |
3375 return error::kNoError; | 2764 return error::kNoError; |
3376 } | 2765 } |
3377 | 2766 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3409 return error::kNoError; | 2798 return error::kNoError; |
3410 } | 2799 } |
3411 if (!validators_->reset_status.IsValid(other)) { | 2800 if (!validators_->reset_status.IsValid(other)) { |
3412 LOCAL_SET_GL_ERROR_INVALID_ENUM("glLoseContextCHROMIUM", other, "other"); | 2801 LOCAL_SET_GL_ERROR_INVALID_ENUM("glLoseContextCHROMIUM", other, "other"); |
3413 return error::kNoError; | 2802 return error::kNoError; |
3414 } | 2803 } |
3415 DoLoseContextCHROMIUM(current, other); | 2804 DoLoseContextCHROMIUM(current, other); |
3416 return error::kNoError; | 2805 return error::kNoError; |
3417 } | 2806 } |
3418 | 2807 |
3419 error::Error GLES2DecoderImpl::HandleDrawBuffersEXT( | |
3420 uint32_t immediate_data_size, | |
3421 const gles2::cmds::DrawBuffersEXT& c) { | |
3422 GLsizei count = static_cast<GLsizei>(c.count); | |
3423 uint32_t data_size; | |
3424 if (!ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { | |
3425 return error::kOutOfBounds; | |
3426 } | |
3427 const GLenum* bufs = GetSharedMemoryAs<const GLenum*>( | |
3428 c.bufs_shm_id, c.bufs_shm_offset, data_size); | |
3429 if (count < 0) { | |
3430 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glDrawBuffersEXT", "count < 0"); | |
3431 return error::kNoError; | |
3432 } | |
3433 if (bufs == NULL) { | |
3434 return error::kOutOfBounds; | |
3435 } | |
3436 DoDrawBuffersEXT(count, bufs); | |
3437 return error::kNoError; | |
3438 } | |
3439 | |
3440 error::Error GLES2DecoderImpl::HandleDrawBuffersEXTImmediate( | 2808 error::Error GLES2DecoderImpl::HandleDrawBuffersEXTImmediate( |
3441 uint32_t immediate_data_size, | 2809 uint32_t immediate_data_size, |
3442 const gles2::cmds::DrawBuffersEXTImmediate& c) { | 2810 const gles2::cmds::DrawBuffersEXTImmediate& c) { |
3443 GLsizei count = static_cast<GLsizei>(c.count); | 2811 GLsizei count = static_cast<GLsizei>(c.count); |
3444 uint32_t data_size; | 2812 uint32_t data_size; |
3445 if (!ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { | 2813 if (!ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { |
3446 return error::kOutOfBounds; | 2814 return error::kOutOfBounds; |
3447 } | 2815 } |
3448 if (data_size > immediate_data_size) { | 2816 if (data_size > immediate_data_size) { |
3449 return error::kOutOfBounds; | 2817 return error::kOutOfBounds; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3532 state_.ignore_cached_state) { | 2900 state_.ignore_cached_state) { |
3533 framebuffer_state_.clear_state_dirty = true; | 2901 framebuffer_state_.clear_state_dirty = true; |
3534 } | 2902 } |
3535 return false; | 2903 return false; |
3536 default: | 2904 default: |
3537 NOTREACHED(); | 2905 NOTREACHED(); |
3538 return false; | 2906 return false; |
3539 } | 2907 } |
3540 } | 2908 } |
3541 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ | 2909 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ |
OLD | NEW |