OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 if (args[1].IsEmpty() || !args[1]->IsArray()) { | 589 if (args[1].IsEmpty() || !args[1]->IsArray()) { |
590 throwTypeError(0, args.GetIsolate()); | 590 throwTypeError(0, args.GetIsolate()); |
591 return; | 591 return; |
592 } | 592 } |
593 v8::Handle<v8::Array> array = | 593 v8::Handle<v8::Array> array = |
594 v8::Local<v8::Array>::Cast(args[1]); | 594 v8::Local<v8::Array>::Cast(args[1]); |
595 uint32_t len = array->Length(); | 595 uint32_t len = array->Length(); |
596 float* data = jsArrayToFloatArray(array, len); | 596 float* data = jsArrayToFloatArray(array, len); |
597 if (!data) { | 597 if (!data) { |
598 // FIXME: consider different / better exception type. | 598 // FIXME: consider different / better exception type. |
599 setDOMException(SYNTAX_ERR, args.GetIsolate()); | 599 setDOMException(SyntaxError, args.GetIsolate()); |
600 return; | 600 return; |
601 } | 601 } |
602 ExceptionCode ec = 0; | 602 ExceptionCode ec = 0; |
603 switch (functionToCall) { | 603 switch (functionToCall) { |
604 case kUniform1v: context->uniform1fv(location, data, len, ec); break; | 604 case kUniform1v: context->uniform1fv(location, data, len, ec); break; |
605 case kUniform2v: context->uniform2fv(location, data, len, ec); break; | 605 case kUniform2v: context->uniform2fv(location, data, len, ec); break; |
606 case kUniform3v: context->uniform3fv(location, data, len, ec); break; | 606 case kUniform3v: context->uniform3fv(location, data, len, ec); break; |
607 case kUniform4v: context->uniform4fv(location, data, len, ec); break; | 607 case kUniform4v: context->uniform4fv(location, data, len, ec); break; |
608 case kVertexAttrib1v: context->vertexAttrib1fv(index, data, len); break; | 608 case kVertexAttrib1v: context->vertexAttrib1fv(index, data, len); break; |
609 case kVertexAttrib2v: context->vertexAttrib2fv(index, data, len); break; | 609 case kVertexAttrib2v: context->vertexAttrib2fv(index, data, len); break; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 if (args[1].IsEmpty() || !args[1]->IsArray()) { | 664 if (args[1].IsEmpty() || !args[1]->IsArray()) { |
665 throwTypeError(0, args.GetIsolate()); | 665 throwTypeError(0, args.GetIsolate()); |
666 return; | 666 return; |
667 } | 667 } |
668 v8::Handle<v8::Array> array = | 668 v8::Handle<v8::Array> array = |
669 v8::Local<v8::Array>::Cast(args[1]); | 669 v8::Local<v8::Array>::Cast(args[1]); |
670 uint32_t len = array->Length(); | 670 uint32_t len = array->Length(); |
671 int* data = jsArrayToIntArray(array, len); | 671 int* data = jsArrayToIntArray(array, len); |
672 if (!data) { | 672 if (!data) { |
673 // FIXME: consider different / better exception type. | 673 // FIXME: consider different / better exception type. |
674 setDOMException(SYNTAX_ERR, args.GetIsolate()); | 674 setDOMException(SyntaxError, args.GetIsolate()); |
675 return; | 675 return; |
676 } | 676 } |
677 ExceptionCode ec = 0; | 677 ExceptionCode ec = 0; |
678 switch (functionToCall) { | 678 switch (functionToCall) { |
679 case kUniform1v: context->uniform1iv(location, data, len, ec); break; | 679 case kUniform1v: context->uniform1iv(location, data, len, ec); break; |
680 case kUniform2v: context->uniform2iv(location, data, len, ec); break; | 680 case kUniform2v: context->uniform2iv(location, data, len, ec); break; |
681 case kUniform3v: context->uniform3iv(location, data, len, ec); break; | 681 case kUniform3v: context->uniform3iv(location, data, len, ec); break; |
682 case kUniform4v: context->uniform4iv(location, data, len, ec); break; | 682 case kUniform4v: context->uniform4iv(location, data, len, ec); break; |
683 default: ASSERT_NOT_REACHED(); break; | 683 default: ASSERT_NOT_REACHED(); break; |
684 } | 684 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 if (args[2].IsEmpty() || !args[2]->IsArray()) { | 775 if (args[2].IsEmpty() || !args[2]->IsArray()) { |
776 throwTypeError(0, args.GetIsolate()); | 776 throwTypeError(0, args.GetIsolate()); |
777 return; | 777 return; |
778 } | 778 } |
779 v8::Handle<v8::Array> array = | 779 v8::Handle<v8::Array> array = |
780 v8::Local<v8::Array>::Cast(args[2]); | 780 v8::Local<v8::Array>::Cast(args[2]); |
781 uint32_t len = array->Length(); | 781 uint32_t len = array->Length(); |
782 float* data = jsArrayToFloatArray(array, len); | 782 float* data = jsArrayToFloatArray(array, len); |
783 if (!data) { | 783 if (!data) { |
784 // FIXME: consider different / better exception type. | 784 // FIXME: consider different / better exception type. |
785 setDOMException(SYNTAX_ERR, args.GetIsolate()); | 785 setDOMException(SyntaxError, args.GetIsolate()); |
786 return; | 786 return; |
787 } | 787 } |
788 ExceptionCode ec = 0; | 788 ExceptionCode ec = 0; |
789 switch (matrixSize) { | 789 switch (matrixSize) { |
790 case 2: context->uniformMatrix2fv(location, transpose, data, len, ec); b
reak; | 790 case 2: context->uniformMatrix2fv(location, transpose, data, len, ec); b
reak; |
791 case 3: context->uniformMatrix3fv(location, transpose, data, len, ec); b
reak; | 791 case 3: context->uniformMatrix3fv(location, transpose, data, len, ec); b
reak; |
792 case 4: context->uniformMatrix4fv(location, transpose, data, len, ec); b
reak; | 792 case 4: context->uniformMatrix4fv(location, transpose, data, len, ec); b
reak; |
793 default: ASSERT_NOT_REACHED(); break; | 793 default: ASSERT_NOT_REACHED(); break; |
794 } | 794 } |
795 fastFree(data); | 795 fastFree(data); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 { | 828 { |
829 vertexAttribAndUniformHelperf(args, kVertexAttrib3v); | 829 vertexAttribAndUniformHelperf(args, kVertexAttrib3v); |
830 } | 830 } |
831 | 831 |
832 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& args) | 832 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& args) |
833 { | 833 { |
834 vertexAttribAndUniformHelperf(args, kVertexAttrib4v); | 834 vertexAttribAndUniformHelperf(args, kVertexAttrib4v); |
835 } | 835 } |
836 | 836 |
837 } // namespace WebCore | 837 } // namespace WebCore |
OLD | NEW |