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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 return; | 420 return; |
421 } | 421 } |
422 | 422 |
423 WebGLRenderingContext* context = V8WebGLRenderingContext::toImpl(info.Holder
()); | 423 WebGLRenderingContext* context = V8WebGLRenderingContext::toImpl(info.Holder
()); |
424 WebGLProgram* program; | 424 WebGLProgram* program; |
425 WebGLUniformLocation* location; | 425 WebGLUniformLocation* location; |
426 { | 426 { |
427 v8::TryCatch block; | 427 v8::TryCatch block; |
428 V8RethrowTryCatchScope rethrow(block); | 428 V8RethrowTryCatchScope rethrow(block); |
429 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8WebGLProgram:
:hasInstance(info[0], info.GetIsolate())) { | 429 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8WebGLProgram:
:hasInstance(info[0], info.GetIsolate())) { |
430 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute(
"getUniform", "WebGLRenderingContext", "parameter 1 is not of type 'WebGLProgram
'."), info.GetIsolate()); | 430 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("getUniform", "WebGLRenderingContext", "parameter 1 is not of
type 'WebGLProgram'.")); |
431 return; | 431 return; |
432 } | 432 } |
433 TONATIVE_VOID_INTERNAL(program, V8WebGLProgram::toImplWithTypeCheck(info
.GetIsolate(), info[0])); | 433 TONATIVE_VOID_INTERNAL(program, V8WebGLProgram::toImplWithTypeCheck(info
.GetIsolate(), info[0])); |
434 if (info.Length() > 1 && !isUndefinedOrNull(info[1]) && !V8WebGLUniformL
ocation::hasInstance(info[1], info.GetIsolate())) { | 434 if (info.Length() > 1 && !isUndefinedOrNull(info[1]) && !V8WebGLUniformL
ocation::hasInstance(info[1], info.GetIsolate())) { |
435 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute(
"getUniform", "WebGLRenderingContext", "parameter 2 is not of type 'WebGLUniform
Location'."), info.GetIsolate()); | 435 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("getUniform", "WebGLRenderingContext", "parameter 2 is not of
type 'WebGLUniformLocation'.")); |
436 return; | 436 return; |
437 } | 437 } |
438 TONATIVE_VOID_INTERNAL(location, V8WebGLUniformLocation::toImplWithTypeC
heck(info.GetIsolate(), info[1])); | 438 TONATIVE_VOID_INTERNAL(location, V8WebGLUniformLocation::toImplWithTypeC
heck(info.GetIsolate(), info[1])); |
439 } | 439 } |
440 WebGLGetInfo args = context->getUniform(program, location); | 440 WebGLGetInfo args = context->getUniform(program, location); |
441 v8SetReturnValue(info, toV8Object(args, info.Holder(), info.GetIsolate())); | 441 v8SetReturnValue(info, toV8Object(args, info.Holder(), info.GetIsolate())); |
442 } | 442 } |
443 | 443 |
444 void V8WebGLRenderingContext::getVertexAttribMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) | 444 void V8WebGLRenderingContext::getVertexAttribMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) |
445 { | 445 { |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); | 764 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); |
765 } | 765 } |
766 | 766 |
767 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) | 767 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) |
768 { | 768 { |
769 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); | 769 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); |
770 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); | 770 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); |
771 } | 771 } |
772 | 772 |
773 } // namespace blink | 773 } // namespace blink |
OLD | NEW |