| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 345 |
| 346 void V8WebGLRenderingContextBase::getBufferParameterMethodCustom(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 346 void V8WebGLRenderingContextBase::getBufferParameterMethodCustom(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
| 347 { | 347 { |
| 348 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getBufferPa
rameter", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); | 348 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getBufferPa
rameter", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); |
| 349 getObjectParameter(info, kBuffer, exceptionState); | 349 getObjectParameter(info, kBuffer, exceptionState); |
| 350 } | 350 } |
| 351 | 351 |
| 352 void V8WebGLRenderingContextBase::getExtensionMethodCustom(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 352 void V8WebGLRenderingContextBase::getExtensionMethodCustom(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
| 353 { | 353 { |
| 354 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getExtensio
n", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); | 354 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getExtensio
n", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); |
| 355 WebGLRenderingContextBase* imp = V8WebGLRenderingContextBase::toNative(info.
Holder()); | 355 WebGLRenderingContextBase* impl = V8WebGLRenderingContextBase::toNative(info
.Holder()); |
| 356 if (info.Length() < 1) { | 356 if (info.Length() < 1) { |
| 357 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 357 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 358 exceptionState.throwIfNeeded(); | 358 exceptionState.throwIfNeeded(); |
| 359 return; | 359 return; |
| 360 } | 360 } |
| 361 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); | 361 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); |
| 362 RefPtr<WebGLExtension> extension(imp->getExtension(name)); | 362 RefPtr<WebGLExtension> extension(impl->getExtension(name)); |
| 363 v8SetReturnValue(info, toV8Object(extension.get(), info.Holder(), info.GetIs
olate())); | 363 v8SetReturnValue(info, toV8Object(extension.get(), info.Holder(), info.GetIs
olate())); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void V8WebGLRenderingContextBase::getFramebufferAttachmentParameterMethodCustom(
const v8::FunctionCallbackInfo<v8::Value>& info) | 366 void V8WebGLRenderingContextBase::getFramebufferAttachmentParameterMethodCustom(
const v8::FunctionCallbackInfo<v8::Value>& info) |
| 367 { | 367 { |
| 368 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getFramebuf
ferAttachmentParameter", "WebGLRenderingContextBase", info.Holder(), info.GetIso
late()); | 368 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getFramebuf
ferAttachmentParameter", "WebGLRenderingContextBase", info.Holder(), info.GetIso
late()); |
| 369 if (info.Length() != 3) { | 369 if (info.Length() != 3) { |
| 370 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 370 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
| 371 exceptionState.throwIfNeeded(); | 371 exceptionState.throwIfNeeded(); |
| 372 return; | 372 return; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 WebGLShader* shader = V8WebGLShader::toNativeWithTypeCheck(info.GetIsolate()
, info[shaderArgumentIndex]); | 450 WebGLShader* shader = V8WebGLShader::toNativeWithTypeCheck(info.GetIsolate()
, info[shaderArgumentIndex]); |
| 451 unsigned pname = toInt32(info[1], exceptionState); | 451 unsigned pname = toInt32(info[1], exceptionState); |
| 452 if (exceptionState.throwIfNeeded()) | 452 if (exceptionState.throwIfNeeded()) |
| 453 return; | 453 return; |
| 454 WebGLGetInfo args = context->getShaderParameter(shader, pname); | 454 WebGLGetInfo args = context->getShaderParameter(shader, pname); |
| 455 v8SetReturnValue(info, toV8Object(args, info.Holder(), info.GetIsolate())); | 455 v8SetReturnValue(info, toV8Object(args, info.Holder(), info.GetIsolate())); |
| 456 } | 456 } |
| 457 | 457 |
| 458 void V8WebGLRenderingContextBase::getSupportedExtensionsMethodCustom(const v8::F
unctionCallbackInfo<v8::Value>& info) | 458 void V8WebGLRenderingContextBase::getSupportedExtensionsMethodCustom(const v8::F
unctionCallbackInfo<v8::Value>& info) |
| 459 { | 459 { |
| 460 WebGLRenderingContextBase* imp = V8WebGLRenderingContextBase::toNative(info.
Holder()); | 460 WebGLRenderingContextBase* impl = V8WebGLRenderingContextBase::toNative(info
.Holder()); |
| 461 if (imp->isContextLost()) { | 461 if (impl->isContextLost()) { |
| 462 v8SetReturnValueNull(info); | 462 v8SetReturnValueNull(info); |
| 463 return; | 463 return; |
| 464 } | 464 } |
| 465 | 465 |
| 466 Vector<String> value = imp->getSupportedExtensions(); | 466 Vector<String> value = impl->getSupportedExtensions(); |
| 467 v8::Local<v8::Array> array = v8::Array::New(info.GetIsolate(), value.size())
; | 467 v8::Local<v8::Array> array = v8::Array::New(info.GetIsolate(), value.size())
; |
| 468 for (size_t ii = 0; ii < value.size(); ++ii) | 468 for (size_t ii = 0; ii < value.size(); ++ii) |
| 469 array->Set(v8::Integer::New(info.GetIsolate(), ii), v8String(info.GetIso
late(), value[ii])); | 469 array->Set(v8::Integer::New(info.GetIsolate(), ii), v8String(info.GetIso
late(), value[ii])); |
| 470 v8SetReturnValue(info, array); | 470 v8SetReturnValue(info, array); |
| 471 } | 471 } |
| 472 | 472 |
| 473 void V8WebGLRenderingContextBase::getTexParameterMethodCustom(const v8::Function
CallbackInfo<v8::Value>& info) | 473 void V8WebGLRenderingContextBase::getTexParameterMethodCustom(const v8::Function
CallbackInfo<v8::Value>& info) |
| 474 { | 474 { |
| 475 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getTexParam
eter", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); | 475 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getTexParam
eter", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); |
| 476 getObjectParameter(info, kTexture, exceptionState); | 476 getObjectParameter(info, kTexture, exceptionState); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); | 842 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); |
| 843 } | 843 } |
| 844 | 844 |
| 845 void V8WebGLRenderingContextBase::vertexAttrib4fvMethodCustom(const v8::Function
CallbackInfo<v8::Value>& info) | 845 void V8WebGLRenderingContextBase::vertexAttrib4fvMethodCustom(const v8::Function
CallbackInfo<v8::Value>& info) |
| 846 { | 846 { |
| 847 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); | 847 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContextBase", info.Holder(), info.GetIsolate()); |
| 848 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); | 848 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); |
| 849 } | 849 } |
| 850 | 850 |
| 851 } // namespace WebCore | 851 } // namespace WebCore |
| OLD | NEW |