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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 return; | 463 return; |
464 } | 464 } |
465 WebGLShader* shader = V8WebGLShader::toNativeWithTypeCheck(info.GetIsolate()
, info[shaderArgumentIndex]); | 465 WebGLShader* shader = V8WebGLShader::toNativeWithTypeCheck(info.GetIsolate()
, info[shaderArgumentIndex]); |
466 unsigned pname = toInt32(info[1], exceptionState); | 466 unsigned pname = toInt32(info[1], exceptionState); |
467 if (exceptionState.throwIfNeeded()) | 467 if (exceptionState.throwIfNeeded()) |
468 return; | 468 return; |
469 WebGLGetInfo args = context->getShaderParameter(shader, pname); | 469 WebGLGetInfo args = context->getShaderParameter(shader, pname); |
470 v8SetReturnValue(info, toV8Object(args, info.Holder(), info.GetIsolate())); | 470 v8SetReturnValue(info, toV8Object(args, info.Holder(), info.GetIsolate())); |
471 } | 471 } |
472 | 472 |
473 void V8WebGLRenderingContext::getSupportedExtensionsMethodCustom(const v8::Funct
ionCallbackInfo<v8::Value>& info) | |
474 { | |
475 WebGLRenderingContext* impl = V8WebGLRenderingContext::toNative(info.Holder(
)); | |
476 if (impl->isContextLost()) { | |
477 v8SetReturnValueNull(info); | |
478 return; | |
479 } | |
480 | |
481 Vector<String> value = impl->getSupportedExtensions(); | |
482 v8::Local<v8::Array> array = v8::Array::New(info.GetIsolate(), value.size())
; | |
483 for (size_t ii = 0; ii < value.size(); ++ii) | |
484 array->Set(v8::Integer::New(info.GetIsolate(), ii), v8String(info.GetIso
late(), value[ii])); | |
485 v8SetReturnValue(info, array); | |
486 } | |
487 | |
488 void V8WebGLRenderingContext::getTexParameterMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) | 473 void V8WebGLRenderingContext::getTexParameterMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) |
489 { | 474 { |
490 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getTexParam
eter", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); | 475 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getTexParam
eter", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); |
491 getObjectParameter(info, kTexture, exceptionState); | 476 getObjectParameter(info, kTexture, exceptionState); |
492 } | 477 } |
493 | 478 |
494 void V8WebGLRenderingContext::getUniformMethodCustom(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 479 void V8WebGLRenderingContext::getUniformMethodCustom(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
495 { | 480 { |
496 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getUniform"
, "WebGLRenderingContext", info.Holder(), info.GetIsolate()); | 481 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getUniform"
, "WebGLRenderingContext", info.Holder(), info.GetIsolate()); |
497 if (info.Length() != 2) { | 482 if (info.Length() != 2) { |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); | 842 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); |
858 } | 843 } |
859 | 844 |
860 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) | 845 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) |
861 { | 846 { |
862 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); | 847 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); |
863 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); | 848 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); |
864 } | 849 } |
865 | 850 |
866 } // namespace WebCore | 851 } // namespace WebCore |
OLD | NEW |