2 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include "JSWebGLRenderingContext.h"
32 #include "ExceptionCode.h"
33 #include "HTMLCanvasElement.h"
34 #include "HTMLImageElement.h"
35 #include "JSFloat32Array.h"
36 #include "JSHTMLCanvasElement.h"
37 #include "JSHTMLImageElement.h"
38 #include "JSImageData.h"
39 #include "JSInt32Array.h"
40 #include "JSOESStandardDerivatives.h"
41 #include "JSOESTextureFloat.h"
42 #include "JSOESVertexArrayObject.h"
43 #include "JSUint8Array.h"
44 #include "JSWebGLBuffer.h"
45 #include "JSWebGLFramebuffer.h"
46 #include "JSWebGLProgram.h"
47 #include "JSWebGLRenderbuffer.h"
48 #include "JSWebGLShader.h"
49 #include "JSWebGLTexture.h"
50 #include "JSWebGLUniformLocation.h"
51 #include "JSWebGLVertexArrayObjectOES.h"
52 #include "JSWebKitCSSMatrix.h"
53 #include "JSWebKitLoseContext.h"
54 #include "NotImplemented.h"
55 #include "OESStandardDerivatives.h"
56 #include "OESTextureFloat.h"
57 #include "OESVertexArrayObject.h"
58 #include "WebGLBuffer.h"
59 #include "WebGLDebugRendererInfo.h"
60 #include "WebGLDebugShaders.h"
61 #include "WebGLExtension.h"
62 #include "WebGLFramebuffer.h"
63 #include "WebGLGetInfo.h"
64 #include "WebGLProgram.h"
65 #include "WebGLRenderingContext.h"
66 #include "WebGLVertexArrayObjectOES.h"
67 #include "WebKitLoseContext.h"
68 #include <runtime/Error.h>
69 #include <runtime/JSArray.h>
70 #include <wtf/FastMalloc.h>
71 #include <wtf/Float32Array.h>
72 #include <wtf/Int32Array.h>
73 #include <wtf/OwnFastMallocPtr.h>
76 #include "HTMLVideoElement.h"
77 #include "JSHTMLVideoElement.h"
84 static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo& info)
86 switch (info.getType()) {
87 case WebGLGetInfo::kTypeBool:
88 return jsBoolean(info.getBool());
89 case WebGLGetInfo::kTypeBoolArray: {
90 MarkedArgumentBuffer list;
91 const Vector<bool>& value = info.getBoolArray();
92 for (size_t ii = 0; ii < value.size(); ++ii)
93 list.append(jsBoolean(value[ii]));
94 return constructArray(exec, globalObject, list);
96 case WebGLGetInfo::kTypeFloat:
97 return jsNumber(info.getFloat());
98 case WebGLGetInfo::kTypeInt:
99 return jsNumber(info.getInt());
100 case WebGLGetInfo::kTypeNull:
102 case WebGLGetInfo::kTypeString:
103 return jsString(exec, info.getString());
104 case WebGLGetInfo::kTypeUnsignedInt:
105 return jsNumber(info.getUnsignedInt());
106 case WebGLGetInfo::kTypeWebGLBuffer:
107 return toJS(exec, globalObject, info.getWebGLBuffer());
108 case WebGLGetInfo::kTypeWebGLFloatArray:
109 return toJS(exec, globalObject, info.getWebGLFloatArray());
110 case WebGLGetInfo::kTypeWebGLFramebuffer:
111 return toJS(exec, globalObject, info.getWebGLFramebuffer());
112 case WebGLGetInfo::kTypeWebGLIntArray:
113 return toJS(exec, globalObject, info.getWebGLIntArray());
114 // FIXME: implement WebGLObjectArray
115 // case WebGLGetInfo::kTypeWebGLObjectArray:
116 case WebGLGetInfo::kTypeWebGLProgram:
117 return toJS(exec, globalObject, info.getWebGLProgram());
118 case WebGLGetInfo::kTypeWebGLRenderbuffer:
119 return toJS(exec, globalObject, info.getWebGLRenderbuffer());
120 case WebGLGetInfo::kTypeWebGLTexture:
121 return toJS(exec, globalObject, info.getWebGLTexture());
122 case WebGLGetInfo::kTypeWebGLUnsignedByteArray:
123 return toJS(exec, globalObject, info.getWebGLUnsignedByteArray());
124 case WebGLGetInfo::kTypeWebGLVertexArrayObjectOES:
125 return toJS(exec, globalObject, info.getWebGLVertexArrayObjectOES());
128 return jsUndefined();
133 kBuffer, kRenderbuffer, kTexture, kVertexAttrib
136 static JSValue getObjectParameter(JSWebGLRenderingContext* obj, ExecState* exec, ObjectType objectType)
138 if (exec->argumentCount() != 2)
139 return throwSyntaxError(exec);
141 ExceptionCode ec = 0;
142 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(obj->impl());
143 unsigned target = exec->argument(0).toInt32(exec);
144 if (exec->hadException())
145 return jsUndefined();
146 unsigned pname = exec->argument(1).toInt32(exec);
147 if (exec->hadException())
148 return jsUndefined();
150 switch (objectType) {
152 info = context->getBufferParameter(target, pname, ec);
155 info = context->getRenderbufferParameter(target, pname, ec);
158 info = context->getTexParameter(target, pname, ec);
162 info = context->getVertexAttrib(target, pname, ec);
169 setDOMException(exec, ec);
170 return jsUndefined();
172 return toJS(exec, obj->globalObject(), info);
175 enum WhichProgramCall {
176 kProgramParameter, kUniform
179 static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExtension* extension)
183 switch (extension->getName()) {
184 case WebGLExtension::WebKitLoseContextName:
185 return toJS(exec, globalObject, static_cast<WebKitLoseContext*>(extension));
186 case WebGLExtension::OESStandardDerivativesName:
187 return toJS(exec, globalObject, static_cast<OESStandardDerivatives*>(extension));
188 case WebGLExtension::OESTextureFloatName:
189 return toJS(exec, globalObject, static_cast<OESTextureFloat*>(extension));
190 case WebGLExtension::OESVertexArrayObjectName:
191 return toJS(exec, globalObject, static_cast<OESVertexArrayObject*>(extension));
192 case WebGLExtension::WebGLDebugRendererInfoName:
193 return toJS(exec, globalObject, static_cast<WebGLDebugRendererInfo*>(extension));
194 case WebGLExtension::WebGLDebugShadersName:
195 return toJS(exec, globalObject, static_cast<WebGLDebugShaders*>(extension));
197 ASSERT_NOT_REACHED();
201 void JSWebGLRenderingContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
203 JSWebGLRenderingContext* thisObject = jsCast<JSWebGLRenderingContext*>(cell);
204 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
205 COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
206 ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
207 Base::visitChildren(thisObject, visitor);
208 visitor.addOpaqueRoot(thisObject->impl());
211 JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
213 if (exec->argumentCount() < 1)
214 return throwSyntaxError(exec);
215 ExceptionCode ec = 0;
216 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
217 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSWebGLProgram::s_info))
218 return throwTypeError(exec);
219 WebGLProgram* program = toWebGLProgram(exec->argument(0));
220 if (exec->hadException())
222 Vector<RefPtr<WebGLShader> > shaders;
223 bool succeed = context->getAttachedShaders(program, shaders, ec);
225 setDOMException(exec, ec);
230 MarkedArgumentBuffer list;
231 for (size_t ii = 0; ii < shaders.size(); ++ii)
232 list.append(toJS(exec, globalObject(), shaders[ii].get()));
233 return constructArray(exec, globalObject(), list);
236 JSValue JSWebGLRenderingContext::getExtension(ExecState* exec)
238 if (exec->argumentCount() < 1)
239 return throwSyntaxError(exec);
241 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
242 const String& name = ustringToString(exec->argument(0).toString(exec));
243 if (exec->hadException())
244 return jsUndefined();
245 WebGLExtension* extension = context->getExtension(name);
246 return toJS(exec, globalObject(), extension);
249 JSValue JSWebGLRenderingContext::getBufferParameter(ExecState* exec)
251 return getObjectParameter(this, exec, kBuffer);
254 JSValue JSWebGLRenderingContext::getFramebufferAttachmentParameter(ExecState* exec)
256 if (exec->argumentCount() != 3)
257 return throwSyntaxError(exec);
259 ExceptionCode ec = 0;
260 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
261 unsigned target = exec->argument(0).toInt32(exec);
262 if (exec->hadException())
263 return jsUndefined();
264 unsigned attachment = exec->argument(1).toInt32(exec);
265 if (exec->hadException())
266 return jsUndefined();
267 unsigned pname = exec->argument(2).toInt32(exec);
268 if (exec->hadException())
269 return jsUndefined();
270 WebGLGetInfo info = context->getFramebufferAttachmentParameter(target, attachment, pname, ec);
272 setDOMException(exec, ec);
273 return jsUndefined();
275 return toJS(exec, globalObject(), info);
278 JSValue JSWebGLRenderingContext::getParameter(ExecState* exec)
280 if (exec->argumentCount() != 1)
281 return throwSyntaxError(exec);
283 ExceptionCode ec = 0;
284 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
285 unsigned pname = exec->argument(0).toInt32(exec);
286 if (exec->hadException())
287 return jsUndefined();
288 WebGLGetInfo info = context->getParameter(pname, ec);
290 setDOMException(exec, ec);
291 return jsUndefined();
293 return toJS(exec, globalObject(), info);
296 JSValue JSWebGLRenderingContext::getProgramParameter(ExecState* exec)
298 if (exec->argumentCount() != 2)
299 return throwSyntaxError(exec);
301 ExceptionCode ec = 0;
302 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
303 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSWebGLProgram::s_info))
304 return throwTypeError(exec);
305 WebGLProgram* program = toWebGLProgram(exec->argument(0));
306 unsigned pname = exec->argument(1).toInt32(exec);
307 if (exec->hadException())
308 return jsUndefined();
309 WebGLGetInfo info = context->getProgramParameter(program, pname, ec);
311 setDOMException(exec, ec);
312 return jsUndefined();
314 return toJS(exec, globalObject(), info);
317 JSValue JSWebGLRenderingContext::getRenderbufferParameter(ExecState* exec)
319 return getObjectParameter(this, exec, kRenderbuffer);
322 JSValue JSWebGLRenderingContext::getShaderParameter(ExecState* exec)
324 if (exec->argumentCount() != 2)
325 return throwSyntaxError(exec);
327 ExceptionCode ec = 0;
328 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
329 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSWebGLShader::s_info))
330 return throwTypeError(exec);
331 WebGLShader* shader = toWebGLShader(exec->argument(0));
332 unsigned pname = exec->argument(1).toInt32(exec);
333 if (exec->hadException())
334 return jsUndefined();
335 WebGLGetInfo info = context->getShaderParameter(shader, pname, ec);
337 setDOMException(exec, ec);
338 return jsUndefined();
340 return toJS(exec, globalObject(), info);
343 JSValue JSWebGLRenderingContext::getSupportedExtensions(ExecState* exec)
345 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
346 if (context->isContextLost())
348 Vector<String> value = context->getSupportedExtensions();
349 MarkedArgumentBuffer list;
350 for (size_t ii = 0; ii < value.size(); ++ii)
351 list.append(jsString(exec, value[ii]));
352 return constructArray(exec, globalObject(), list);
355 JSValue JSWebGLRenderingContext::getTexParameter(ExecState* exec)
357 return getObjectParameter(this, exec, kTexture);
360 JSValue JSWebGLRenderingContext::getUniform(ExecState* exec)
362 if (exec->argumentCount() != 2)
363 return throwSyntaxError(exec);
365 ExceptionCode ec = 0;
366 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
367 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSWebGLProgram::s_info))
368 return throwTypeError(exec);
369 WebGLProgram* program = toWebGLProgram(exec->argument(0));
370 if (exec->argumentCount() > 1 && !exec->argument(1).isUndefinedOrNull() && !exec->argument(1).inherits(&JSWebGLUniformLocation::s_info))
371 return throwTypeError(exec);
372 WebGLUniformLocation* loc = toWebGLUniformLocation(exec->argument(1));
373 if (exec->hadException())
374 return jsUndefined();
375 WebGLGetInfo info = context->getUniform(program, loc, ec);
377 setDOMException(exec, ec);
378 return jsUndefined();
380 return toJS(exec, globalObject(), info);
383 JSValue JSWebGLRenderingContext::getVertexAttrib(ExecState* exec)
385 return getObjectParameter(this, exec, kVertexAttrib);
388 template<typename T, size_t inlineCapacity>
389 bool toVector(JSC::ExecState* exec, JSC::JSValue value, Vector<T, inlineCapacity>& vector)
391 if (!value.isObject())
394 JSC::JSObject* object = asObject(value);
395 int32_t length = object->get(exec, JSC::Identifier(exec, "length")).toInt32(exec);
397 if (!vector.tryReserveCapacity(length))
399 vector.resize(length);
401 for (int32_t i = 0; i < length; ++i) {
402 JSC::JSValue v = object->get(exec, i);
403 if (exec->hadException())
405 vector[i] = static_cast<T>(v.toNumber(exec));
411 enum DataFunctionToCall {
412 f_uniform1v, f_uniform2v, f_uniform3v, f_uniform4v,
413 f_vertexAttrib1v, f_vertexAttrib2v, f_vertexAttrib3v, f_vertexAttrib4v
416 enum DataFunctionMatrixToCall {
417 f_uniformMatrix2fv, f_uniformMatrix3fv, f_uniformMatrix4fv
420 static bool functionForUniform(DataFunctionToCall f)
434 static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext* context)
436 if (exec->argumentCount() != 2)
437 return throwSyntaxError(exec);
439 WebGLUniformLocation* location = 0;
442 if (functionForUniform(f)) {
443 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSWebGLUniformLocation::s_info))
444 return throwTypeError(exec);
445 location = toWebGLUniformLocation(exec->argument(0));
447 index = exec->argument(0).toInt32(exec);
449 if (exec->hadException())
450 return jsUndefined();
452 RefPtr<Float32Array> webGLArray = toFloat32Array(exec->argument(1));
453 if (exec->hadException())
454 return jsUndefined();
456 ExceptionCode ec = 0;
460 context->uniform1fv(location, webGLArray.get(), ec);
463 context->uniform2fv(location, webGLArray.get(), ec);
466 context->uniform3fv(location, webGLArray.get(), ec);
469 context->uniform4fv(location, webGLArray.get(), ec);
471 case f_vertexAttrib1v:
472 context->vertexAttrib1fv(index, webGLArray.get());
474 case f_vertexAttrib2v:
475 context->vertexAttrib2fv(index, webGLArray.get());
477 case f_vertexAttrib3v:
478 context->vertexAttrib3fv(index, webGLArray.get());
480 case f_vertexAttrib4v:
481 context->vertexAttrib4fv(index, webGLArray.get());
485 setDOMException(exec, ec);
486 return jsUndefined();
489 Vector<float, 64> array;
490 if (!toVector(exec, exec->argument(1), array))
491 return throwTypeError(exec);
495 context->uniform1fv(location, array.data(), array.size(), ec);
498 context->uniform2fv(location, array.data(), array.size(), ec);
501 context->uniform3fv(location, array.data(), array.size(), ec);
504 context->uniform4fv(location, array.data(), array.size(), ec);
506 case f_vertexAttrib1v:
507 context->vertexAttrib1fv(index, array.data(), array.size());
509 case f_vertexAttrib2v:
510 context->vertexAttrib2fv(index, array.data(), array.size());
512 case f_vertexAttrib3v:
513 context->vertexAttrib3fv(index, array.data(), array.size());
515 case f_vertexAttrib4v:
516 context->vertexAttrib4fv(index, array.data(), array.size());
520 setDOMException(exec, ec);
521 return jsUndefined();
524 static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext* context)
526 if (exec->argumentCount() != 2)
527 return throwSyntaxError(exec);
529 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSWebGLUniformLocation::s_info))
530 return throwTypeError(exec);
531 WebGLUniformLocation* location = toWebGLUniformLocation(exec->argument(0));
533 if (exec->hadException())
534 return jsUndefined();
536 RefPtr<Int32Array> webGLArray = toInt32Array(exec->argument(1));
537 if (exec->hadException())
538 return jsUndefined();
540 ExceptionCode ec = 0;
544 context->uniform1iv(location, webGLArray.get(), ec);
547 context->uniform2iv(location, webGLArray.get(), ec);
550 context->uniform3iv(location, webGLArray.get(), ec);
553 context->uniform4iv(location, webGLArray.get(), ec);
559 setDOMException(exec, ec);
560 return jsUndefined();
564 Vector<int, 64> array;
565 if (!toVector(exec, exec->argument(1), array))
566 return throwTypeError(exec);
570 context->uniform1iv(location, array.data(), array.size(), ec);
573 context->uniform2iv(location, array.data(), array.size(), ec);
576 context->uniform3iv(location, array.data(), array.size(), ec);
579 context->uniform4iv(location, array.data(), array.size(), ec);
585 setDOMException(exec, ec);
586 return jsUndefined();
589 static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecState* exec, WebGLRenderingContext* context)
591 if (exec->argumentCount() != 3)
592 return throwSyntaxError(exec);
594 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSWebGLUniformLocation::s_info))
595 return throwTypeError(exec);
596 WebGLUniformLocation* location = toWebGLUniformLocation(exec->argument(0));
598 if (exec->hadException())
599 return jsUndefined();
601 bool transpose = exec->argument(1).toBoolean(exec);
602 if (exec->hadException())
603 return jsUndefined();
605 RefPtr<Float32Array> webGLArray = toFloat32Array(exec->argument(2));
606 if (exec->hadException())
607 return jsUndefined();
609 ExceptionCode ec = 0;
612 case f_uniformMatrix2fv:
613 context->uniformMatrix2fv(location, transpose, webGLArray.get(), ec);
615 case f_uniformMatrix3fv:
616 context->uniformMatrix3fv(location, transpose, webGLArray.get(), ec);
618 case f_uniformMatrix4fv:
619 context->uniformMatrix4fv(location, transpose, webGLArray.get(), ec);
623 setDOMException(exec, ec);
624 return jsUndefined();
627 Vector<float, 64> array;
628 if (!toVector(exec, exec->argument(2), array))
629 return throwTypeError(exec);
632 case f_uniformMatrix2fv:
633 context->uniformMatrix2fv(location, transpose, array.data(), array.size(), ec);
635 case f_uniformMatrix3fv:
636 context->uniformMatrix3fv(location, transpose, array.data(), array.size(), ec);
638 case f_uniformMatrix4fv:
639 context->uniformMatrix4fv(location, transpose, array.data(), array.size(), ec);
643 setDOMException(exec, ec);
644 return jsUndefined();
647 JSC::JSValue JSWebGLRenderingContext::uniform1fv(JSC::ExecState* exec)
649 return dataFunctionf(f_uniform1v, exec, static_cast<WebGLRenderingContext*>(impl()));
652 JSC::JSValue JSWebGLRenderingContext::uniform1iv(JSC::ExecState* exec)
654 return dataFunctioni(f_uniform1v, exec, static_cast<WebGLRenderingContext*>(impl()));
657 JSC::JSValue JSWebGLRenderingContext::uniform2fv(JSC::ExecState* exec)
659 return dataFunctionf(f_uniform2v, exec, static_cast<WebGLRenderingContext*>(impl()));
662 JSC::JSValue JSWebGLRenderingContext::uniform2iv(JSC::ExecState* exec)
664 return dataFunctioni(f_uniform2v, exec, static_cast<WebGLRenderingContext*>(impl()));
667 JSC::JSValue JSWebGLRenderingContext::uniform3fv(JSC::ExecState* exec)
669 return dataFunctionf(f_uniform3v, exec, static_cast<WebGLRenderingContext*>(impl()));
672 JSC::JSValue JSWebGLRenderingContext::uniform3iv(JSC::ExecState* exec)
674 return dataFunctioni(f_uniform3v, exec, static_cast<WebGLRenderingContext*>(impl()));
677 JSC::JSValue JSWebGLRenderingContext::uniform4fv(JSC::ExecState* exec)
679 return dataFunctionf(f_uniform4v, exec, static_cast<WebGLRenderingContext*>(impl()));
682 JSC::JSValue JSWebGLRenderingContext::uniform4iv(JSC::ExecState* exec)
684 return dataFunctioni(f_uniform4v, exec, static_cast<WebGLRenderingContext*>(impl()));
687 JSC::JSValue JSWebGLRenderingContext::uniformMatrix2fv(JSC::ExecState* exec)
689 return dataFunctionMatrix(f_uniformMatrix2fv, exec, static_cast<WebGLRenderingContext*>(impl()));
692 JSC::JSValue JSWebGLRenderingContext::uniformMatrix3fv(JSC::ExecState* exec)
694 return dataFunctionMatrix(f_uniformMatrix3fv, exec, static_cast<WebGLRenderingContext*>(impl()));
697 JSC::JSValue JSWebGLRenderingContext::uniformMatrix4fv(JSC::ExecState* exec)
699 return dataFunctionMatrix(f_uniformMatrix4fv, exec, static_cast<WebGLRenderingContext*>(impl()));
702 JSC::JSValue JSWebGLRenderingContext::vertexAttrib1fv(JSC::ExecState* exec)
704 return dataFunctionf(f_vertexAttrib1v, exec, static_cast<WebGLRenderingContext*>(impl()));
707 JSC::JSValue JSWebGLRenderingContext::vertexAttrib2fv(JSC::ExecState* exec)
709 return dataFunctionf(f_vertexAttrib2v, exec, static_cast<WebGLRenderingContext*>(impl()));
712 JSC::JSValue JSWebGLRenderingContext::vertexAttrib3fv(JSC::ExecState* exec)
714 return dataFunctionf(f_vertexAttrib3v, exec, static_cast<WebGLRenderingContext*>(impl()));
717 JSC::JSValue JSWebGLRenderingContext::vertexAttrib4fv(JSC::ExecState* exec)
719 return dataFunctionf(f_vertexAttrib4v, exec, static_cast<WebGLRenderingContext*>(impl()));
722 } // namespace WebCore
724 #endif // ENABLE(WEBGL)