/work/obj-fuzz/dom/bindings/WebGL2RenderingContextBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM WebGL2RenderingContext.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "WebGL2Context.h" |
4 | | #include "WebGL2RenderingContextBinding.h" |
5 | | #include "WebGLActiveInfo.h" |
6 | | #include "WebGLBuffer.h" |
7 | | #include "WebGLExtensions.h" |
8 | | #include "WebGLFramebuffer.h" |
9 | | #include "WebGLProgram.h" |
10 | | #include "WebGLQuery.h" |
11 | | #include "WebGLRenderbuffer.h" |
12 | | #include "WebGLRenderingContextBinding.h" |
13 | | #include "WebGLSampler.h" |
14 | | #include "WebGLShader.h" |
15 | | #include "WebGLShaderPrecisionFormat.h" |
16 | | #include "WebGLSync.h" |
17 | | #include "WebGLTexture.h" |
18 | | #include "WebGLTransformFeedback.h" |
19 | | #include "WebGLUniformLocation.h" |
20 | | #include "WebGLVertexArray.h" |
21 | | #include "WrapperFactory.h" |
22 | | #include "jsfriendapi.h" |
23 | | #include "mozilla/OwningNonNull.h" |
24 | | #include "mozilla/Preferences.h" |
25 | | #include "mozilla/dom/BindingUtils.h" |
26 | | #include "mozilla/dom/DOMJSClass.h" |
27 | | #include "mozilla/dom/HTMLCanvasElement.h" |
28 | | #include "mozilla/dom/HTMLImageElement.h" |
29 | | #include "mozilla/dom/HTMLVideoElement.h" |
30 | | #include "mozilla/dom/ImageBitmap.h" |
31 | | #include "mozilla/dom/ImageData.h" |
32 | | #include "mozilla/dom/NonRefcountedDOMObject.h" |
33 | | #include "mozilla/dom/Nullable.h" |
34 | | #include "mozilla/dom/PrimitiveConversions.h" |
35 | | #include "mozilla/dom/TypedArray.h" |
36 | | #include "mozilla/dom/UnionConversions.h" |
37 | | #include "mozilla/dom/XrayExpandoClass.h" |
38 | | #include "nsContentUtils.h" |
39 | | |
40 | | namespace mozilla { |
41 | | namespace dom { |
42 | | |
43 | | namespace binding_detail {}; // Just to make sure it's known as a namespace |
44 | | using namespace mozilla::dom::binding_detail; |
45 | | |
46 | | |
47 | | bool |
48 | | Uint32ArrayOrUnsignedLongSequence::ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const |
49 | 0 | { |
50 | 0 | switch (mType) { |
51 | 0 | case eUninitialized: { |
52 | 0 | return false; |
53 | 0 | break; |
54 | 0 | } |
55 | 0 | case eUint32Array: { |
56 | 0 | rval.setObject(*mValue.mUint32Array.Value().Obj()); |
57 | 0 | if (!MaybeWrapNonDOMObjectValue(cx, rval)) { |
58 | 0 | return false; |
59 | 0 | } |
60 | 0 | return true; |
61 | 0 | break; |
62 | 0 | } |
63 | 0 | case eUnsignedLongSequence: { |
64 | 0 |
|
65 | 0 | uint32_t length = mValue.mUnsignedLongSequence.Value().Length(); |
66 | 0 | JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length)); |
67 | 0 | if (!returnArray) { |
68 | 0 | return false; |
69 | 0 | } |
70 | 0 | // Scope for 'tmp' |
71 | 0 | { |
72 | 0 | JS::Rooted<JS::Value> tmp(cx); |
73 | 0 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { |
74 | 0 | // Control block to let us common up the JS_DefineElement calls when there |
75 | 0 | // are different ways to succeed at wrapping the object. |
76 | 0 | do { |
77 | 0 | tmp.setNumber(mValue.mUnsignedLongSequence.Value()[sequenceIdx0]); |
78 | 0 | break; |
79 | 0 | } while (false); |
80 | 0 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, |
81 | 0 | JSPROP_ENUMERATE)) { |
82 | 0 | return false; |
83 | 0 | } |
84 | 0 | } |
85 | 0 | } |
86 | 0 | rval.setObject(*returnArray); |
87 | 0 | return true; |
88 | 0 | break; |
89 | 0 | } |
90 | 0 | default: { |
91 | 0 | return false; |
92 | 0 | break; |
93 | 0 | } |
94 | 0 | } |
95 | 0 | |
96 | 0 | return false; |
97 | 0 | } |
98 | | |
99 | | |
100 | | Uint32Array& |
101 | | OwningUint32ArrayOrUnsignedLongSequence::RawSetAsUint32Array() |
102 | 0 | { |
103 | 0 | if (mType == eUint32Array) { |
104 | 0 | return mValue.mUint32Array.Value(); |
105 | 0 | } |
106 | 0 | MOZ_ASSERT(mType == eUninitialized); |
107 | 0 | mType = eUint32Array; |
108 | 0 | return mValue.mUint32Array.SetValue(); |
109 | 0 | } |
110 | | |
111 | | Uint32Array& |
112 | | OwningUint32ArrayOrUnsignedLongSequence::SetAsUint32Array() |
113 | 0 | { |
114 | 0 | if (mType == eUint32Array) { |
115 | 0 | return mValue.mUint32Array.Value(); |
116 | 0 | } |
117 | 0 | Uninit(); |
118 | 0 | mType = eUint32Array; |
119 | 0 | return mValue.mUint32Array.SetValue(); |
120 | 0 | } |
121 | | |
122 | | bool |
123 | | OwningUint32ArrayOrUnsignedLongSequence::TrySetToUint32Array(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl) |
124 | 0 | { |
125 | 0 | tryNext = false; |
126 | 0 | { // scope for memberSlot |
127 | 0 | Uint32Array& memberSlot = RawSetAsUint32Array(); |
128 | 0 | if (!memberSlot.Init(&value.toObject())) { |
129 | 0 | DestroyUint32Array(); |
130 | 0 | tryNext = true; |
131 | 0 | return true; |
132 | 0 | } |
133 | 0 | } |
134 | 0 | return true; |
135 | 0 | } |
136 | | |
137 | | void |
138 | | OwningUint32ArrayOrUnsignedLongSequence::DestroyUint32Array() |
139 | 0 | { |
140 | 0 | MOZ_ASSERT(IsUint32Array(), "Wrong type!"); |
141 | 0 | mValue.mUint32Array.Destroy(); |
142 | 0 | mType = eUninitialized; |
143 | 0 | } |
144 | | |
145 | | |
146 | | |
147 | | |
148 | | Sequence<uint32_t>& |
149 | | OwningUint32ArrayOrUnsignedLongSequence::RawSetAsUnsignedLongSequence() |
150 | 0 | { |
151 | 0 | if (mType == eUnsignedLongSequence) { |
152 | 0 | return mValue.mUnsignedLongSequence.Value(); |
153 | 0 | } |
154 | 0 | MOZ_ASSERT(mType == eUninitialized); |
155 | 0 | mType = eUnsignedLongSequence; |
156 | 0 | return mValue.mUnsignedLongSequence.SetValue(); |
157 | 0 | } |
158 | | |
159 | | Sequence<uint32_t>& |
160 | | OwningUint32ArrayOrUnsignedLongSequence::SetAsUnsignedLongSequence() |
161 | 0 | { |
162 | 0 | if (mType == eUnsignedLongSequence) { |
163 | 0 | return mValue.mUnsignedLongSequence.Value(); |
164 | 0 | } |
165 | 0 | Uninit(); |
166 | 0 | mType = eUnsignedLongSequence; |
167 | 0 | return mValue.mUnsignedLongSequence.SetValue(); |
168 | 0 | } |
169 | | |
170 | | bool |
171 | | OwningUint32ArrayOrUnsignedLongSequence::TrySetToUnsignedLongSequence(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl) |
172 | 0 | { |
173 | 0 | tryNext = false; |
174 | 0 | { // scope for memberSlot |
175 | 0 | Sequence<uint32_t>& memberSlot = RawSetAsUnsignedLongSequence(); |
176 | 0 | JS::ForOfIterator iter(cx); |
177 | 0 | if (!iter.init(value, JS::ForOfIterator::AllowNonIterable)) { |
178 | 0 | return false; |
179 | 0 | } |
180 | 0 | if (!iter.valueIsIterable()) { |
181 | 0 | DestroyUnsignedLongSequence(); |
182 | 0 | tryNext = true; |
183 | 0 | return true; |
184 | 0 | } |
185 | 0 | Sequence<uint32_t> &arr = memberSlot; |
186 | 0 | JS::Rooted<JS::Value> temp(cx); |
187 | 0 | while (true) { |
188 | 0 | bool done; |
189 | 0 | if (!iter.next(&temp, &done)) { |
190 | 0 | return false; |
191 | 0 | } |
192 | 0 | if (done) { |
193 | 0 | break; |
194 | 0 | } |
195 | 0 | uint32_t* slotPtr = arr.AppendElement(mozilla::fallible); |
196 | 0 | if (!slotPtr) { |
197 | 0 | JS_ReportOutOfMemory(cx); |
198 | 0 | return false; |
199 | 0 | } |
200 | 0 | uint32_t& slot = *slotPtr; |
201 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) { |
202 | 0 | return false; |
203 | 0 | } |
204 | 0 | } |
205 | 0 | } |
206 | 0 | return true; |
207 | 0 | } |
208 | | |
209 | | void |
210 | | OwningUint32ArrayOrUnsignedLongSequence::DestroyUnsignedLongSequence() |
211 | 0 | { |
212 | 0 | MOZ_ASSERT(IsUnsignedLongSequence(), "Wrong type!"); |
213 | 0 | mValue.mUnsignedLongSequence.Destroy(); |
214 | 0 | mType = eUninitialized; |
215 | 0 | } |
216 | | |
217 | | |
218 | | |
219 | | |
220 | | void |
221 | | OwningUint32ArrayOrUnsignedLongSequence::Uninit() |
222 | | { |
223 | | switch (mType) { |
224 | | case eUninitialized: { |
225 | | break; |
226 | | } |
227 | | case eUint32Array: { |
228 | | DestroyUint32Array(); |
229 | | break; |
230 | | } |
231 | | case eUnsignedLongSequence: { |
232 | | DestroyUnsignedLongSequence(); |
233 | | break; |
234 | | } |
235 | | } |
236 | | } |
237 | | |
238 | | bool |
239 | | OwningUint32ArrayOrUnsignedLongSequence::ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const |
240 | 0 | { |
241 | 0 | switch (mType) { |
242 | 0 | case eUninitialized: { |
243 | 0 | return false; |
244 | 0 | break; |
245 | 0 | } |
246 | 0 | case eUint32Array: { |
247 | 0 | rval.setObject(*mValue.mUint32Array.Value().Obj()); |
248 | 0 | if (!MaybeWrapNonDOMObjectValue(cx, rval)) { |
249 | 0 | return false; |
250 | 0 | } |
251 | 0 | return true; |
252 | 0 | break; |
253 | 0 | } |
254 | 0 | case eUnsignedLongSequence: { |
255 | 0 |
|
256 | 0 | uint32_t length = mValue.mUnsignedLongSequence.Value().Length(); |
257 | 0 | JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length)); |
258 | 0 | if (!returnArray) { |
259 | 0 | return false; |
260 | 0 | } |
261 | 0 | // Scope for 'tmp' |
262 | 0 | { |
263 | 0 | JS::Rooted<JS::Value> tmp(cx); |
264 | 0 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { |
265 | 0 | // Control block to let us common up the JS_DefineElement calls when there |
266 | 0 | // are different ways to succeed at wrapping the object. |
267 | 0 | do { |
268 | 0 | tmp.setNumber(mValue.mUnsignedLongSequence.Value()[sequenceIdx0]); |
269 | 0 | break; |
270 | 0 | } while (false); |
271 | 0 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, |
272 | 0 | JSPROP_ENUMERATE)) { |
273 | 0 | return false; |
274 | 0 | } |
275 | 0 | } |
276 | 0 | } |
277 | 0 | rval.setObject(*returnArray); |
278 | 0 | return true; |
279 | 0 | break; |
280 | 0 | } |
281 | 0 | default: { |
282 | 0 | return false; |
283 | 0 | break; |
284 | 0 | } |
285 | 0 | } |
286 | 0 | |
287 | 0 | return false; |
288 | 0 | } |
289 | | |
290 | | void |
291 | | OwningUint32ArrayOrUnsignedLongSequence::TraceUnion(JSTracer* trc) |
292 | | { |
293 | | switch (mType) { |
294 | | case eUint32Array: { |
295 | | mValue.mUint32Array.Value().TraceSelf(trc); |
296 | | break; |
297 | | } |
298 | | default: { |
299 | | break; |
300 | | } |
301 | | } |
302 | | } |
303 | | |
304 | | |
305 | | namespace EXT_color_buffer_float_Binding { |
306 | | |
307 | | static bool |
308 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
309 | 0 | { |
310 | 0 | mozilla::WebGLExtensionEXTColorBufferFloat* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLExtensionEXTColorBufferFloat>(obj); |
311 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
312 | 0 | // obviously can't preserve if we're not initialized. |
313 | 0 | if (self && self->GetWrapperPreserveColor()) { |
314 | 0 | PreserveWrapper(self); |
315 | 0 | } |
316 | 0 | return true; |
317 | 0 | } |
318 | | |
319 | | static void |
320 | | _finalize(js::FreeOp* fop, JSObject* obj) |
321 | 0 | { |
322 | 0 | mozilla::WebGLExtensionEXTColorBufferFloat* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLExtensionEXTColorBufferFloat>(obj); |
323 | 0 | if (self) { |
324 | 0 | ClearWrapper(self, self, obj); |
325 | 0 | AddForDeferredFinalization<mozilla::WebGLExtensionEXTColorBufferFloat>(self); |
326 | 0 | } |
327 | 0 | } |
328 | | |
329 | | static size_t |
330 | | _objectMoved(JSObject* obj, JSObject* old) |
331 | 0 | { |
332 | 0 | mozilla::WebGLExtensionEXTColorBufferFloat* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLExtensionEXTColorBufferFloat>(obj); |
333 | 0 | if (self) { |
334 | 0 | UpdateWrapper(self, self, obj, old); |
335 | 0 | } |
336 | 0 |
|
337 | 0 | return 0; |
338 | 0 | } |
339 | | |
340 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
341 | | { |
342 | | "EXT_color_buffer_floatPrototype", |
343 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
344 | | JS_NULL_CLASS_OPS, |
345 | | JS_NULL_CLASS_SPEC, |
346 | | JS_NULL_CLASS_EXT, |
347 | | JS_NULL_OBJECT_OPS |
348 | | }, |
349 | | eInterfacePrototype, |
350 | | false, |
351 | | prototypes::id::EXT_color_buffer_float, |
352 | | PrototypeTraits<prototypes::id::EXT_color_buffer_float>::Depth, |
353 | | sNativePropertyHooks, |
354 | | "[object EXT_color_buffer_floatPrototype]", |
355 | | JS::GetRealmObjectPrototype |
356 | | }; |
357 | | |
358 | | static const js::ClassOps sClassOps = { |
359 | | _addProperty, /* addProperty */ |
360 | | nullptr, /* delProperty */ |
361 | | nullptr, /* enumerate */ |
362 | | nullptr, /* newEnumerate */ |
363 | | nullptr, /* resolve */ |
364 | | nullptr, /* mayResolve */ |
365 | | _finalize, /* finalize */ |
366 | | nullptr, /* call */ |
367 | | nullptr, /* hasInstance */ |
368 | | nullptr, /* construct */ |
369 | | nullptr, /* trace */ |
370 | | }; |
371 | | |
372 | | static const js::ClassExtension sClassExtension = { |
373 | | nullptr, /* weakmapKeyDelegateOp */ |
374 | | _objectMoved /* objectMovedOp */ |
375 | | }; |
376 | | |
377 | | static const DOMJSClass sClass = { |
378 | | { "EXT_color_buffer_float", |
379 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
380 | | &sClassOps, |
381 | | JS_NULL_CLASS_SPEC, |
382 | | &sClassExtension, |
383 | | JS_NULL_OBJECT_OPS |
384 | | }, |
385 | | { prototypes::id::EXT_color_buffer_float, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
386 | | IsBaseOf<nsISupports, mozilla::WebGLExtensionEXTColorBufferFloat >::value, |
387 | | sNativePropertyHooks, |
388 | | FindAssociatedGlobalForNative<mozilla::WebGLExtensionEXTColorBufferFloat>::Get, |
389 | | GetProtoObjectHandle, |
390 | | GetCCParticipant<mozilla::WebGLExtensionEXTColorBufferFloat>::Get() |
391 | | }; |
392 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
393 | | "Must have the right minimal number of reserved slots."); |
394 | | static_assert(1 >= 1, |
395 | | "Must have enough reserved slots."); |
396 | | |
397 | | const JSClass* |
398 | | GetJSClass() |
399 | 0 | { |
400 | 0 | return sClass.ToJSClass(); |
401 | 0 | } |
402 | | |
403 | | bool |
404 | | Wrap(JSContext* aCx, mozilla::WebGLExtensionEXTColorBufferFloat* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
405 | 0 | { |
406 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::WebGLExtensionEXTColorBufferFloat>::value, |
407 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
408 | 0 | MOZ_ASSERT(static_cast<mozilla::WebGLExtensionEXTColorBufferFloat*>(aObject) == |
409 | 0 | reinterpret_cast<mozilla::WebGLExtensionEXTColorBufferFloat*>(aObject), |
410 | 0 | "Multiple inheritance for mozilla::WebGLExtensionEXTColorBufferFloat is broken."); |
411 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
412 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
413 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
414 | 0 | "You should probably not be using Wrap() directly; use " |
415 | 0 | "GetOrCreateDOMReflector instead"); |
416 | 0 |
|
417 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
418 | 0 | "nsISupports must be on our primary inheritance chain"); |
419 | 0 |
|
420 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
421 | 0 | if (!global) { |
422 | 0 | return false; |
423 | 0 | } |
424 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
425 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
426 | 0 |
|
427 | 0 | // That might have ended up wrapping us already, due to the wonders |
428 | 0 | // of XBL. Check for that, and bail out as needed. |
429 | 0 | aReflector.set(aCache->GetWrapper()); |
430 | 0 | if (aReflector) { |
431 | | #ifdef DEBUG |
432 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
433 | | #endif // DEBUG |
434 | | return true; |
435 | 0 | } |
436 | 0 |
|
437 | 0 | JSAutoRealm ar(aCx, global); |
438 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
439 | 0 | if (!canonicalProto) { |
440 | 0 | return false; |
441 | 0 | } |
442 | 0 | JS::Rooted<JSObject*> proto(aCx); |
443 | 0 | if (aGivenProto) { |
444 | 0 | proto = aGivenProto; |
445 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
446 | 0 | // coming in, we changed compartments to that of "parent" so may need |
447 | 0 | // to wrap the proto here. |
448 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
449 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
450 | 0 | return false; |
451 | 0 | } |
452 | 0 | } |
453 | 0 | } else { |
454 | 0 | proto = canonicalProto; |
455 | 0 | } |
456 | 0 |
|
457 | 0 | BindingJSObjectCreator<mozilla::WebGLExtensionEXTColorBufferFloat> creator(aCx); |
458 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
459 | 0 | if (!aReflector) { |
460 | 0 | return false; |
461 | 0 | } |
462 | 0 | |
463 | 0 | aCache->SetWrapper(aReflector); |
464 | 0 | creator.InitializationSucceeded(); |
465 | 0 |
|
466 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
467 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
468 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
469 | 0 | // otherwise we won't be able to properly recreate it later, since |
470 | 0 | // we won't know what proto to use. Note that we don't check |
471 | 0 | // aGivenProto here, since it's entirely possible (and even |
472 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
473 | 0 | // same as canonicalProto. |
474 | 0 | if (proto != canonicalProto) { |
475 | 0 | PreserveWrapper(aObject); |
476 | 0 | } |
477 | 0 |
|
478 | 0 | return true; |
479 | 0 | } |
480 | | |
481 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
482 | | nullptr, |
483 | | nullptr, |
484 | | nullptr, |
485 | | { nullptr, nullptr }, |
486 | | prototypes::id::EXT_color_buffer_float, |
487 | | constructors::id::_ID_Count, |
488 | | nullptr, |
489 | | &DefaultXrayExpandoObjectClass |
490 | | } }; |
491 | | |
492 | | void |
493 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
494 | 0 | { |
495 | 0 | JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx)); |
496 | 0 | if (!parentProto) { |
497 | 0 | return; |
498 | 0 | } |
499 | 0 | |
500 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::EXT_color_buffer_float); |
501 | 0 | JS::Heap<JSObject*>* interfaceCache = nullptr; |
502 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
503 | 0 | &sPrototypeClass.mBase, protoCache, |
504 | 0 | nullptr, |
505 | 0 | nullptr, nullptr, 0, nullptr, |
506 | 0 | interfaceCache, |
507 | 0 | nullptr, |
508 | 0 | nullptr, |
509 | 0 | nullptr, aDefineOnGlobal, |
510 | 0 | nullptr, |
511 | 0 | false); |
512 | 0 | } |
513 | | |
514 | | } // namespace EXT_color_buffer_float_Binding |
515 | | |
516 | | |
517 | | |
518 | | namespace WebGL2RenderingContext_Binding { |
519 | | |
520 | | MOZ_CAN_RUN_SCRIPT static bool |
521 | | bufferData(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
522 | 0 | { |
523 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bufferData", DOM, cx); |
524 | 0 |
|
525 | 0 | unsigned argcount = std::min(args.length(), 5u); |
526 | 0 | switch (argcount) { |
527 | 0 | case 3: { |
528 | 0 | uint32_t arg0; |
529 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
530 | 0 | return false; |
531 | 0 | } |
532 | 0 | if (args[1].isNullOrUndefined()) { |
533 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg1(cx); |
534 | 0 | arg1.SetNull(); |
535 | 0 | uint32_t arg2; |
536 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
537 | 0 | return false; |
538 | 0 | } |
539 | 0 | self->BufferData(arg0, Constify(arg1), arg2); |
540 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
541 | 0 | args.rval().setUndefined(); |
542 | 0 | return true; |
543 | 0 | } |
544 | 0 | if (args[1].isObject()) { |
545 | 0 | do { |
546 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg1(cx); |
547 | 0 | if (!arg1.SetValue().Init(&args[1].toObject())) { |
548 | 0 | break; |
549 | 0 | } |
550 | 0 | uint32_t arg2; |
551 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
552 | 0 | return false; |
553 | 0 | } |
554 | 0 | self->BufferData(arg0, Constify(arg1), arg2); |
555 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
556 | 0 | args.rval().setUndefined(); |
557 | 0 | return true; |
558 | 0 | } while (false); |
559 | 0 | do { |
560 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg1(cx); |
561 | 0 | if (!arg1.Init(&args[1].toObject())) { |
562 | 0 | break; |
563 | 0 | } |
564 | 0 | uint32_t arg2; |
565 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
566 | 0 | return false; |
567 | 0 | } |
568 | 0 | self->BufferData(arg0, Constify(arg1), arg2); |
569 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
570 | 0 | args.rval().setUndefined(); |
571 | 0 | return true; |
572 | 0 | } while (false); |
573 | 0 | } |
574 | 0 | int64_t arg1; |
575 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[1], &arg1)) { |
576 | 0 | return false; |
577 | 0 | } |
578 | 0 | uint32_t arg2; |
579 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
580 | 0 | return false; |
581 | 0 | } |
582 | 0 | self->BufferData(arg0, arg1, arg2); |
583 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
584 | 0 | args.rval().setUndefined(); |
585 | 0 | return true; |
586 | 0 | break; |
587 | 0 | } |
588 | 0 | case 4: { |
589 | 0 | MOZ_FALLTHROUGH; |
590 | 0 | } |
591 | 0 | case 5: { |
592 | 0 | uint32_t arg0; |
593 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
594 | 0 | return false; |
595 | 0 | } |
596 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg1(cx); |
597 | 0 | if (args[1].isObject()) { |
598 | 0 | if (!arg1.Init(&args[1].toObject())) { |
599 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.bufferData", "ArrayBufferView"); |
600 | 0 | return false; |
601 | 0 | } |
602 | 0 | } else { |
603 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.bufferData"); |
604 | 0 | return false; |
605 | 0 | } |
606 | 0 | uint32_t arg2; |
607 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
608 | 0 | return false; |
609 | 0 | } |
610 | 0 | uint32_t arg3; |
611 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
612 | 0 | return false; |
613 | 0 | } |
614 | 0 | uint32_t arg4; |
615 | 0 | if (args.hasDefined(4)) { |
616 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
617 | 0 | return false; |
618 | 0 | } |
619 | 0 | } else { |
620 | 0 | arg4 = 0U; |
621 | 0 | } |
622 | 0 | self->BufferData(arg0, Constify(arg1), arg2, arg3, arg4); |
623 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
624 | 0 | args.rval().setUndefined(); |
625 | 0 | return true; |
626 | 0 | break; |
627 | 0 | } |
628 | 0 | default: { |
629 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bufferData"); |
630 | 0 | break; |
631 | 0 | } |
632 | 0 | } |
633 | 0 | MOZ_CRASH("We have an always-returning default case"); |
634 | 0 | return false; |
635 | 0 | } |
636 | | |
637 | | static const JSJitInfo bufferData_methodinfo = { |
638 | | { (JSJitGetterOp)bufferData }, |
639 | | { prototypes::id::WebGL2RenderingContext }, |
640 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
641 | | JSJitInfo::Method, |
642 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
643 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
644 | | false, /* isInfallible. False in setters. */ |
645 | | false, /* isMovable. Not relevant for setters. */ |
646 | | false, /* isEliminatable. Not relevant for setters. */ |
647 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
648 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
649 | | false, /* isTypedMethod. Only relevant for methods. */ |
650 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
651 | | }; |
652 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
653 | | static_assert(0 < 1, "There is no slot for us"); |
654 | | |
655 | | MOZ_CAN_RUN_SCRIPT static bool |
656 | | bufferSubData(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
657 | 0 | { |
658 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bufferSubData", DOM, cx); |
659 | 0 |
|
660 | 0 | unsigned argcount = std::min(args.length(), 5u); |
661 | 0 | switch (argcount) { |
662 | 0 | case 3: { |
663 | 0 | uint32_t arg0; |
664 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
665 | 0 | return false; |
666 | 0 | } |
667 | 0 | int64_t arg1; |
668 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[1], &arg1)) { |
669 | 0 | return false; |
670 | 0 | } |
671 | 0 | if (args[2].isObject()) { |
672 | 0 | do { |
673 | 0 | RootedSpiderMonkeyInterface<ArrayBuffer> arg2(cx); |
674 | 0 | if (!arg2.Init(&args[2].toObject())) { |
675 | 0 | break; |
676 | 0 | } |
677 | 0 | self->BufferSubData(arg0, arg1, Constify(arg2)); |
678 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
679 | 0 | args.rval().setUndefined(); |
680 | 0 | return true; |
681 | 0 | } while (false); |
682 | 0 | do { |
683 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg2(cx); |
684 | 0 | if (!arg2.Init(&args[2].toObject())) { |
685 | 0 | break; |
686 | 0 | } |
687 | 0 | self->BufferSubData(arg0, arg1, Constify(arg2)); |
688 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
689 | 0 | args.rval().setUndefined(); |
690 | 0 | return true; |
691 | 0 | } while (false); |
692 | 0 | } |
693 | 0 | return ThrowErrorMessage(cx, MSG_OVERLOAD_RESOLUTION_FAILED, "3", "3", "WebGL2RenderingContext.bufferSubData"); |
694 | 0 | break; |
695 | 0 | } |
696 | 0 | case 4: { |
697 | 0 | MOZ_FALLTHROUGH; |
698 | 0 | } |
699 | 0 | case 5: { |
700 | 0 | uint32_t arg0; |
701 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
702 | 0 | return false; |
703 | 0 | } |
704 | 0 | int64_t arg1; |
705 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[1], &arg1)) { |
706 | 0 | return false; |
707 | 0 | } |
708 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg2(cx); |
709 | 0 | if (args[2].isObject()) { |
710 | 0 | if (!arg2.Init(&args[2].toObject())) { |
711 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 3 of WebGL2RenderingContext.bufferSubData", "ArrayBufferView"); |
712 | 0 | return false; |
713 | 0 | } |
714 | 0 | } else { |
715 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of WebGL2RenderingContext.bufferSubData"); |
716 | 0 | return false; |
717 | 0 | } |
718 | 0 | uint32_t arg3; |
719 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
720 | 0 | return false; |
721 | 0 | } |
722 | 0 | uint32_t arg4; |
723 | 0 | if (args.hasDefined(4)) { |
724 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
725 | 0 | return false; |
726 | 0 | } |
727 | 0 | } else { |
728 | 0 | arg4 = 0U; |
729 | 0 | } |
730 | 0 | self->BufferSubData(arg0, arg1, Constify(arg2), arg3, arg4); |
731 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
732 | 0 | args.rval().setUndefined(); |
733 | 0 | return true; |
734 | 0 | break; |
735 | 0 | } |
736 | 0 | default: { |
737 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bufferSubData"); |
738 | 0 | break; |
739 | 0 | } |
740 | 0 | } |
741 | 0 | MOZ_CRASH("We have an always-returning default case"); |
742 | 0 | return false; |
743 | 0 | } |
744 | | |
745 | | static const JSJitInfo bufferSubData_methodinfo = { |
746 | | { (JSJitGetterOp)bufferSubData }, |
747 | | { prototypes::id::WebGL2RenderingContext }, |
748 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
749 | | JSJitInfo::Method, |
750 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
751 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
752 | | false, /* isInfallible. False in setters. */ |
753 | | false, /* isMovable. Not relevant for setters. */ |
754 | | false, /* isEliminatable. Not relevant for setters. */ |
755 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
756 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
757 | | false, /* isTypedMethod. Only relevant for methods. */ |
758 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
759 | | }; |
760 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
761 | | static_assert(0 < 1, "There is no slot for us"); |
762 | | |
763 | | MOZ_CAN_RUN_SCRIPT static bool |
764 | | copyBufferSubData(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
765 | 0 | { |
766 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.copyBufferSubData", DOM, cx); |
767 | 0 |
|
768 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
769 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.copyBufferSubData"); |
770 | 0 | } |
771 | 0 | uint32_t arg0; |
772 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
773 | 0 | return false; |
774 | 0 | } |
775 | 0 | uint32_t arg1; |
776 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
777 | 0 | return false; |
778 | 0 | } |
779 | 0 | int64_t arg2; |
780 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[2], &arg2)) { |
781 | 0 | return false; |
782 | 0 | } |
783 | 0 | int64_t arg3; |
784 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[3], &arg3)) { |
785 | 0 | return false; |
786 | 0 | } |
787 | 0 | int64_t arg4; |
788 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[4], &arg4)) { |
789 | 0 | return false; |
790 | 0 | } |
791 | 0 | self->CopyBufferSubData(arg0, arg1, arg2, arg3, arg4); |
792 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
793 | 0 | args.rval().setUndefined(); |
794 | 0 | return true; |
795 | 0 | } |
796 | | |
797 | | static const JSJitInfo copyBufferSubData_methodinfo = { |
798 | | { (JSJitGetterOp)copyBufferSubData }, |
799 | | { prototypes::id::WebGL2RenderingContext }, |
800 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
801 | | JSJitInfo::Method, |
802 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
803 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
804 | | false, /* isInfallible. False in setters. */ |
805 | | false, /* isMovable. Not relevant for setters. */ |
806 | | false, /* isEliminatable. Not relevant for setters. */ |
807 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
808 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
809 | | false, /* isTypedMethod. Only relevant for methods. */ |
810 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
811 | | }; |
812 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
813 | | static_assert(0 < 1, "There is no slot for us"); |
814 | | |
815 | | MOZ_CAN_RUN_SCRIPT static bool |
816 | | getBufferSubData(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
817 | 0 | { |
818 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getBufferSubData", DOM, cx); |
819 | 0 |
|
820 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
821 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getBufferSubData"); |
822 | 0 | } |
823 | 0 | uint32_t arg0; |
824 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
825 | 0 | return false; |
826 | 0 | } |
827 | 0 | int64_t arg1; |
828 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[1], &arg1)) { |
829 | 0 | return false; |
830 | 0 | } |
831 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg2(cx); |
832 | 0 | if (args[2].isObject()) { |
833 | 0 | if (!arg2.Init(&args[2].toObject())) { |
834 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 3 of WebGL2RenderingContext.getBufferSubData", "ArrayBufferView"); |
835 | 0 | return false; |
836 | 0 | } |
837 | 0 | } else { |
838 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of WebGL2RenderingContext.getBufferSubData"); |
839 | 0 | return false; |
840 | 0 | } |
841 | 0 | uint32_t arg3; |
842 | 0 | if (args.hasDefined(3)) { |
843 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
844 | 0 | return false; |
845 | 0 | } |
846 | 0 | } else { |
847 | 0 | arg3 = 0U; |
848 | 0 | } |
849 | 0 | uint32_t arg4; |
850 | 0 | if (args.hasDefined(4)) { |
851 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
852 | 0 | return false; |
853 | 0 | } |
854 | 0 | } else { |
855 | 0 | arg4 = 0U; |
856 | 0 | } |
857 | 0 | self->GetBufferSubData(arg0, arg1, Constify(arg2), arg3, arg4); |
858 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
859 | 0 | args.rval().setUndefined(); |
860 | 0 | return true; |
861 | 0 | } |
862 | | |
863 | | static const JSJitInfo getBufferSubData_methodinfo = { |
864 | | { (JSJitGetterOp)getBufferSubData }, |
865 | | { prototypes::id::WebGL2RenderingContext }, |
866 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
867 | | JSJitInfo::Method, |
868 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
869 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
870 | | false, /* isInfallible. False in setters. */ |
871 | | false, /* isMovable. Not relevant for setters. */ |
872 | | false, /* isEliminatable. Not relevant for setters. */ |
873 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
874 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
875 | | false, /* isTypedMethod. Only relevant for methods. */ |
876 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
877 | | }; |
878 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
879 | | static_assert(0 < 1, "There is no slot for us"); |
880 | | |
881 | | MOZ_CAN_RUN_SCRIPT static bool |
882 | | blitFramebuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
883 | 0 | { |
884 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.blitFramebuffer", DOM, cx); |
885 | 0 |
|
886 | 0 | if (MOZ_UNLIKELY(args.length() < 10)) { |
887 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.blitFramebuffer"); |
888 | 0 | } |
889 | 0 | int32_t arg0; |
890 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) { |
891 | 0 | return false; |
892 | 0 | } |
893 | 0 | int32_t arg1; |
894 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
895 | 0 | return false; |
896 | 0 | } |
897 | 0 | int32_t arg2; |
898 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
899 | 0 | return false; |
900 | 0 | } |
901 | 0 | int32_t arg3; |
902 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
903 | 0 | return false; |
904 | 0 | } |
905 | 0 | int32_t arg4; |
906 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
907 | 0 | return false; |
908 | 0 | } |
909 | 0 | int32_t arg5; |
910 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
911 | 0 | return false; |
912 | 0 | } |
913 | 0 | int32_t arg6; |
914 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
915 | 0 | return false; |
916 | 0 | } |
917 | 0 | int32_t arg7; |
918 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
919 | 0 | return false; |
920 | 0 | } |
921 | 0 | uint32_t arg8; |
922 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
923 | 0 | return false; |
924 | 0 | } |
925 | 0 | uint32_t arg9; |
926 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
927 | 0 | return false; |
928 | 0 | } |
929 | 0 | self->BlitFramebuffer(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); |
930 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
931 | 0 | args.rval().setUndefined(); |
932 | 0 | return true; |
933 | 0 | } |
934 | | |
935 | | static const JSJitInfo blitFramebuffer_methodinfo = { |
936 | | { (JSJitGetterOp)blitFramebuffer }, |
937 | | { prototypes::id::WebGL2RenderingContext }, |
938 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
939 | | JSJitInfo::Method, |
940 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
941 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
942 | | false, /* isInfallible. False in setters. */ |
943 | | false, /* isMovable. Not relevant for setters. */ |
944 | | false, /* isEliminatable. Not relevant for setters. */ |
945 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
946 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
947 | | false, /* isTypedMethod. Only relevant for methods. */ |
948 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
949 | | }; |
950 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
951 | | static_assert(0 < 1, "There is no slot for us"); |
952 | | |
953 | | MOZ_CAN_RUN_SCRIPT static bool |
954 | | framebufferTextureLayer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
955 | 0 | { |
956 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.framebufferTextureLayer", DOM, cx); |
957 | 0 |
|
958 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
959 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.framebufferTextureLayer"); |
960 | 0 | } |
961 | 0 | uint32_t arg0; |
962 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
963 | 0 | return false; |
964 | 0 | } |
965 | 0 | uint32_t arg1; |
966 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
967 | 0 | return false; |
968 | 0 | } |
969 | 0 | mozilla::WebGLTexture* arg2; |
970 | 0 | if (args[2].isObject()) { |
971 | 0 | { |
972 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTexture, mozilla::WebGLTexture>(args[2], arg2); |
973 | 0 | if (NS_FAILED(rv)) { |
974 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 3 of WebGL2RenderingContext.framebufferTextureLayer", "WebGLTexture"); |
975 | 0 | return false; |
976 | 0 | } |
977 | 0 | } |
978 | 0 | } else if (args[2].isNullOrUndefined()) { |
979 | 0 | arg2 = nullptr; |
980 | 0 | } else { |
981 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of WebGL2RenderingContext.framebufferTextureLayer"); |
982 | 0 | return false; |
983 | 0 | } |
984 | 0 | int32_t arg3; |
985 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
986 | 0 | return false; |
987 | 0 | } |
988 | 0 | int32_t arg4; |
989 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
990 | 0 | return false; |
991 | 0 | } |
992 | 0 | self->FramebufferTextureLayer(arg0, arg1, MOZ_KnownLive(Constify(arg2)), arg3, arg4); |
993 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
994 | 0 | args.rval().setUndefined(); |
995 | 0 | return true; |
996 | 0 | } |
997 | | |
998 | | static const JSJitInfo framebufferTextureLayer_methodinfo = { |
999 | | { (JSJitGetterOp)framebufferTextureLayer }, |
1000 | | { prototypes::id::WebGL2RenderingContext }, |
1001 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1002 | | JSJitInfo::Method, |
1003 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1004 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1005 | | false, /* isInfallible. False in setters. */ |
1006 | | false, /* isMovable. Not relevant for setters. */ |
1007 | | false, /* isEliminatable. Not relevant for setters. */ |
1008 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1009 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1010 | | false, /* isTypedMethod. Only relevant for methods. */ |
1011 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1012 | | }; |
1013 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1014 | | static_assert(0 < 1, "There is no slot for us"); |
1015 | | |
1016 | | MOZ_CAN_RUN_SCRIPT static bool |
1017 | | invalidateFramebuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1018 | 0 | { |
1019 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.invalidateFramebuffer", DOM, cx); |
1020 | 0 |
|
1021 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
1022 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.invalidateFramebuffer"); |
1023 | 0 | } |
1024 | 0 | uint32_t arg0; |
1025 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1026 | 0 | return false; |
1027 | 0 | } |
1028 | 0 | binding_detail::AutoSequence<uint32_t> arg1; |
1029 | 0 | if (args[1].isObject()) { |
1030 | 0 | JS::ForOfIterator iter(cx); |
1031 | 0 | if (!iter.init(args[1], JS::ForOfIterator::AllowNonIterable)) { |
1032 | 0 | return false; |
1033 | 0 | } |
1034 | 0 | if (!iter.valueIsIterable()) { |
1035 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.invalidateFramebuffer"); |
1036 | 0 | return false; |
1037 | 0 | } |
1038 | 0 | binding_detail::AutoSequence<uint32_t> &arr = arg1; |
1039 | 0 | JS::Rooted<JS::Value> temp(cx); |
1040 | 0 | while (true) { |
1041 | 0 | bool done; |
1042 | 0 | if (!iter.next(&temp, &done)) { |
1043 | 0 | return false; |
1044 | 0 | } |
1045 | 0 | if (done) { |
1046 | 0 | break; |
1047 | 0 | } |
1048 | 0 | uint32_t* slotPtr = arr.AppendElement(mozilla::fallible); |
1049 | 0 | if (!slotPtr) { |
1050 | 0 | JS_ReportOutOfMemory(cx); |
1051 | 0 | return false; |
1052 | 0 | } |
1053 | 0 | uint32_t& slot = *slotPtr; |
1054 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) { |
1055 | 0 | return false; |
1056 | 0 | } |
1057 | 0 | } |
1058 | 0 | } else { |
1059 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.invalidateFramebuffer"); |
1060 | 0 | return false; |
1061 | 0 | } |
1062 | 0 | FastErrorResult rv; |
1063 | 0 | self->InvalidateFramebuffer(arg0, Constify(arg1), rv); |
1064 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1065 | 0 | return false; |
1066 | 0 | } |
1067 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1068 | 0 | args.rval().setUndefined(); |
1069 | 0 | return true; |
1070 | 0 | } |
1071 | | |
1072 | | static const JSJitInfo invalidateFramebuffer_methodinfo = { |
1073 | | { (JSJitGetterOp)invalidateFramebuffer }, |
1074 | | { prototypes::id::WebGL2RenderingContext }, |
1075 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1076 | | JSJitInfo::Method, |
1077 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1078 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1079 | | false, /* isInfallible. False in setters. */ |
1080 | | false, /* isMovable. Not relevant for setters. */ |
1081 | | false, /* isEliminatable. Not relevant for setters. */ |
1082 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1083 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1084 | | false, /* isTypedMethod. Only relevant for methods. */ |
1085 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1086 | | }; |
1087 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1088 | | static_assert(0 < 1, "There is no slot for us"); |
1089 | | |
1090 | | MOZ_CAN_RUN_SCRIPT static bool |
1091 | | invalidateSubFramebuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1092 | 0 | { |
1093 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.invalidateSubFramebuffer", DOM, cx); |
1094 | 0 |
|
1095 | 0 | if (MOZ_UNLIKELY(args.length() < 6)) { |
1096 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.invalidateSubFramebuffer"); |
1097 | 0 | } |
1098 | 0 | uint32_t arg0; |
1099 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1100 | 0 | return false; |
1101 | 0 | } |
1102 | 0 | binding_detail::AutoSequence<uint32_t> arg1; |
1103 | 0 | if (args[1].isObject()) { |
1104 | 0 | JS::ForOfIterator iter(cx); |
1105 | 0 | if (!iter.init(args[1], JS::ForOfIterator::AllowNonIterable)) { |
1106 | 0 | return false; |
1107 | 0 | } |
1108 | 0 | if (!iter.valueIsIterable()) { |
1109 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.invalidateSubFramebuffer"); |
1110 | 0 | return false; |
1111 | 0 | } |
1112 | 0 | binding_detail::AutoSequence<uint32_t> &arr = arg1; |
1113 | 0 | JS::Rooted<JS::Value> temp(cx); |
1114 | 0 | while (true) { |
1115 | 0 | bool done; |
1116 | 0 | if (!iter.next(&temp, &done)) { |
1117 | 0 | return false; |
1118 | 0 | } |
1119 | 0 | if (done) { |
1120 | 0 | break; |
1121 | 0 | } |
1122 | 0 | uint32_t* slotPtr = arr.AppendElement(mozilla::fallible); |
1123 | 0 | if (!slotPtr) { |
1124 | 0 | JS_ReportOutOfMemory(cx); |
1125 | 0 | return false; |
1126 | 0 | } |
1127 | 0 | uint32_t& slot = *slotPtr; |
1128 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) { |
1129 | 0 | return false; |
1130 | 0 | } |
1131 | 0 | } |
1132 | 0 | } else { |
1133 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.invalidateSubFramebuffer"); |
1134 | 0 | return false; |
1135 | 0 | } |
1136 | 0 | int32_t arg2; |
1137 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
1138 | 0 | return false; |
1139 | 0 | } |
1140 | 0 | int32_t arg3; |
1141 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1142 | 0 | return false; |
1143 | 0 | } |
1144 | 0 | int32_t arg4; |
1145 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
1146 | 0 | return false; |
1147 | 0 | } |
1148 | 0 | int32_t arg5; |
1149 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
1150 | 0 | return false; |
1151 | 0 | } |
1152 | 0 | FastErrorResult rv; |
1153 | 0 | self->InvalidateSubFramebuffer(arg0, Constify(arg1), arg2, arg3, arg4, arg5, rv); |
1154 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1155 | 0 | return false; |
1156 | 0 | } |
1157 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1158 | 0 | args.rval().setUndefined(); |
1159 | 0 | return true; |
1160 | 0 | } |
1161 | | |
1162 | | static const JSJitInfo invalidateSubFramebuffer_methodinfo = { |
1163 | | { (JSJitGetterOp)invalidateSubFramebuffer }, |
1164 | | { prototypes::id::WebGL2RenderingContext }, |
1165 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1166 | | JSJitInfo::Method, |
1167 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1168 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1169 | | false, /* isInfallible. False in setters. */ |
1170 | | false, /* isMovable. Not relevant for setters. */ |
1171 | | false, /* isEliminatable. Not relevant for setters. */ |
1172 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1173 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1174 | | false, /* isTypedMethod. Only relevant for methods. */ |
1175 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1176 | | }; |
1177 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1178 | | static_assert(0 < 1, "There is no slot for us"); |
1179 | | |
1180 | | MOZ_CAN_RUN_SCRIPT static bool |
1181 | | readBuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1182 | 0 | { |
1183 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.readBuffer", DOM, cx); |
1184 | 0 |
|
1185 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
1186 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.readBuffer"); |
1187 | 0 | } |
1188 | 0 | uint32_t arg0; |
1189 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1190 | 0 | return false; |
1191 | 0 | } |
1192 | 0 | self->ReadBuffer(arg0); |
1193 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1194 | 0 | args.rval().setUndefined(); |
1195 | 0 | return true; |
1196 | 0 | } |
1197 | | |
1198 | | static const JSJitInfo readBuffer_methodinfo = { |
1199 | | { (JSJitGetterOp)readBuffer }, |
1200 | | { prototypes::id::WebGL2RenderingContext }, |
1201 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1202 | | JSJitInfo::Method, |
1203 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1204 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1205 | | false, /* isInfallible. False in setters. */ |
1206 | | false, /* isMovable. Not relevant for setters. */ |
1207 | | false, /* isEliminatable. Not relevant for setters. */ |
1208 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1209 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1210 | | false, /* isTypedMethod. Only relevant for methods. */ |
1211 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1212 | | }; |
1213 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1214 | | static_assert(0 < 1, "There is no slot for us"); |
1215 | | |
1216 | | MOZ_CAN_RUN_SCRIPT static bool |
1217 | | getInternalformatParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1218 | 0 | { |
1219 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getInternalformatParameter", DOM, cx); |
1220 | 0 |
|
1221 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
1222 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getInternalformatParameter"); |
1223 | 0 | } |
1224 | 0 | uint32_t arg0; |
1225 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1226 | 0 | return false; |
1227 | 0 | } |
1228 | 0 | uint32_t arg1; |
1229 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
1230 | 0 | return false; |
1231 | 0 | } |
1232 | 0 | uint32_t arg2; |
1233 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
1234 | 0 | return false; |
1235 | 0 | } |
1236 | 0 | FastErrorResult rv; |
1237 | 0 | JS::Rooted<JS::Value> result(cx); |
1238 | 0 | self->GetInternalformatParameter(cx, arg0, arg1, arg2, &result, rv); |
1239 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1240 | 0 | return false; |
1241 | 0 | } |
1242 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1243 | 0 | JS::ExposeValueToActiveJS(result); |
1244 | 0 | args.rval().set(result); |
1245 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
1246 | 0 | return false; |
1247 | 0 | } |
1248 | 0 | return true; |
1249 | 0 | } |
1250 | | |
1251 | | static const JSJitInfo getInternalformatParameter_methodinfo = { |
1252 | | { (JSJitGetterOp)getInternalformatParameter }, |
1253 | | { prototypes::id::WebGL2RenderingContext }, |
1254 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1255 | | JSJitInfo::Method, |
1256 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1257 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
1258 | | false, /* isInfallible. False in setters. */ |
1259 | | false, /* isMovable. Not relevant for setters. */ |
1260 | | false, /* isEliminatable. Not relevant for setters. */ |
1261 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1262 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1263 | | false, /* isTypedMethod. Only relevant for methods. */ |
1264 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1265 | | }; |
1266 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1267 | | static_assert(0 < 1, "There is no slot for us"); |
1268 | | |
1269 | | MOZ_CAN_RUN_SCRIPT static bool |
1270 | | renderbufferStorageMultisample(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1271 | 0 | { |
1272 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.renderbufferStorageMultisample", DOM, cx); |
1273 | 0 |
|
1274 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
1275 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.renderbufferStorageMultisample"); |
1276 | 0 | } |
1277 | 0 | uint32_t arg0; |
1278 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1279 | 0 | return false; |
1280 | 0 | } |
1281 | 0 | int32_t arg1; |
1282 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1283 | 0 | return false; |
1284 | 0 | } |
1285 | 0 | uint32_t arg2; |
1286 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
1287 | 0 | return false; |
1288 | 0 | } |
1289 | 0 | int32_t arg3; |
1290 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1291 | 0 | return false; |
1292 | 0 | } |
1293 | 0 | int32_t arg4; |
1294 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
1295 | 0 | return false; |
1296 | 0 | } |
1297 | 0 | self->RenderbufferStorageMultisample(arg0, arg1, arg2, arg3, arg4); |
1298 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1299 | 0 | args.rval().setUndefined(); |
1300 | 0 | return true; |
1301 | 0 | } |
1302 | | |
1303 | | static const JSJitInfo renderbufferStorageMultisample_methodinfo = { |
1304 | | { (JSJitGetterOp)renderbufferStorageMultisample }, |
1305 | | { prototypes::id::WebGL2RenderingContext }, |
1306 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1307 | | JSJitInfo::Method, |
1308 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1309 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1310 | | false, /* isInfallible. False in setters. */ |
1311 | | false, /* isMovable. Not relevant for setters. */ |
1312 | | false, /* isEliminatable. Not relevant for setters. */ |
1313 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1314 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1315 | | false, /* isTypedMethod. Only relevant for methods. */ |
1316 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1317 | | }; |
1318 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1319 | | static_assert(0 < 1, "There is no slot for us"); |
1320 | | |
1321 | | MOZ_CAN_RUN_SCRIPT static bool |
1322 | | texStorage2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1323 | 0 | { |
1324 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texStorage2D", DOM, cx); |
1325 | 0 |
|
1326 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
1327 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texStorage2D"); |
1328 | 0 | } |
1329 | 0 | uint32_t arg0; |
1330 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1331 | 0 | return false; |
1332 | 0 | } |
1333 | 0 | int32_t arg1; |
1334 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1335 | 0 | return false; |
1336 | 0 | } |
1337 | 0 | uint32_t arg2; |
1338 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
1339 | 0 | return false; |
1340 | 0 | } |
1341 | 0 | int32_t arg3; |
1342 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1343 | 0 | return false; |
1344 | 0 | } |
1345 | 0 | int32_t arg4; |
1346 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
1347 | 0 | return false; |
1348 | 0 | } |
1349 | 0 | self->TexStorage2D(arg0, arg1, arg2, arg3, arg4); |
1350 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1351 | 0 | args.rval().setUndefined(); |
1352 | 0 | return true; |
1353 | 0 | } |
1354 | | |
1355 | | static const JSJitInfo texStorage2D_methodinfo = { |
1356 | | { (JSJitGetterOp)texStorage2D }, |
1357 | | { prototypes::id::WebGL2RenderingContext }, |
1358 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1359 | | JSJitInfo::Method, |
1360 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1361 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1362 | | false, /* isInfallible. False in setters. */ |
1363 | | false, /* isMovable. Not relevant for setters. */ |
1364 | | false, /* isEliminatable. Not relevant for setters. */ |
1365 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1366 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1367 | | false, /* isTypedMethod. Only relevant for methods. */ |
1368 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1369 | | }; |
1370 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1371 | | static_assert(0 < 1, "There is no slot for us"); |
1372 | | |
1373 | | MOZ_CAN_RUN_SCRIPT static bool |
1374 | | texStorage3D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1375 | 0 | { |
1376 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texStorage3D", DOM, cx); |
1377 | 0 |
|
1378 | 0 | if (MOZ_UNLIKELY(args.length() < 6)) { |
1379 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texStorage3D"); |
1380 | 0 | } |
1381 | 0 | uint32_t arg0; |
1382 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1383 | 0 | return false; |
1384 | 0 | } |
1385 | 0 | int32_t arg1; |
1386 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1387 | 0 | return false; |
1388 | 0 | } |
1389 | 0 | uint32_t arg2; |
1390 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
1391 | 0 | return false; |
1392 | 0 | } |
1393 | 0 | int32_t arg3; |
1394 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1395 | 0 | return false; |
1396 | 0 | } |
1397 | 0 | int32_t arg4; |
1398 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
1399 | 0 | return false; |
1400 | 0 | } |
1401 | 0 | int32_t arg5; |
1402 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
1403 | 0 | return false; |
1404 | 0 | } |
1405 | 0 | self->TexStorage3D(arg0, arg1, arg2, arg3, arg4, arg5); |
1406 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1407 | 0 | args.rval().setUndefined(); |
1408 | 0 | return true; |
1409 | 0 | } |
1410 | | |
1411 | | static const JSJitInfo texStorage3D_methodinfo = { |
1412 | | { (JSJitGetterOp)texStorage3D }, |
1413 | | { prototypes::id::WebGL2RenderingContext }, |
1414 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1415 | | JSJitInfo::Method, |
1416 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1417 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1418 | | false, /* isInfallible. False in setters. */ |
1419 | | false, /* isMovable. Not relevant for setters. */ |
1420 | | false, /* isEliminatable. Not relevant for setters. */ |
1421 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1422 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1423 | | false, /* isTypedMethod. Only relevant for methods. */ |
1424 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1425 | | }; |
1426 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1427 | | static_assert(0 < 1, "There is no slot for us"); |
1428 | | |
1429 | | MOZ_CAN_RUN_SCRIPT static bool |
1430 | | texImage2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1431 | 0 | { |
1432 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texImage2D", DOM, cx); |
1433 | 0 |
|
1434 | 0 | unsigned argcount = std::min(args.length(), 10u); |
1435 | 0 | switch (argcount) { |
1436 | 0 | case 6: { |
1437 | 0 | uint32_t arg0; |
1438 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1439 | 0 | return false; |
1440 | 0 | } |
1441 | 0 | int32_t arg1; |
1442 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1443 | 0 | return false; |
1444 | 0 | } |
1445 | 0 | int32_t arg2; |
1446 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
1447 | 0 | return false; |
1448 | 0 | } |
1449 | 0 | uint32_t arg3; |
1450 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
1451 | 0 | return false; |
1452 | 0 | } |
1453 | 0 | uint32_t arg4; |
1454 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
1455 | 0 | return false; |
1456 | 0 | } |
1457 | 0 | if (args[5].isObject()) { |
1458 | 0 | do { |
1459 | 0 | NonNull<mozilla::dom::HTMLCanvasElement> arg5; |
1460 | 0 | { |
1461 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLCanvasElement, mozilla::dom::HTMLCanvasElement>(args[5], arg5); |
1462 | 0 | if (NS_FAILED(rv)) { |
1463 | 0 | break; |
1464 | 0 | } |
1465 | 0 | } |
1466 | 0 | FastErrorResult rv; |
1467 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, MOZ_KnownLive(NonNullHelper(arg5)), rv); |
1468 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1469 | 0 | return false; |
1470 | 0 | } |
1471 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1472 | 0 | args.rval().setUndefined(); |
1473 | 0 | return true; |
1474 | 0 | } while (false); |
1475 | 0 | do { |
1476 | 0 | NonNull<mozilla::dom::HTMLImageElement> arg5; |
1477 | 0 | { |
1478 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLImageElement, mozilla::dom::HTMLImageElement>(args[5], arg5); |
1479 | 0 | if (NS_FAILED(rv)) { |
1480 | 0 | break; |
1481 | 0 | } |
1482 | 0 | } |
1483 | 0 | FastErrorResult rv; |
1484 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, MOZ_KnownLive(NonNullHelper(arg5)), rv); |
1485 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1486 | 0 | return false; |
1487 | 0 | } |
1488 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1489 | 0 | args.rval().setUndefined(); |
1490 | 0 | return true; |
1491 | 0 | } while (false); |
1492 | 0 | do { |
1493 | 0 | NonNull<mozilla::dom::HTMLVideoElement> arg5; |
1494 | 0 | { |
1495 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLVideoElement, mozilla::dom::HTMLVideoElement>(args[5], arg5); |
1496 | 0 | if (NS_FAILED(rv)) { |
1497 | 0 | break; |
1498 | 0 | } |
1499 | 0 | } |
1500 | 0 | FastErrorResult rv; |
1501 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, MOZ_KnownLive(NonNullHelper(arg5)), rv); |
1502 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1503 | 0 | return false; |
1504 | 0 | } |
1505 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1506 | 0 | args.rval().setUndefined(); |
1507 | 0 | return true; |
1508 | 0 | } while (false); |
1509 | 0 | do { |
1510 | 0 | NonNull<mozilla::dom::ImageBitmap> arg5; |
1511 | 0 | { |
1512 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageBitmap, mozilla::dom::ImageBitmap>(args[5], arg5); |
1513 | 0 | if (NS_FAILED(rv)) { |
1514 | 0 | break; |
1515 | 0 | } |
1516 | 0 | } |
1517 | 0 | FastErrorResult rv; |
1518 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, MOZ_KnownLive(NonNullHelper(arg5)), rv); |
1519 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1520 | 0 | return false; |
1521 | 0 | } |
1522 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1523 | 0 | args.rval().setUndefined(); |
1524 | 0 | return true; |
1525 | 0 | } while (false); |
1526 | 0 | do { |
1527 | 0 | NonNull<mozilla::dom::ImageData> arg5; |
1528 | 0 | { |
1529 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageData, mozilla::dom::ImageData>(args[5], arg5); |
1530 | 0 | if (NS_FAILED(rv)) { |
1531 | 0 | break; |
1532 | 0 | } |
1533 | 0 | } |
1534 | 0 | FastErrorResult rv; |
1535 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, MOZ_KnownLive(NonNullHelper(arg5)), rv); |
1536 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1537 | 0 | return false; |
1538 | 0 | } |
1539 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1540 | 0 | args.rval().setUndefined(); |
1541 | 0 | return true; |
1542 | 0 | } while (false); |
1543 | 0 | } |
1544 | 0 | return ThrowErrorMessage(cx, MSG_OVERLOAD_RESOLUTION_FAILED, "6", "6", "WebGL2RenderingContext.texImage2D"); |
1545 | 0 | break; |
1546 | 0 | } |
1547 | 0 | case 9: { |
1548 | 0 | uint32_t arg0; |
1549 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1550 | 0 | return false; |
1551 | 0 | } |
1552 | 0 | int32_t arg1; |
1553 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1554 | 0 | return false; |
1555 | 0 | } |
1556 | 0 | int32_t arg2; |
1557 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
1558 | 0 | return false; |
1559 | 0 | } |
1560 | 0 | int32_t arg3; |
1561 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1562 | 0 | return false; |
1563 | 0 | } |
1564 | 0 | int32_t arg4; |
1565 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
1566 | 0 | return false; |
1567 | 0 | } |
1568 | 0 | int32_t arg5; |
1569 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
1570 | 0 | return false; |
1571 | 0 | } |
1572 | 0 | uint32_t arg6; |
1573 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[6], &arg6)) { |
1574 | 0 | return false; |
1575 | 0 | } |
1576 | 0 | uint32_t arg7; |
1577 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
1578 | 0 | return false; |
1579 | 0 | } |
1580 | 0 | if (args[8].isNullOrUndefined()) { |
1581 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg8(cx); |
1582 | 0 | arg8.SetNull(); |
1583 | 0 | FastErrorResult rv; |
1584 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, Constify(arg8), rv); |
1585 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1586 | 0 | return false; |
1587 | 0 | } |
1588 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1589 | 0 | args.rval().setUndefined(); |
1590 | 0 | return true; |
1591 | 0 | } |
1592 | 0 | if (args[8].isObject()) { |
1593 | 0 | do { |
1594 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg8(cx); |
1595 | 0 | if (!arg8.SetValue().Init(&args[8].toObject())) { |
1596 | 0 | break; |
1597 | 0 | } |
1598 | 0 | FastErrorResult rv; |
1599 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, Constify(arg8), rv); |
1600 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1601 | 0 | return false; |
1602 | 0 | } |
1603 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1604 | 0 | args.rval().setUndefined(); |
1605 | 0 | return true; |
1606 | 0 | } while (false); |
1607 | 0 | do { |
1608 | 0 | NonNull<mozilla::dom::HTMLCanvasElement> arg8; |
1609 | 0 | { |
1610 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLCanvasElement, mozilla::dom::HTMLCanvasElement>(args[8], arg8); |
1611 | 0 | if (NS_FAILED(rv)) { |
1612 | 0 | break; |
1613 | 0 | } |
1614 | 0 | } |
1615 | 0 | FastErrorResult rv; |
1616 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
1617 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1618 | 0 | return false; |
1619 | 0 | } |
1620 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1621 | 0 | args.rval().setUndefined(); |
1622 | 0 | return true; |
1623 | 0 | } while (false); |
1624 | 0 | do { |
1625 | 0 | NonNull<mozilla::dom::HTMLImageElement> arg8; |
1626 | 0 | { |
1627 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLImageElement, mozilla::dom::HTMLImageElement>(args[8], arg8); |
1628 | 0 | if (NS_FAILED(rv)) { |
1629 | 0 | break; |
1630 | 0 | } |
1631 | 0 | } |
1632 | 0 | FastErrorResult rv; |
1633 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
1634 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1635 | 0 | return false; |
1636 | 0 | } |
1637 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1638 | 0 | args.rval().setUndefined(); |
1639 | 0 | return true; |
1640 | 0 | } while (false); |
1641 | 0 | do { |
1642 | 0 | NonNull<mozilla::dom::HTMLVideoElement> arg8; |
1643 | 0 | { |
1644 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLVideoElement, mozilla::dom::HTMLVideoElement>(args[8], arg8); |
1645 | 0 | if (NS_FAILED(rv)) { |
1646 | 0 | break; |
1647 | 0 | } |
1648 | 0 | } |
1649 | 0 | FastErrorResult rv; |
1650 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
1651 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1652 | 0 | return false; |
1653 | 0 | } |
1654 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1655 | 0 | args.rval().setUndefined(); |
1656 | 0 | return true; |
1657 | 0 | } while (false); |
1658 | 0 | do { |
1659 | 0 | NonNull<mozilla::dom::ImageBitmap> arg8; |
1660 | 0 | { |
1661 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageBitmap, mozilla::dom::ImageBitmap>(args[8], arg8); |
1662 | 0 | if (NS_FAILED(rv)) { |
1663 | 0 | break; |
1664 | 0 | } |
1665 | 0 | } |
1666 | 0 | FastErrorResult rv; |
1667 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
1668 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1669 | 0 | return false; |
1670 | 0 | } |
1671 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1672 | 0 | args.rval().setUndefined(); |
1673 | 0 | return true; |
1674 | 0 | } while (false); |
1675 | 0 | do { |
1676 | 0 | NonNull<mozilla::dom::ImageData> arg8; |
1677 | 0 | { |
1678 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageData, mozilla::dom::ImageData>(args[8], arg8); |
1679 | 0 | if (NS_FAILED(rv)) { |
1680 | 0 | break; |
1681 | 0 | } |
1682 | 0 | } |
1683 | 0 | FastErrorResult rv; |
1684 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
1685 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1686 | 0 | return false; |
1687 | 0 | } |
1688 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1689 | 0 | args.rval().setUndefined(); |
1690 | 0 | return true; |
1691 | 0 | } while (false); |
1692 | 0 | } |
1693 | 0 | int64_t arg8; |
1694 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[8], &arg8)) { |
1695 | 0 | return false; |
1696 | 0 | } |
1697 | 0 | FastErrorResult rv; |
1698 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, rv); |
1699 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1700 | 0 | return false; |
1701 | 0 | } |
1702 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1703 | 0 | args.rval().setUndefined(); |
1704 | 0 | return true; |
1705 | 0 | break; |
1706 | 0 | } |
1707 | 0 | case 10: { |
1708 | 0 | uint32_t arg0; |
1709 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1710 | 0 | return false; |
1711 | 0 | } |
1712 | 0 | int32_t arg1; |
1713 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1714 | 0 | return false; |
1715 | 0 | } |
1716 | 0 | int32_t arg2; |
1717 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
1718 | 0 | return false; |
1719 | 0 | } |
1720 | 0 | int32_t arg3; |
1721 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1722 | 0 | return false; |
1723 | 0 | } |
1724 | 0 | int32_t arg4; |
1725 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
1726 | 0 | return false; |
1727 | 0 | } |
1728 | 0 | int32_t arg5; |
1729 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
1730 | 0 | return false; |
1731 | 0 | } |
1732 | 0 | uint32_t arg6; |
1733 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[6], &arg6)) { |
1734 | 0 | return false; |
1735 | 0 | } |
1736 | 0 | uint32_t arg7; |
1737 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
1738 | 0 | return false; |
1739 | 0 | } |
1740 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg8(cx); |
1741 | 0 | if (args[8].isObject()) { |
1742 | 0 | if (!arg8.Init(&args[8].toObject())) { |
1743 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 9 of WebGL2RenderingContext.texImage2D", "ArrayBufferView"); |
1744 | 0 | return false; |
1745 | 0 | } |
1746 | 0 | } else { |
1747 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 9 of WebGL2RenderingContext.texImage2D"); |
1748 | 0 | return false; |
1749 | 0 | } |
1750 | 0 | uint32_t arg9; |
1751 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
1752 | 0 | return false; |
1753 | 0 | } |
1754 | 0 | FastErrorResult rv; |
1755 | 0 | self->TexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, Constify(arg8), arg9, rv); |
1756 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1757 | 0 | return false; |
1758 | 0 | } |
1759 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1760 | 0 | args.rval().setUndefined(); |
1761 | 0 | return true; |
1762 | 0 | break; |
1763 | 0 | } |
1764 | 0 | default: { |
1765 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texImage2D"); |
1766 | 0 | break; |
1767 | 0 | } |
1768 | 0 | } |
1769 | 0 | MOZ_CRASH("We have an always-returning default case"); |
1770 | 0 | return false; |
1771 | 0 | } |
1772 | | |
1773 | | static const JSJitInfo texImage2D_methodinfo = { |
1774 | | { (JSJitGetterOp)texImage2D }, |
1775 | | { prototypes::id::WebGL2RenderingContext }, |
1776 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
1777 | | JSJitInfo::Method, |
1778 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1779 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1780 | | false, /* isInfallible. False in setters. */ |
1781 | | false, /* isMovable. Not relevant for setters. */ |
1782 | | false, /* isEliminatable. Not relevant for setters. */ |
1783 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1784 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1785 | | false, /* isTypedMethod. Only relevant for methods. */ |
1786 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1787 | | }; |
1788 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1789 | | static_assert(0 < 1, "There is no slot for us"); |
1790 | | |
1791 | | MOZ_CAN_RUN_SCRIPT static bool |
1792 | | texSubImage2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
1793 | 0 | { |
1794 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texSubImage2D", DOM, cx); |
1795 | 0 |
|
1796 | 0 | unsigned argcount = std::min(args.length(), 10u); |
1797 | 0 | switch (argcount) { |
1798 | 0 | case 7: { |
1799 | 0 | uint32_t arg0; |
1800 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1801 | 0 | return false; |
1802 | 0 | } |
1803 | 0 | int32_t arg1; |
1804 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1805 | 0 | return false; |
1806 | 0 | } |
1807 | 0 | int32_t arg2; |
1808 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
1809 | 0 | return false; |
1810 | 0 | } |
1811 | 0 | int32_t arg3; |
1812 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1813 | 0 | return false; |
1814 | 0 | } |
1815 | 0 | uint32_t arg4; |
1816 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
1817 | 0 | return false; |
1818 | 0 | } |
1819 | 0 | uint32_t arg5; |
1820 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[5], &arg5)) { |
1821 | 0 | return false; |
1822 | 0 | } |
1823 | 0 | if (args[6].isObject()) { |
1824 | 0 | do { |
1825 | 0 | NonNull<mozilla::dom::HTMLCanvasElement> arg6; |
1826 | 0 | { |
1827 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLCanvasElement, mozilla::dom::HTMLCanvasElement>(args[6], arg6); |
1828 | 0 | if (NS_FAILED(rv)) { |
1829 | 0 | break; |
1830 | 0 | } |
1831 | 0 | } |
1832 | 0 | FastErrorResult rv; |
1833 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, MOZ_KnownLive(NonNullHelper(arg6)), rv); |
1834 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1835 | 0 | return false; |
1836 | 0 | } |
1837 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1838 | 0 | args.rval().setUndefined(); |
1839 | 0 | return true; |
1840 | 0 | } while (false); |
1841 | 0 | do { |
1842 | 0 | NonNull<mozilla::dom::HTMLImageElement> arg6; |
1843 | 0 | { |
1844 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLImageElement, mozilla::dom::HTMLImageElement>(args[6], arg6); |
1845 | 0 | if (NS_FAILED(rv)) { |
1846 | 0 | break; |
1847 | 0 | } |
1848 | 0 | } |
1849 | 0 | FastErrorResult rv; |
1850 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, MOZ_KnownLive(NonNullHelper(arg6)), rv); |
1851 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1852 | 0 | return false; |
1853 | 0 | } |
1854 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1855 | 0 | args.rval().setUndefined(); |
1856 | 0 | return true; |
1857 | 0 | } while (false); |
1858 | 0 | do { |
1859 | 0 | NonNull<mozilla::dom::HTMLVideoElement> arg6; |
1860 | 0 | { |
1861 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLVideoElement, mozilla::dom::HTMLVideoElement>(args[6], arg6); |
1862 | 0 | if (NS_FAILED(rv)) { |
1863 | 0 | break; |
1864 | 0 | } |
1865 | 0 | } |
1866 | 0 | FastErrorResult rv; |
1867 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, MOZ_KnownLive(NonNullHelper(arg6)), rv); |
1868 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1869 | 0 | return false; |
1870 | 0 | } |
1871 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1872 | 0 | args.rval().setUndefined(); |
1873 | 0 | return true; |
1874 | 0 | } while (false); |
1875 | 0 | do { |
1876 | 0 | NonNull<mozilla::dom::ImageBitmap> arg6; |
1877 | 0 | { |
1878 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageBitmap, mozilla::dom::ImageBitmap>(args[6], arg6); |
1879 | 0 | if (NS_FAILED(rv)) { |
1880 | 0 | break; |
1881 | 0 | } |
1882 | 0 | } |
1883 | 0 | FastErrorResult rv; |
1884 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, MOZ_KnownLive(NonNullHelper(arg6)), rv); |
1885 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1886 | 0 | return false; |
1887 | 0 | } |
1888 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1889 | 0 | args.rval().setUndefined(); |
1890 | 0 | return true; |
1891 | 0 | } while (false); |
1892 | 0 | do { |
1893 | 0 | NonNull<mozilla::dom::ImageData> arg6; |
1894 | 0 | { |
1895 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageData, mozilla::dom::ImageData>(args[6], arg6); |
1896 | 0 | if (NS_FAILED(rv)) { |
1897 | 0 | break; |
1898 | 0 | } |
1899 | 0 | } |
1900 | 0 | FastErrorResult rv; |
1901 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, MOZ_KnownLive(NonNullHelper(arg6)), rv); |
1902 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1903 | 0 | return false; |
1904 | 0 | } |
1905 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1906 | 0 | args.rval().setUndefined(); |
1907 | 0 | return true; |
1908 | 0 | } while (false); |
1909 | 0 | } |
1910 | 0 | return ThrowErrorMessage(cx, MSG_OVERLOAD_RESOLUTION_FAILED, "7", "7", "WebGL2RenderingContext.texSubImage2D"); |
1911 | 0 | break; |
1912 | 0 | } |
1913 | 0 | case 9: { |
1914 | 0 | uint32_t arg0; |
1915 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
1916 | 0 | return false; |
1917 | 0 | } |
1918 | 0 | int32_t arg1; |
1919 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
1920 | 0 | return false; |
1921 | 0 | } |
1922 | 0 | int32_t arg2; |
1923 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
1924 | 0 | return false; |
1925 | 0 | } |
1926 | 0 | int32_t arg3; |
1927 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
1928 | 0 | return false; |
1929 | 0 | } |
1930 | 0 | int32_t arg4; |
1931 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
1932 | 0 | return false; |
1933 | 0 | } |
1934 | 0 | int32_t arg5; |
1935 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
1936 | 0 | return false; |
1937 | 0 | } |
1938 | 0 | uint32_t arg6; |
1939 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[6], &arg6)) { |
1940 | 0 | return false; |
1941 | 0 | } |
1942 | 0 | uint32_t arg7; |
1943 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
1944 | 0 | return false; |
1945 | 0 | } |
1946 | 0 | if (args[8].isNullOrUndefined()) { |
1947 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg8(cx); |
1948 | 0 | arg8.SetNull(); |
1949 | 0 | FastErrorResult rv; |
1950 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, Constify(arg8), rv); |
1951 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1952 | 0 | return false; |
1953 | 0 | } |
1954 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1955 | 0 | args.rval().setUndefined(); |
1956 | 0 | return true; |
1957 | 0 | } |
1958 | 0 | if (args[8].isObject()) { |
1959 | 0 | do { |
1960 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg8(cx); |
1961 | 0 | if (!arg8.SetValue().Init(&args[8].toObject())) { |
1962 | 0 | break; |
1963 | 0 | } |
1964 | 0 | FastErrorResult rv; |
1965 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, Constify(arg8), rv); |
1966 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1967 | 0 | return false; |
1968 | 0 | } |
1969 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1970 | 0 | args.rval().setUndefined(); |
1971 | 0 | return true; |
1972 | 0 | } while (false); |
1973 | 0 | do { |
1974 | 0 | NonNull<mozilla::dom::HTMLCanvasElement> arg8; |
1975 | 0 | { |
1976 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLCanvasElement, mozilla::dom::HTMLCanvasElement>(args[8], arg8); |
1977 | 0 | if (NS_FAILED(rv)) { |
1978 | 0 | break; |
1979 | 0 | } |
1980 | 0 | } |
1981 | 0 | FastErrorResult rv; |
1982 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
1983 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1984 | 0 | return false; |
1985 | 0 | } |
1986 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1987 | 0 | args.rval().setUndefined(); |
1988 | 0 | return true; |
1989 | 0 | } while (false); |
1990 | 0 | do { |
1991 | 0 | NonNull<mozilla::dom::HTMLImageElement> arg8; |
1992 | 0 | { |
1993 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLImageElement, mozilla::dom::HTMLImageElement>(args[8], arg8); |
1994 | 0 | if (NS_FAILED(rv)) { |
1995 | 0 | break; |
1996 | 0 | } |
1997 | 0 | } |
1998 | 0 | FastErrorResult rv; |
1999 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
2000 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2001 | 0 | return false; |
2002 | 0 | } |
2003 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2004 | 0 | args.rval().setUndefined(); |
2005 | 0 | return true; |
2006 | 0 | } while (false); |
2007 | 0 | do { |
2008 | 0 | NonNull<mozilla::dom::HTMLVideoElement> arg8; |
2009 | 0 | { |
2010 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLVideoElement, mozilla::dom::HTMLVideoElement>(args[8], arg8); |
2011 | 0 | if (NS_FAILED(rv)) { |
2012 | 0 | break; |
2013 | 0 | } |
2014 | 0 | } |
2015 | 0 | FastErrorResult rv; |
2016 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
2017 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2018 | 0 | return false; |
2019 | 0 | } |
2020 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2021 | 0 | args.rval().setUndefined(); |
2022 | 0 | return true; |
2023 | 0 | } while (false); |
2024 | 0 | do { |
2025 | 0 | NonNull<mozilla::dom::ImageBitmap> arg8; |
2026 | 0 | { |
2027 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageBitmap, mozilla::dom::ImageBitmap>(args[8], arg8); |
2028 | 0 | if (NS_FAILED(rv)) { |
2029 | 0 | break; |
2030 | 0 | } |
2031 | 0 | } |
2032 | 0 | FastErrorResult rv; |
2033 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
2034 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2035 | 0 | return false; |
2036 | 0 | } |
2037 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2038 | 0 | args.rval().setUndefined(); |
2039 | 0 | return true; |
2040 | 0 | } while (false); |
2041 | 0 | do { |
2042 | 0 | NonNull<mozilla::dom::ImageData> arg8; |
2043 | 0 | { |
2044 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageData, mozilla::dom::ImageData>(args[8], arg8); |
2045 | 0 | if (NS_FAILED(rv)) { |
2046 | 0 | break; |
2047 | 0 | } |
2048 | 0 | } |
2049 | 0 | FastErrorResult rv; |
2050 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, MOZ_KnownLive(NonNullHelper(arg8)), rv); |
2051 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2052 | 0 | return false; |
2053 | 0 | } |
2054 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2055 | 0 | args.rval().setUndefined(); |
2056 | 0 | return true; |
2057 | 0 | } while (false); |
2058 | 0 | } |
2059 | 0 | int64_t arg8; |
2060 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[8], &arg8)) { |
2061 | 0 | return false; |
2062 | 0 | } |
2063 | 0 | FastErrorResult rv; |
2064 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, rv); |
2065 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2066 | 0 | return false; |
2067 | 0 | } |
2068 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2069 | 0 | args.rval().setUndefined(); |
2070 | 0 | return true; |
2071 | 0 | break; |
2072 | 0 | } |
2073 | 0 | case 10: { |
2074 | 0 | uint32_t arg0; |
2075 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2076 | 0 | return false; |
2077 | 0 | } |
2078 | 0 | int32_t arg1; |
2079 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2080 | 0 | return false; |
2081 | 0 | } |
2082 | 0 | int32_t arg2; |
2083 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
2084 | 0 | return false; |
2085 | 0 | } |
2086 | 0 | int32_t arg3; |
2087 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2088 | 0 | return false; |
2089 | 0 | } |
2090 | 0 | int32_t arg4; |
2091 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2092 | 0 | return false; |
2093 | 0 | } |
2094 | 0 | int32_t arg5; |
2095 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2096 | 0 | return false; |
2097 | 0 | } |
2098 | 0 | uint32_t arg6; |
2099 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[6], &arg6)) { |
2100 | 0 | return false; |
2101 | 0 | } |
2102 | 0 | uint32_t arg7; |
2103 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
2104 | 0 | return false; |
2105 | 0 | } |
2106 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg8(cx); |
2107 | 0 | if (args[8].isObject()) { |
2108 | 0 | if (!arg8.Init(&args[8].toObject())) { |
2109 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 9 of WebGL2RenderingContext.texSubImage2D", "ArrayBufferView"); |
2110 | 0 | return false; |
2111 | 0 | } |
2112 | 0 | } else { |
2113 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 9 of WebGL2RenderingContext.texSubImage2D"); |
2114 | 0 | return false; |
2115 | 0 | } |
2116 | 0 | uint32_t arg9; |
2117 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
2118 | 0 | return false; |
2119 | 0 | } |
2120 | 0 | FastErrorResult rv; |
2121 | 0 | self->TexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, Constify(arg8), arg9, rv); |
2122 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2123 | 0 | return false; |
2124 | 0 | } |
2125 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2126 | 0 | args.rval().setUndefined(); |
2127 | 0 | return true; |
2128 | 0 | break; |
2129 | 0 | } |
2130 | 0 | default: { |
2131 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texSubImage2D"); |
2132 | 0 | break; |
2133 | 0 | } |
2134 | 0 | } |
2135 | 0 | MOZ_CRASH("We have an always-returning default case"); |
2136 | 0 | return false; |
2137 | 0 | } |
2138 | | |
2139 | | static const JSJitInfo texSubImage2D_methodinfo = { |
2140 | | { (JSJitGetterOp)texSubImage2D }, |
2141 | | { prototypes::id::WebGL2RenderingContext }, |
2142 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
2143 | | JSJitInfo::Method, |
2144 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
2145 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
2146 | | false, /* isInfallible. False in setters. */ |
2147 | | false, /* isMovable. Not relevant for setters. */ |
2148 | | false, /* isEliminatable. Not relevant for setters. */ |
2149 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
2150 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
2151 | | false, /* isTypedMethod. Only relevant for methods. */ |
2152 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
2153 | | }; |
2154 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
2155 | | static_assert(0 < 1, "There is no slot for us"); |
2156 | | |
2157 | | MOZ_CAN_RUN_SCRIPT static bool |
2158 | | texImage3D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
2159 | 0 | { |
2160 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texImage3D", DOM, cx); |
2161 | 0 |
|
2162 | 0 | unsigned argcount = std::min(args.length(), 11u); |
2163 | 0 | switch (argcount) { |
2164 | 0 | case 10: { |
2165 | 0 | uint32_t arg0; |
2166 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2167 | 0 | return false; |
2168 | 0 | } |
2169 | 0 | int32_t arg1; |
2170 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2171 | 0 | return false; |
2172 | 0 | } |
2173 | 0 | int32_t arg2; |
2174 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
2175 | 0 | return false; |
2176 | 0 | } |
2177 | 0 | int32_t arg3; |
2178 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2179 | 0 | return false; |
2180 | 0 | } |
2181 | 0 | int32_t arg4; |
2182 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2183 | 0 | return false; |
2184 | 0 | } |
2185 | 0 | int32_t arg5; |
2186 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2187 | 0 | return false; |
2188 | 0 | } |
2189 | 0 | int32_t arg6; |
2190 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
2191 | 0 | return false; |
2192 | 0 | } |
2193 | 0 | uint32_t arg7; |
2194 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
2195 | 0 | return false; |
2196 | 0 | } |
2197 | 0 | uint32_t arg8; |
2198 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
2199 | 0 | return false; |
2200 | 0 | } |
2201 | 0 | if (args[9].isNullOrUndefined()) { |
2202 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg9(cx); |
2203 | 0 | arg9.SetNull(); |
2204 | 0 | FastErrorResult rv; |
2205 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, Constify(arg9), rv); |
2206 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2207 | 0 | return false; |
2208 | 0 | } |
2209 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2210 | 0 | args.rval().setUndefined(); |
2211 | 0 | return true; |
2212 | 0 | } |
2213 | 0 | if (args[9].isObject()) { |
2214 | 0 | do { |
2215 | 0 | NonNull<mozilla::dom::HTMLCanvasElement> arg9; |
2216 | 0 | { |
2217 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLCanvasElement, mozilla::dom::HTMLCanvasElement>(args[9], arg9); |
2218 | 0 | if (NS_FAILED(rv)) { |
2219 | 0 | break; |
2220 | 0 | } |
2221 | 0 | } |
2222 | 0 | FastErrorResult rv; |
2223 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, MOZ_KnownLive(NonNullHelper(arg9)), rv); |
2224 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2225 | 0 | return false; |
2226 | 0 | } |
2227 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2228 | 0 | args.rval().setUndefined(); |
2229 | 0 | return true; |
2230 | 0 | } while (false); |
2231 | 0 | do { |
2232 | 0 | NonNull<mozilla::dom::HTMLImageElement> arg9; |
2233 | 0 | { |
2234 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLImageElement, mozilla::dom::HTMLImageElement>(args[9], arg9); |
2235 | 0 | if (NS_FAILED(rv)) { |
2236 | 0 | break; |
2237 | 0 | } |
2238 | 0 | } |
2239 | 0 | FastErrorResult rv; |
2240 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, MOZ_KnownLive(NonNullHelper(arg9)), rv); |
2241 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2242 | 0 | return false; |
2243 | 0 | } |
2244 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2245 | 0 | args.rval().setUndefined(); |
2246 | 0 | return true; |
2247 | 0 | } while (false); |
2248 | 0 | do { |
2249 | 0 | NonNull<mozilla::dom::HTMLVideoElement> arg9; |
2250 | 0 | { |
2251 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLVideoElement, mozilla::dom::HTMLVideoElement>(args[9], arg9); |
2252 | 0 | if (NS_FAILED(rv)) { |
2253 | 0 | break; |
2254 | 0 | } |
2255 | 0 | } |
2256 | 0 | FastErrorResult rv; |
2257 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, MOZ_KnownLive(NonNullHelper(arg9)), rv); |
2258 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2259 | 0 | return false; |
2260 | 0 | } |
2261 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2262 | 0 | args.rval().setUndefined(); |
2263 | 0 | return true; |
2264 | 0 | } while (false); |
2265 | 0 | do { |
2266 | 0 | NonNull<mozilla::dom::ImageBitmap> arg9; |
2267 | 0 | { |
2268 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageBitmap, mozilla::dom::ImageBitmap>(args[9], arg9); |
2269 | 0 | if (NS_FAILED(rv)) { |
2270 | 0 | break; |
2271 | 0 | } |
2272 | 0 | } |
2273 | 0 | FastErrorResult rv; |
2274 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, MOZ_KnownLive(NonNullHelper(arg9)), rv); |
2275 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2276 | 0 | return false; |
2277 | 0 | } |
2278 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2279 | 0 | args.rval().setUndefined(); |
2280 | 0 | return true; |
2281 | 0 | } while (false); |
2282 | 0 | do { |
2283 | 0 | NonNull<mozilla::dom::ImageData> arg9; |
2284 | 0 | { |
2285 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageData, mozilla::dom::ImageData>(args[9], arg9); |
2286 | 0 | if (NS_FAILED(rv)) { |
2287 | 0 | break; |
2288 | 0 | } |
2289 | 0 | } |
2290 | 0 | FastErrorResult rv; |
2291 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, MOZ_KnownLive(NonNullHelper(arg9)), rv); |
2292 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2293 | 0 | return false; |
2294 | 0 | } |
2295 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2296 | 0 | args.rval().setUndefined(); |
2297 | 0 | return true; |
2298 | 0 | } while (false); |
2299 | 0 | do { |
2300 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg9(cx); |
2301 | 0 | if (!arg9.SetValue().Init(&args[9].toObject())) { |
2302 | 0 | break; |
2303 | 0 | } |
2304 | 0 | FastErrorResult rv; |
2305 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, Constify(arg9), rv); |
2306 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2307 | 0 | return false; |
2308 | 0 | } |
2309 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2310 | 0 | args.rval().setUndefined(); |
2311 | 0 | return true; |
2312 | 0 | } while (false); |
2313 | 0 | } |
2314 | 0 | int64_t arg9; |
2315 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[9], &arg9)) { |
2316 | 0 | return false; |
2317 | 0 | } |
2318 | 0 | FastErrorResult rv; |
2319 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, rv); |
2320 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2321 | 0 | return false; |
2322 | 0 | } |
2323 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2324 | 0 | args.rval().setUndefined(); |
2325 | 0 | return true; |
2326 | 0 | break; |
2327 | 0 | } |
2328 | 0 | case 11: { |
2329 | 0 | uint32_t arg0; |
2330 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2331 | 0 | return false; |
2332 | 0 | } |
2333 | 0 | int32_t arg1; |
2334 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2335 | 0 | return false; |
2336 | 0 | } |
2337 | 0 | int32_t arg2; |
2338 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
2339 | 0 | return false; |
2340 | 0 | } |
2341 | 0 | int32_t arg3; |
2342 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2343 | 0 | return false; |
2344 | 0 | } |
2345 | 0 | int32_t arg4; |
2346 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2347 | 0 | return false; |
2348 | 0 | } |
2349 | 0 | int32_t arg5; |
2350 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2351 | 0 | return false; |
2352 | 0 | } |
2353 | 0 | int32_t arg6; |
2354 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
2355 | 0 | return false; |
2356 | 0 | } |
2357 | 0 | uint32_t arg7; |
2358 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
2359 | 0 | return false; |
2360 | 0 | } |
2361 | 0 | uint32_t arg8; |
2362 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
2363 | 0 | return false; |
2364 | 0 | } |
2365 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg9(cx); |
2366 | 0 | if (args[9].isObject()) { |
2367 | 0 | if (!arg9.Init(&args[9].toObject())) { |
2368 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 10 of WebGL2RenderingContext.texImage3D", "ArrayBufferView"); |
2369 | 0 | return false; |
2370 | 0 | } |
2371 | 0 | } else { |
2372 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 10 of WebGL2RenderingContext.texImage3D"); |
2373 | 0 | return false; |
2374 | 0 | } |
2375 | 0 | uint32_t arg10; |
2376 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[10], &arg10)) { |
2377 | 0 | return false; |
2378 | 0 | } |
2379 | 0 | FastErrorResult rv; |
2380 | 0 | self->TexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, Constify(arg9), arg10, rv); |
2381 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2382 | 0 | return false; |
2383 | 0 | } |
2384 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2385 | 0 | args.rval().setUndefined(); |
2386 | 0 | return true; |
2387 | 0 | break; |
2388 | 0 | } |
2389 | 0 | default: { |
2390 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texImage3D"); |
2391 | 0 | break; |
2392 | 0 | } |
2393 | 0 | } |
2394 | 0 | MOZ_CRASH("We have an always-returning default case"); |
2395 | 0 | return false; |
2396 | 0 | } |
2397 | | |
2398 | | static const JSJitInfo texImage3D_methodinfo = { |
2399 | | { (JSJitGetterOp)texImage3D }, |
2400 | | { prototypes::id::WebGL2RenderingContext }, |
2401 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
2402 | | JSJitInfo::Method, |
2403 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
2404 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
2405 | | false, /* isInfallible. False in setters. */ |
2406 | | false, /* isMovable. Not relevant for setters. */ |
2407 | | false, /* isEliminatable. Not relevant for setters. */ |
2408 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
2409 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
2410 | | false, /* isTypedMethod. Only relevant for methods. */ |
2411 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
2412 | | }; |
2413 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
2414 | | static_assert(0 < 1, "There is no slot for us"); |
2415 | | |
2416 | | MOZ_CAN_RUN_SCRIPT static bool |
2417 | | texSubImage3D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
2418 | 0 | { |
2419 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texSubImage3D", DOM, cx); |
2420 | 0 |
|
2421 | 0 | unsigned argcount = std::min(args.length(), 12u); |
2422 | 0 | switch (argcount) { |
2423 | 0 | case 11: { |
2424 | 0 | uint32_t arg0; |
2425 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2426 | 0 | return false; |
2427 | 0 | } |
2428 | 0 | int32_t arg1; |
2429 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2430 | 0 | return false; |
2431 | 0 | } |
2432 | 0 | int32_t arg2; |
2433 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
2434 | 0 | return false; |
2435 | 0 | } |
2436 | 0 | int32_t arg3; |
2437 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2438 | 0 | return false; |
2439 | 0 | } |
2440 | 0 | int32_t arg4; |
2441 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2442 | 0 | return false; |
2443 | 0 | } |
2444 | 0 | int32_t arg5; |
2445 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2446 | 0 | return false; |
2447 | 0 | } |
2448 | 0 | int32_t arg6; |
2449 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
2450 | 0 | return false; |
2451 | 0 | } |
2452 | 0 | int32_t arg7; |
2453 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
2454 | 0 | return false; |
2455 | 0 | } |
2456 | 0 | uint32_t arg8; |
2457 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
2458 | 0 | return false; |
2459 | 0 | } |
2460 | 0 | uint32_t arg9; |
2461 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
2462 | 0 | return false; |
2463 | 0 | } |
2464 | 0 | if (args[10].isNullOrUndefined()) { |
2465 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg10(cx); |
2466 | 0 | arg10.SetNull(); |
2467 | 0 | uint32_t arg11; |
2468 | 0 | if (args.hasDefined(11)) { |
2469 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[11], &arg11)) { |
2470 | 0 | return false; |
2471 | 0 | } |
2472 | 0 | } else { |
2473 | 0 | arg11 = 0U; |
2474 | 0 | } |
2475 | 0 | FastErrorResult rv; |
2476 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, Constify(arg10), arg11, rv); |
2477 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2478 | 0 | return false; |
2479 | 0 | } |
2480 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2481 | 0 | args.rval().setUndefined(); |
2482 | 0 | return true; |
2483 | 0 | } |
2484 | 0 | if (args[10].isObject()) { |
2485 | 0 | do { |
2486 | 0 | NonNull<mozilla::dom::HTMLCanvasElement> arg10; |
2487 | 0 | { |
2488 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLCanvasElement, mozilla::dom::HTMLCanvasElement>(args[10], arg10); |
2489 | 0 | if (NS_FAILED(rv)) { |
2490 | 0 | break; |
2491 | 0 | } |
2492 | 0 | } |
2493 | 0 | FastErrorResult rv; |
2494 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, MOZ_KnownLive(NonNullHelper(arg10)), rv); |
2495 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2496 | 0 | return false; |
2497 | 0 | } |
2498 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2499 | 0 | args.rval().setUndefined(); |
2500 | 0 | return true; |
2501 | 0 | } while (false); |
2502 | 0 | do { |
2503 | 0 | NonNull<mozilla::dom::HTMLImageElement> arg10; |
2504 | 0 | { |
2505 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLImageElement, mozilla::dom::HTMLImageElement>(args[10], arg10); |
2506 | 0 | if (NS_FAILED(rv)) { |
2507 | 0 | break; |
2508 | 0 | } |
2509 | 0 | } |
2510 | 0 | FastErrorResult rv; |
2511 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, MOZ_KnownLive(NonNullHelper(arg10)), rv); |
2512 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2513 | 0 | return false; |
2514 | 0 | } |
2515 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2516 | 0 | args.rval().setUndefined(); |
2517 | 0 | return true; |
2518 | 0 | } while (false); |
2519 | 0 | do { |
2520 | 0 | NonNull<mozilla::dom::HTMLVideoElement> arg10; |
2521 | 0 | { |
2522 | 0 | nsresult rv = UnwrapObject<prototypes::id::HTMLVideoElement, mozilla::dom::HTMLVideoElement>(args[10], arg10); |
2523 | 0 | if (NS_FAILED(rv)) { |
2524 | 0 | break; |
2525 | 0 | } |
2526 | 0 | } |
2527 | 0 | FastErrorResult rv; |
2528 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, MOZ_KnownLive(NonNullHelper(arg10)), rv); |
2529 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2530 | 0 | return false; |
2531 | 0 | } |
2532 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2533 | 0 | args.rval().setUndefined(); |
2534 | 0 | return true; |
2535 | 0 | } while (false); |
2536 | 0 | do { |
2537 | 0 | NonNull<mozilla::dom::ImageBitmap> arg10; |
2538 | 0 | { |
2539 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageBitmap, mozilla::dom::ImageBitmap>(args[10], arg10); |
2540 | 0 | if (NS_FAILED(rv)) { |
2541 | 0 | break; |
2542 | 0 | } |
2543 | 0 | } |
2544 | 0 | FastErrorResult rv; |
2545 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, MOZ_KnownLive(NonNullHelper(arg10)), rv); |
2546 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2547 | 0 | return false; |
2548 | 0 | } |
2549 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2550 | 0 | args.rval().setUndefined(); |
2551 | 0 | return true; |
2552 | 0 | } while (false); |
2553 | 0 | do { |
2554 | 0 | NonNull<mozilla::dom::ImageData> arg10; |
2555 | 0 | { |
2556 | 0 | nsresult rv = UnwrapObject<prototypes::id::ImageData, mozilla::dom::ImageData>(args[10], arg10); |
2557 | 0 | if (NS_FAILED(rv)) { |
2558 | 0 | break; |
2559 | 0 | } |
2560 | 0 | } |
2561 | 0 | FastErrorResult rv; |
2562 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, MOZ_KnownLive(NonNullHelper(arg10)), rv); |
2563 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2564 | 0 | return false; |
2565 | 0 | } |
2566 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2567 | 0 | args.rval().setUndefined(); |
2568 | 0 | return true; |
2569 | 0 | } while (false); |
2570 | 0 | do { |
2571 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg10(cx); |
2572 | 0 | if (!arg10.SetValue().Init(&args[10].toObject())) { |
2573 | 0 | break; |
2574 | 0 | } |
2575 | 0 | uint32_t arg11; |
2576 | 0 | if (args.hasDefined(11)) { |
2577 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[11], &arg11)) { |
2578 | 0 | return false; |
2579 | 0 | } |
2580 | 0 | } else { |
2581 | 0 | arg11 = 0U; |
2582 | 0 | } |
2583 | 0 | FastErrorResult rv; |
2584 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, Constify(arg10), arg11, rv); |
2585 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2586 | 0 | return false; |
2587 | 0 | } |
2588 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2589 | 0 | args.rval().setUndefined(); |
2590 | 0 | return true; |
2591 | 0 | } while (false); |
2592 | 0 | } |
2593 | 0 | int64_t arg10; |
2594 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[10], &arg10)) { |
2595 | 0 | return false; |
2596 | 0 | } |
2597 | 0 | FastErrorResult rv; |
2598 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, rv); |
2599 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2600 | 0 | return false; |
2601 | 0 | } |
2602 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2603 | 0 | args.rval().setUndefined(); |
2604 | 0 | return true; |
2605 | 0 | break; |
2606 | 0 | } |
2607 | 0 | case 12: { |
2608 | 0 | uint32_t arg0; |
2609 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2610 | 0 | return false; |
2611 | 0 | } |
2612 | 0 | int32_t arg1; |
2613 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2614 | 0 | return false; |
2615 | 0 | } |
2616 | 0 | int32_t arg2; |
2617 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
2618 | 0 | return false; |
2619 | 0 | } |
2620 | 0 | int32_t arg3; |
2621 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2622 | 0 | return false; |
2623 | 0 | } |
2624 | 0 | int32_t arg4; |
2625 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2626 | 0 | return false; |
2627 | 0 | } |
2628 | 0 | int32_t arg5; |
2629 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2630 | 0 | return false; |
2631 | 0 | } |
2632 | 0 | int32_t arg6; |
2633 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
2634 | 0 | return false; |
2635 | 0 | } |
2636 | 0 | int32_t arg7; |
2637 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
2638 | 0 | return false; |
2639 | 0 | } |
2640 | 0 | uint32_t arg8; |
2641 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
2642 | 0 | return false; |
2643 | 0 | } |
2644 | 0 | uint32_t arg9; |
2645 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
2646 | 0 | return false; |
2647 | 0 | } |
2648 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg10(cx); |
2649 | 0 | if (args[10].isObject()) { |
2650 | 0 | if (!arg10.SetValue().Init(&args[10].toObject())) { |
2651 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 11 of WebGL2RenderingContext.texSubImage3D", "ArrayBufferViewOrNull"); |
2652 | 0 | return false; |
2653 | 0 | } |
2654 | 0 | } else if (args[10].isNullOrUndefined()) { |
2655 | 0 | arg10.SetNull(); |
2656 | 0 | } else { |
2657 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 11 of WebGL2RenderingContext.texSubImage3D"); |
2658 | 0 | return false; |
2659 | 0 | } |
2660 | 0 | uint32_t arg11; |
2661 | 0 | if (args.hasDefined(11)) { |
2662 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[11], &arg11)) { |
2663 | 0 | return false; |
2664 | 0 | } |
2665 | 0 | } else { |
2666 | 0 | arg11 = 0U; |
2667 | 0 | } |
2668 | 0 | FastErrorResult rv; |
2669 | 0 | self->TexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, Constify(arg10), arg11, rv); |
2670 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
2671 | 0 | return false; |
2672 | 0 | } |
2673 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2674 | 0 | args.rval().setUndefined(); |
2675 | 0 | return true; |
2676 | 0 | break; |
2677 | 0 | } |
2678 | 0 | default: { |
2679 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texSubImage3D"); |
2680 | 0 | break; |
2681 | 0 | } |
2682 | 0 | } |
2683 | 0 | MOZ_CRASH("We have an always-returning default case"); |
2684 | 0 | return false; |
2685 | 0 | } |
2686 | | |
2687 | | static const JSJitInfo texSubImage3D_methodinfo = { |
2688 | | { (JSJitGetterOp)texSubImage3D }, |
2689 | | { prototypes::id::WebGL2RenderingContext }, |
2690 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
2691 | | JSJitInfo::Method, |
2692 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
2693 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
2694 | | false, /* isInfallible. False in setters. */ |
2695 | | false, /* isMovable. Not relevant for setters. */ |
2696 | | false, /* isEliminatable. Not relevant for setters. */ |
2697 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
2698 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
2699 | | false, /* isTypedMethod. Only relevant for methods. */ |
2700 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
2701 | | }; |
2702 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
2703 | | static_assert(0 < 1, "There is no slot for us"); |
2704 | | |
2705 | | MOZ_CAN_RUN_SCRIPT static bool |
2706 | | copyTexSubImage3D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
2707 | 0 | { |
2708 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.copyTexSubImage3D", DOM, cx); |
2709 | 0 |
|
2710 | 0 | if (MOZ_UNLIKELY(args.length() < 9)) { |
2711 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.copyTexSubImage3D"); |
2712 | 0 | } |
2713 | 0 | uint32_t arg0; |
2714 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2715 | 0 | return false; |
2716 | 0 | } |
2717 | 0 | int32_t arg1; |
2718 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2719 | 0 | return false; |
2720 | 0 | } |
2721 | 0 | int32_t arg2; |
2722 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
2723 | 0 | return false; |
2724 | 0 | } |
2725 | 0 | int32_t arg3; |
2726 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2727 | 0 | return false; |
2728 | 0 | } |
2729 | 0 | int32_t arg4; |
2730 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2731 | 0 | return false; |
2732 | 0 | } |
2733 | 0 | int32_t arg5; |
2734 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2735 | 0 | return false; |
2736 | 0 | } |
2737 | 0 | int32_t arg6; |
2738 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
2739 | 0 | return false; |
2740 | 0 | } |
2741 | 0 | int32_t arg7; |
2742 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
2743 | 0 | return false; |
2744 | 0 | } |
2745 | 0 | int32_t arg8; |
2746 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[8], &arg8)) { |
2747 | 0 | return false; |
2748 | 0 | } |
2749 | 0 | self->CopyTexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); |
2750 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2751 | 0 | args.rval().setUndefined(); |
2752 | 0 | return true; |
2753 | 0 | } |
2754 | | |
2755 | | static const JSJitInfo copyTexSubImage3D_methodinfo = { |
2756 | | { (JSJitGetterOp)copyTexSubImage3D }, |
2757 | | { prototypes::id::WebGL2RenderingContext }, |
2758 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
2759 | | JSJitInfo::Method, |
2760 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
2761 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
2762 | | false, /* isInfallible. False in setters. */ |
2763 | | false, /* isMovable. Not relevant for setters. */ |
2764 | | false, /* isEliminatable. Not relevant for setters. */ |
2765 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
2766 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
2767 | | false, /* isTypedMethod. Only relevant for methods. */ |
2768 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
2769 | | }; |
2770 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
2771 | | static_assert(0 < 1, "There is no slot for us"); |
2772 | | |
2773 | | MOZ_CAN_RUN_SCRIPT static bool |
2774 | | compressedTexImage2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
2775 | 0 | { |
2776 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.compressedTexImage2D", DOM, cx); |
2777 | 0 |
|
2778 | 0 | unsigned argcount = std::min(args.length(), 9u); |
2779 | 0 | switch (argcount) { |
2780 | 0 | case 7: { |
2781 | 0 | uint32_t arg0; |
2782 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2783 | 0 | return false; |
2784 | 0 | } |
2785 | 0 | int32_t arg1; |
2786 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2787 | 0 | return false; |
2788 | 0 | } |
2789 | 0 | uint32_t arg2; |
2790 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
2791 | 0 | return false; |
2792 | 0 | } |
2793 | 0 | int32_t arg3; |
2794 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2795 | 0 | return false; |
2796 | 0 | } |
2797 | 0 | int32_t arg4; |
2798 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2799 | 0 | return false; |
2800 | 0 | } |
2801 | 0 | int32_t arg5; |
2802 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2803 | 0 | return false; |
2804 | 0 | } |
2805 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg6(cx); |
2806 | 0 | if (args[6].isObject()) { |
2807 | 0 | if (!arg6.Init(&args[6].toObject())) { |
2808 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 7 of WebGL2RenderingContext.compressedTexImage2D", "ArrayBufferView"); |
2809 | 0 | return false; |
2810 | 0 | } |
2811 | 0 | } else { |
2812 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 7 of WebGL2RenderingContext.compressedTexImage2D"); |
2813 | 0 | return false; |
2814 | 0 | } |
2815 | 0 | uint32_t arg7; |
2816 | 0 | if (args.hasDefined(7)) { |
2817 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
2818 | 0 | return false; |
2819 | 0 | } |
2820 | 0 | } else { |
2821 | 0 | arg7 = 0U; |
2822 | 0 | } |
2823 | 0 | uint32_t arg8; |
2824 | 0 | if (args.hasDefined(8)) { |
2825 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
2826 | 0 | return false; |
2827 | 0 | } |
2828 | 0 | } else { |
2829 | 0 | arg8 = 0U; |
2830 | 0 | } |
2831 | 0 | self->CompressedTexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, Constify(arg6), arg7, arg8); |
2832 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2833 | 0 | args.rval().setUndefined(); |
2834 | 0 | return true; |
2835 | 0 | break; |
2836 | 0 | } |
2837 | 0 | case 8: { |
2838 | 0 | uint32_t arg0; |
2839 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2840 | 0 | return false; |
2841 | 0 | } |
2842 | 0 | int32_t arg1; |
2843 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2844 | 0 | return false; |
2845 | 0 | } |
2846 | 0 | uint32_t arg2; |
2847 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
2848 | 0 | return false; |
2849 | 0 | } |
2850 | 0 | int32_t arg3; |
2851 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2852 | 0 | return false; |
2853 | 0 | } |
2854 | 0 | int32_t arg4; |
2855 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2856 | 0 | return false; |
2857 | 0 | } |
2858 | 0 | int32_t arg5; |
2859 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2860 | 0 | return false; |
2861 | 0 | } |
2862 | 0 | if (args[6].isObject()) { |
2863 | 0 | do { |
2864 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg6(cx); |
2865 | 0 | if (!arg6.Init(&args[6].toObject())) { |
2866 | 0 | break; |
2867 | 0 | } |
2868 | 0 | uint32_t arg7; |
2869 | 0 | if (args.hasDefined(7)) { |
2870 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
2871 | 0 | return false; |
2872 | 0 | } |
2873 | 0 | } else { |
2874 | 0 | arg7 = 0U; |
2875 | 0 | } |
2876 | 0 | uint32_t arg8; |
2877 | 0 | if (args.hasDefined(8)) { |
2878 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
2879 | 0 | return false; |
2880 | 0 | } |
2881 | 0 | } else { |
2882 | 0 | arg8 = 0U; |
2883 | 0 | } |
2884 | 0 | self->CompressedTexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, Constify(arg6), arg7, arg8); |
2885 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2886 | 0 | args.rval().setUndefined(); |
2887 | 0 | return true; |
2888 | 0 | } while (false); |
2889 | 0 | } |
2890 | 0 | int32_t arg6; |
2891 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
2892 | 0 | return false; |
2893 | 0 | } |
2894 | 0 | int64_t arg7; |
2895 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[7], &arg7)) { |
2896 | 0 | return false; |
2897 | 0 | } |
2898 | 0 | self->CompressedTexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); |
2899 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2900 | 0 | args.rval().setUndefined(); |
2901 | 0 | return true; |
2902 | 0 | break; |
2903 | 0 | } |
2904 | 0 | case 9: { |
2905 | 0 | uint32_t arg0; |
2906 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2907 | 0 | return false; |
2908 | 0 | } |
2909 | 0 | int32_t arg1; |
2910 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
2911 | 0 | return false; |
2912 | 0 | } |
2913 | 0 | uint32_t arg2; |
2914 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
2915 | 0 | return false; |
2916 | 0 | } |
2917 | 0 | int32_t arg3; |
2918 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
2919 | 0 | return false; |
2920 | 0 | } |
2921 | 0 | int32_t arg4; |
2922 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
2923 | 0 | return false; |
2924 | 0 | } |
2925 | 0 | int32_t arg5; |
2926 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
2927 | 0 | return false; |
2928 | 0 | } |
2929 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg6(cx); |
2930 | 0 | if (args[6].isObject()) { |
2931 | 0 | if (!arg6.Init(&args[6].toObject())) { |
2932 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 7 of WebGL2RenderingContext.compressedTexImage2D", "ArrayBufferView"); |
2933 | 0 | return false; |
2934 | 0 | } |
2935 | 0 | } else { |
2936 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 7 of WebGL2RenderingContext.compressedTexImage2D"); |
2937 | 0 | return false; |
2938 | 0 | } |
2939 | 0 | uint32_t arg7; |
2940 | 0 | if (args.hasDefined(7)) { |
2941 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
2942 | 0 | return false; |
2943 | 0 | } |
2944 | 0 | } else { |
2945 | 0 | arg7 = 0U; |
2946 | 0 | } |
2947 | 0 | uint32_t arg8; |
2948 | 0 | if (args.hasDefined(8)) { |
2949 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
2950 | 0 | return false; |
2951 | 0 | } |
2952 | 0 | } else { |
2953 | 0 | arg8 = 0U; |
2954 | 0 | } |
2955 | 0 | self->CompressedTexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, Constify(arg6), arg7, arg8); |
2956 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
2957 | 0 | args.rval().setUndefined(); |
2958 | 0 | return true; |
2959 | 0 | break; |
2960 | 0 | } |
2961 | 0 | default: { |
2962 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.compressedTexImage2D"); |
2963 | 0 | break; |
2964 | 0 | } |
2965 | 0 | } |
2966 | 0 | MOZ_CRASH("We have an always-returning default case"); |
2967 | 0 | return false; |
2968 | 0 | } |
2969 | | |
2970 | | static const JSJitInfo compressedTexImage2D_methodinfo = { |
2971 | | { (JSJitGetterOp)compressedTexImage2D }, |
2972 | | { prototypes::id::WebGL2RenderingContext }, |
2973 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
2974 | | JSJitInfo::Method, |
2975 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
2976 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
2977 | | false, /* isInfallible. False in setters. */ |
2978 | | false, /* isMovable. Not relevant for setters. */ |
2979 | | false, /* isEliminatable. Not relevant for setters. */ |
2980 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
2981 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
2982 | | false, /* isTypedMethod. Only relevant for methods. */ |
2983 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
2984 | | }; |
2985 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
2986 | | static_assert(0 < 1, "There is no slot for us"); |
2987 | | |
2988 | | MOZ_CAN_RUN_SCRIPT static bool |
2989 | | compressedTexImage3D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
2990 | 0 | { |
2991 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.compressedTexImage3D", DOM, cx); |
2992 | 0 |
|
2993 | 0 | unsigned argcount = std::min(args.length(), 10u); |
2994 | 0 | switch (argcount) { |
2995 | 0 | case 8: { |
2996 | 0 | uint32_t arg0; |
2997 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
2998 | 0 | return false; |
2999 | 0 | } |
3000 | 0 | int32_t arg1; |
3001 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3002 | 0 | return false; |
3003 | 0 | } |
3004 | 0 | uint32_t arg2; |
3005 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
3006 | 0 | return false; |
3007 | 0 | } |
3008 | 0 | int32_t arg3; |
3009 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3010 | 0 | return false; |
3011 | 0 | } |
3012 | 0 | int32_t arg4; |
3013 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3014 | 0 | return false; |
3015 | 0 | } |
3016 | 0 | int32_t arg5; |
3017 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3018 | 0 | return false; |
3019 | 0 | } |
3020 | 0 | int32_t arg6; |
3021 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
3022 | 0 | return false; |
3023 | 0 | } |
3024 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg7(cx); |
3025 | 0 | if (args[7].isObject()) { |
3026 | 0 | if (!arg7.Init(&args[7].toObject())) { |
3027 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 8 of WebGL2RenderingContext.compressedTexImage3D", "ArrayBufferView"); |
3028 | 0 | return false; |
3029 | 0 | } |
3030 | 0 | } else { |
3031 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 8 of WebGL2RenderingContext.compressedTexImage3D"); |
3032 | 0 | return false; |
3033 | 0 | } |
3034 | 0 | uint32_t arg8; |
3035 | 0 | if (args.hasDefined(8)) { |
3036 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3037 | 0 | return false; |
3038 | 0 | } |
3039 | 0 | } else { |
3040 | 0 | arg8 = 0U; |
3041 | 0 | } |
3042 | 0 | uint32_t arg9; |
3043 | 0 | if (args.hasDefined(9)) { |
3044 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
3045 | 0 | return false; |
3046 | 0 | } |
3047 | 0 | } else { |
3048 | 0 | arg9 = 0U; |
3049 | 0 | } |
3050 | 0 | self->CompressedTexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, Constify(arg7), arg8, arg9); |
3051 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3052 | 0 | args.rval().setUndefined(); |
3053 | 0 | return true; |
3054 | 0 | break; |
3055 | 0 | } |
3056 | 0 | case 9: { |
3057 | 0 | uint32_t arg0; |
3058 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3059 | 0 | return false; |
3060 | 0 | } |
3061 | 0 | int32_t arg1; |
3062 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3063 | 0 | return false; |
3064 | 0 | } |
3065 | 0 | uint32_t arg2; |
3066 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
3067 | 0 | return false; |
3068 | 0 | } |
3069 | 0 | int32_t arg3; |
3070 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3071 | 0 | return false; |
3072 | 0 | } |
3073 | 0 | int32_t arg4; |
3074 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3075 | 0 | return false; |
3076 | 0 | } |
3077 | 0 | int32_t arg5; |
3078 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3079 | 0 | return false; |
3080 | 0 | } |
3081 | 0 | int32_t arg6; |
3082 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
3083 | 0 | return false; |
3084 | 0 | } |
3085 | 0 | if (args[7].isObject()) { |
3086 | 0 | do { |
3087 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg7(cx); |
3088 | 0 | if (!arg7.Init(&args[7].toObject())) { |
3089 | 0 | break; |
3090 | 0 | } |
3091 | 0 | uint32_t arg8; |
3092 | 0 | if (args.hasDefined(8)) { |
3093 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3094 | 0 | return false; |
3095 | 0 | } |
3096 | 0 | } else { |
3097 | 0 | arg8 = 0U; |
3098 | 0 | } |
3099 | 0 | uint32_t arg9; |
3100 | 0 | if (args.hasDefined(9)) { |
3101 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
3102 | 0 | return false; |
3103 | 0 | } |
3104 | 0 | } else { |
3105 | 0 | arg9 = 0U; |
3106 | 0 | } |
3107 | 0 | self->CompressedTexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, Constify(arg7), arg8, arg9); |
3108 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3109 | 0 | args.rval().setUndefined(); |
3110 | 0 | return true; |
3111 | 0 | } while (false); |
3112 | 0 | } |
3113 | 0 | int32_t arg7; |
3114 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
3115 | 0 | return false; |
3116 | 0 | } |
3117 | 0 | int64_t arg8; |
3118 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[8], &arg8)) { |
3119 | 0 | return false; |
3120 | 0 | } |
3121 | 0 | self->CompressedTexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); |
3122 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3123 | 0 | args.rval().setUndefined(); |
3124 | 0 | return true; |
3125 | 0 | break; |
3126 | 0 | } |
3127 | 0 | case 10: { |
3128 | 0 | uint32_t arg0; |
3129 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3130 | 0 | return false; |
3131 | 0 | } |
3132 | 0 | int32_t arg1; |
3133 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3134 | 0 | return false; |
3135 | 0 | } |
3136 | 0 | uint32_t arg2; |
3137 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
3138 | 0 | return false; |
3139 | 0 | } |
3140 | 0 | int32_t arg3; |
3141 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3142 | 0 | return false; |
3143 | 0 | } |
3144 | 0 | int32_t arg4; |
3145 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3146 | 0 | return false; |
3147 | 0 | } |
3148 | 0 | int32_t arg5; |
3149 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3150 | 0 | return false; |
3151 | 0 | } |
3152 | 0 | int32_t arg6; |
3153 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
3154 | 0 | return false; |
3155 | 0 | } |
3156 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg7(cx); |
3157 | 0 | if (args[7].isObject()) { |
3158 | 0 | if (!arg7.Init(&args[7].toObject())) { |
3159 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 8 of WebGL2RenderingContext.compressedTexImage3D", "ArrayBufferView"); |
3160 | 0 | return false; |
3161 | 0 | } |
3162 | 0 | } else { |
3163 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 8 of WebGL2RenderingContext.compressedTexImage3D"); |
3164 | 0 | return false; |
3165 | 0 | } |
3166 | 0 | uint32_t arg8; |
3167 | 0 | if (args.hasDefined(8)) { |
3168 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3169 | 0 | return false; |
3170 | 0 | } |
3171 | 0 | } else { |
3172 | 0 | arg8 = 0U; |
3173 | 0 | } |
3174 | 0 | uint32_t arg9; |
3175 | 0 | if (args.hasDefined(9)) { |
3176 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
3177 | 0 | return false; |
3178 | 0 | } |
3179 | 0 | } else { |
3180 | 0 | arg9 = 0U; |
3181 | 0 | } |
3182 | 0 | self->CompressedTexImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, Constify(arg7), arg8, arg9); |
3183 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3184 | 0 | args.rval().setUndefined(); |
3185 | 0 | return true; |
3186 | 0 | break; |
3187 | 0 | } |
3188 | 0 | default: { |
3189 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.compressedTexImage3D"); |
3190 | 0 | break; |
3191 | 0 | } |
3192 | 0 | } |
3193 | 0 | MOZ_CRASH("We have an always-returning default case"); |
3194 | 0 | return false; |
3195 | 0 | } |
3196 | | |
3197 | | static const JSJitInfo compressedTexImage3D_methodinfo = { |
3198 | | { (JSJitGetterOp)compressedTexImage3D }, |
3199 | | { prototypes::id::WebGL2RenderingContext }, |
3200 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3201 | | JSJitInfo::Method, |
3202 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3203 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
3204 | | false, /* isInfallible. False in setters. */ |
3205 | | false, /* isMovable. Not relevant for setters. */ |
3206 | | false, /* isEliminatable. Not relevant for setters. */ |
3207 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3208 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3209 | | false, /* isTypedMethod. Only relevant for methods. */ |
3210 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3211 | | }; |
3212 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3213 | | static_assert(0 < 1, "There is no slot for us"); |
3214 | | |
3215 | | MOZ_CAN_RUN_SCRIPT static bool |
3216 | | compressedTexSubImage2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3217 | 0 | { |
3218 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.compressedTexSubImage2D", DOM, cx); |
3219 | 0 |
|
3220 | 0 | unsigned argcount = std::min(args.length(), 10u); |
3221 | 0 | switch (argcount) { |
3222 | 0 | case 8: { |
3223 | 0 | uint32_t arg0; |
3224 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3225 | 0 | return false; |
3226 | 0 | } |
3227 | 0 | int32_t arg1; |
3228 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3229 | 0 | return false; |
3230 | 0 | } |
3231 | 0 | int32_t arg2; |
3232 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
3233 | 0 | return false; |
3234 | 0 | } |
3235 | 0 | int32_t arg3; |
3236 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3237 | 0 | return false; |
3238 | 0 | } |
3239 | 0 | int32_t arg4; |
3240 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3241 | 0 | return false; |
3242 | 0 | } |
3243 | 0 | int32_t arg5; |
3244 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3245 | 0 | return false; |
3246 | 0 | } |
3247 | 0 | uint32_t arg6; |
3248 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[6], &arg6)) { |
3249 | 0 | return false; |
3250 | 0 | } |
3251 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg7(cx); |
3252 | 0 | if (args[7].isObject()) { |
3253 | 0 | if (!arg7.Init(&args[7].toObject())) { |
3254 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 8 of WebGL2RenderingContext.compressedTexSubImage2D", "ArrayBufferView"); |
3255 | 0 | return false; |
3256 | 0 | } |
3257 | 0 | } else { |
3258 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 8 of WebGL2RenderingContext.compressedTexSubImage2D"); |
3259 | 0 | return false; |
3260 | 0 | } |
3261 | 0 | uint32_t arg8; |
3262 | 0 | if (args.hasDefined(8)) { |
3263 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3264 | 0 | return false; |
3265 | 0 | } |
3266 | 0 | } else { |
3267 | 0 | arg8 = 0U; |
3268 | 0 | } |
3269 | 0 | uint32_t arg9; |
3270 | 0 | if (args.hasDefined(9)) { |
3271 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
3272 | 0 | return false; |
3273 | 0 | } |
3274 | 0 | } else { |
3275 | 0 | arg9 = 0U; |
3276 | 0 | } |
3277 | 0 | self->CompressedTexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, Constify(arg7), arg8, arg9); |
3278 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3279 | 0 | args.rval().setUndefined(); |
3280 | 0 | return true; |
3281 | 0 | break; |
3282 | 0 | } |
3283 | 0 | case 9: { |
3284 | 0 | uint32_t arg0; |
3285 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3286 | 0 | return false; |
3287 | 0 | } |
3288 | 0 | int32_t arg1; |
3289 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3290 | 0 | return false; |
3291 | 0 | } |
3292 | 0 | int32_t arg2; |
3293 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
3294 | 0 | return false; |
3295 | 0 | } |
3296 | 0 | int32_t arg3; |
3297 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3298 | 0 | return false; |
3299 | 0 | } |
3300 | 0 | int32_t arg4; |
3301 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3302 | 0 | return false; |
3303 | 0 | } |
3304 | 0 | int32_t arg5; |
3305 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3306 | 0 | return false; |
3307 | 0 | } |
3308 | 0 | uint32_t arg6; |
3309 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[6], &arg6)) { |
3310 | 0 | return false; |
3311 | 0 | } |
3312 | 0 | if (args[7].isObject()) { |
3313 | 0 | do { |
3314 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg7(cx); |
3315 | 0 | if (!arg7.Init(&args[7].toObject())) { |
3316 | 0 | break; |
3317 | 0 | } |
3318 | 0 | uint32_t arg8; |
3319 | 0 | if (args.hasDefined(8)) { |
3320 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3321 | 0 | return false; |
3322 | 0 | } |
3323 | 0 | } else { |
3324 | 0 | arg8 = 0U; |
3325 | 0 | } |
3326 | 0 | uint32_t arg9; |
3327 | 0 | if (args.hasDefined(9)) { |
3328 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
3329 | 0 | return false; |
3330 | 0 | } |
3331 | 0 | } else { |
3332 | 0 | arg9 = 0U; |
3333 | 0 | } |
3334 | 0 | self->CompressedTexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, Constify(arg7), arg8, arg9); |
3335 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3336 | 0 | args.rval().setUndefined(); |
3337 | 0 | return true; |
3338 | 0 | } while (false); |
3339 | 0 | } |
3340 | 0 | int32_t arg7; |
3341 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
3342 | 0 | return false; |
3343 | 0 | } |
3344 | 0 | int64_t arg8; |
3345 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[8], &arg8)) { |
3346 | 0 | return false; |
3347 | 0 | } |
3348 | 0 | self->CompressedTexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); |
3349 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3350 | 0 | args.rval().setUndefined(); |
3351 | 0 | return true; |
3352 | 0 | break; |
3353 | 0 | } |
3354 | 0 | case 10: { |
3355 | 0 | uint32_t arg0; |
3356 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3357 | 0 | return false; |
3358 | 0 | } |
3359 | 0 | int32_t arg1; |
3360 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3361 | 0 | return false; |
3362 | 0 | } |
3363 | 0 | int32_t arg2; |
3364 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
3365 | 0 | return false; |
3366 | 0 | } |
3367 | 0 | int32_t arg3; |
3368 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3369 | 0 | return false; |
3370 | 0 | } |
3371 | 0 | int32_t arg4; |
3372 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3373 | 0 | return false; |
3374 | 0 | } |
3375 | 0 | int32_t arg5; |
3376 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3377 | 0 | return false; |
3378 | 0 | } |
3379 | 0 | uint32_t arg6; |
3380 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[6], &arg6)) { |
3381 | 0 | return false; |
3382 | 0 | } |
3383 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg7(cx); |
3384 | 0 | if (args[7].isObject()) { |
3385 | 0 | if (!arg7.Init(&args[7].toObject())) { |
3386 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 8 of WebGL2RenderingContext.compressedTexSubImage2D", "ArrayBufferView"); |
3387 | 0 | return false; |
3388 | 0 | } |
3389 | 0 | } else { |
3390 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 8 of WebGL2RenderingContext.compressedTexSubImage2D"); |
3391 | 0 | return false; |
3392 | 0 | } |
3393 | 0 | uint32_t arg8; |
3394 | 0 | if (args.hasDefined(8)) { |
3395 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3396 | 0 | return false; |
3397 | 0 | } |
3398 | 0 | } else { |
3399 | 0 | arg8 = 0U; |
3400 | 0 | } |
3401 | 0 | uint32_t arg9; |
3402 | 0 | if (args.hasDefined(9)) { |
3403 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) { |
3404 | 0 | return false; |
3405 | 0 | } |
3406 | 0 | } else { |
3407 | 0 | arg9 = 0U; |
3408 | 0 | } |
3409 | 0 | self->CompressedTexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, Constify(arg7), arg8, arg9); |
3410 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3411 | 0 | args.rval().setUndefined(); |
3412 | 0 | return true; |
3413 | 0 | break; |
3414 | 0 | } |
3415 | 0 | default: { |
3416 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.compressedTexSubImage2D"); |
3417 | 0 | break; |
3418 | 0 | } |
3419 | 0 | } |
3420 | 0 | MOZ_CRASH("We have an always-returning default case"); |
3421 | 0 | return false; |
3422 | 0 | } |
3423 | | |
3424 | | static const JSJitInfo compressedTexSubImage2D_methodinfo = { |
3425 | | { (JSJitGetterOp)compressedTexSubImage2D }, |
3426 | | { prototypes::id::WebGL2RenderingContext }, |
3427 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3428 | | JSJitInfo::Method, |
3429 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3430 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
3431 | | false, /* isInfallible. False in setters. */ |
3432 | | false, /* isMovable. Not relevant for setters. */ |
3433 | | false, /* isEliminatable. Not relevant for setters. */ |
3434 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3435 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3436 | | false, /* isTypedMethod. Only relevant for methods. */ |
3437 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3438 | | }; |
3439 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3440 | | static_assert(0 < 1, "There is no slot for us"); |
3441 | | |
3442 | | MOZ_CAN_RUN_SCRIPT static bool |
3443 | | compressedTexSubImage3D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3444 | 0 | { |
3445 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.compressedTexSubImage3D", DOM, cx); |
3446 | 0 |
|
3447 | 0 | unsigned argcount = std::min(args.length(), 12u); |
3448 | 0 | switch (argcount) { |
3449 | 0 | case 10: { |
3450 | 0 | uint32_t arg0; |
3451 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3452 | 0 | return false; |
3453 | 0 | } |
3454 | 0 | int32_t arg1; |
3455 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3456 | 0 | return false; |
3457 | 0 | } |
3458 | 0 | int32_t arg2; |
3459 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
3460 | 0 | return false; |
3461 | 0 | } |
3462 | 0 | int32_t arg3; |
3463 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3464 | 0 | return false; |
3465 | 0 | } |
3466 | 0 | int32_t arg4; |
3467 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3468 | 0 | return false; |
3469 | 0 | } |
3470 | 0 | int32_t arg5; |
3471 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3472 | 0 | return false; |
3473 | 0 | } |
3474 | 0 | int32_t arg6; |
3475 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
3476 | 0 | return false; |
3477 | 0 | } |
3478 | 0 | int32_t arg7; |
3479 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
3480 | 0 | return false; |
3481 | 0 | } |
3482 | 0 | uint32_t arg8; |
3483 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3484 | 0 | return false; |
3485 | 0 | } |
3486 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg9(cx); |
3487 | 0 | if (args[9].isObject()) { |
3488 | 0 | if (!arg9.Init(&args[9].toObject())) { |
3489 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 10 of WebGL2RenderingContext.compressedTexSubImage3D", "ArrayBufferView"); |
3490 | 0 | return false; |
3491 | 0 | } |
3492 | 0 | } else { |
3493 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 10 of WebGL2RenderingContext.compressedTexSubImage3D"); |
3494 | 0 | return false; |
3495 | 0 | } |
3496 | 0 | uint32_t arg10; |
3497 | 0 | if (args.hasDefined(10)) { |
3498 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[10], &arg10)) { |
3499 | 0 | return false; |
3500 | 0 | } |
3501 | 0 | } else { |
3502 | 0 | arg10 = 0U; |
3503 | 0 | } |
3504 | 0 | uint32_t arg11; |
3505 | 0 | if (args.hasDefined(11)) { |
3506 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[11], &arg11)) { |
3507 | 0 | return false; |
3508 | 0 | } |
3509 | 0 | } else { |
3510 | 0 | arg11 = 0U; |
3511 | 0 | } |
3512 | 0 | self->CompressedTexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, Constify(arg9), arg10, arg11); |
3513 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3514 | 0 | args.rval().setUndefined(); |
3515 | 0 | return true; |
3516 | 0 | break; |
3517 | 0 | } |
3518 | 0 | case 11: { |
3519 | 0 | uint32_t arg0; |
3520 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3521 | 0 | return false; |
3522 | 0 | } |
3523 | 0 | int32_t arg1; |
3524 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3525 | 0 | return false; |
3526 | 0 | } |
3527 | 0 | int32_t arg2; |
3528 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
3529 | 0 | return false; |
3530 | 0 | } |
3531 | 0 | int32_t arg3; |
3532 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3533 | 0 | return false; |
3534 | 0 | } |
3535 | 0 | int32_t arg4; |
3536 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3537 | 0 | return false; |
3538 | 0 | } |
3539 | 0 | int32_t arg5; |
3540 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3541 | 0 | return false; |
3542 | 0 | } |
3543 | 0 | int32_t arg6; |
3544 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
3545 | 0 | return false; |
3546 | 0 | } |
3547 | 0 | int32_t arg7; |
3548 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
3549 | 0 | return false; |
3550 | 0 | } |
3551 | 0 | uint32_t arg8; |
3552 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3553 | 0 | return false; |
3554 | 0 | } |
3555 | 0 | if (args[9].isObject()) { |
3556 | 0 | do { |
3557 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg9(cx); |
3558 | 0 | if (!arg9.Init(&args[9].toObject())) { |
3559 | 0 | break; |
3560 | 0 | } |
3561 | 0 | uint32_t arg10; |
3562 | 0 | if (args.hasDefined(10)) { |
3563 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[10], &arg10)) { |
3564 | 0 | return false; |
3565 | 0 | } |
3566 | 0 | } else { |
3567 | 0 | arg10 = 0U; |
3568 | 0 | } |
3569 | 0 | uint32_t arg11; |
3570 | 0 | if (args.hasDefined(11)) { |
3571 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[11], &arg11)) { |
3572 | 0 | return false; |
3573 | 0 | } |
3574 | 0 | } else { |
3575 | 0 | arg11 = 0U; |
3576 | 0 | } |
3577 | 0 | self->CompressedTexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, Constify(arg9), arg10, arg11); |
3578 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3579 | 0 | args.rval().setUndefined(); |
3580 | 0 | return true; |
3581 | 0 | } while (false); |
3582 | 0 | } |
3583 | 0 | int32_t arg9; |
3584 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[9], &arg9)) { |
3585 | 0 | return false; |
3586 | 0 | } |
3587 | 0 | int64_t arg10; |
3588 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[10], &arg10)) { |
3589 | 0 | return false; |
3590 | 0 | } |
3591 | 0 | self->CompressedTexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); |
3592 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3593 | 0 | args.rval().setUndefined(); |
3594 | 0 | return true; |
3595 | 0 | break; |
3596 | 0 | } |
3597 | 0 | case 12: { |
3598 | 0 | uint32_t arg0; |
3599 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
3600 | 0 | return false; |
3601 | 0 | } |
3602 | 0 | int32_t arg1; |
3603 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
3604 | 0 | return false; |
3605 | 0 | } |
3606 | 0 | int32_t arg2; |
3607 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
3608 | 0 | return false; |
3609 | 0 | } |
3610 | 0 | int32_t arg3; |
3611 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
3612 | 0 | return false; |
3613 | 0 | } |
3614 | 0 | int32_t arg4; |
3615 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
3616 | 0 | return false; |
3617 | 0 | } |
3618 | 0 | int32_t arg5; |
3619 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
3620 | 0 | return false; |
3621 | 0 | } |
3622 | 0 | int32_t arg6; |
3623 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
3624 | 0 | return false; |
3625 | 0 | } |
3626 | 0 | int32_t arg7; |
3627 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
3628 | 0 | return false; |
3629 | 0 | } |
3630 | 0 | uint32_t arg8; |
3631 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) { |
3632 | 0 | return false; |
3633 | 0 | } |
3634 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg9(cx); |
3635 | 0 | if (args[9].isObject()) { |
3636 | 0 | if (!arg9.Init(&args[9].toObject())) { |
3637 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 10 of WebGL2RenderingContext.compressedTexSubImage3D", "ArrayBufferView"); |
3638 | 0 | return false; |
3639 | 0 | } |
3640 | 0 | } else { |
3641 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 10 of WebGL2RenderingContext.compressedTexSubImage3D"); |
3642 | 0 | return false; |
3643 | 0 | } |
3644 | 0 | uint32_t arg10; |
3645 | 0 | if (args.hasDefined(10)) { |
3646 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[10], &arg10)) { |
3647 | 0 | return false; |
3648 | 0 | } |
3649 | 0 | } else { |
3650 | 0 | arg10 = 0U; |
3651 | 0 | } |
3652 | 0 | uint32_t arg11; |
3653 | 0 | if (args.hasDefined(11)) { |
3654 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[11], &arg11)) { |
3655 | 0 | return false; |
3656 | 0 | } |
3657 | 0 | } else { |
3658 | 0 | arg11 = 0U; |
3659 | 0 | } |
3660 | 0 | self->CompressedTexSubImage3D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, Constify(arg9), arg10, arg11); |
3661 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3662 | 0 | args.rval().setUndefined(); |
3663 | 0 | return true; |
3664 | 0 | break; |
3665 | 0 | } |
3666 | 0 | default: { |
3667 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.compressedTexSubImage3D"); |
3668 | 0 | break; |
3669 | 0 | } |
3670 | 0 | } |
3671 | 0 | MOZ_CRASH("We have an always-returning default case"); |
3672 | 0 | return false; |
3673 | 0 | } |
3674 | | |
3675 | | static const JSJitInfo compressedTexSubImage3D_methodinfo = { |
3676 | | { (JSJitGetterOp)compressedTexSubImage3D }, |
3677 | | { prototypes::id::WebGL2RenderingContext }, |
3678 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3679 | | JSJitInfo::Method, |
3680 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3681 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
3682 | | false, /* isInfallible. False in setters. */ |
3683 | | false, /* isMovable. Not relevant for setters. */ |
3684 | | false, /* isEliminatable. Not relevant for setters. */ |
3685 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3686 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3687 | | false, /* isTypedMethod. Only relevant for methods. */ |
3688 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3689 | | }; |
3690 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3691 | | static_assert(0 < 1, "There is no slot for us"); |
3692 | | |
3693 | | MOZ_CAN_RUN_SCRIPT static bool |
3694 | | getFragDataLocation(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3695 | 0 | { |
3696 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getFragDataLocation", DOM, cx); |
3697 | 0 |
|
3698 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
3699 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getFragDataLocation"); |
3700 | 0 | } |
3701 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
3702 | 0 | if (args[0].isObject()) { |
3703 | 0 | { |
3704 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
3705 | 0 | if (NS_FAILED(rv)) { |
3706 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getFragDataLocation", "WebGLProgram"); |
3707 | 0 | return false; |
3708 | 0 | } |
3709 | 0 | } |
3710 | 0 | } else { |
3711 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getFragDataLocation"); |
3712 | 0 | return false; |
3713 | 0 | } |
3714 | 0 | binding_detail::FakeString arg1; |
3715 | 0 | if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) { |
3716 | 0 | return false; |
3717 | 0 | } |
3718 | 0 | int32_t result(self->GetFragDataLocation(MOZ_KnownLive(NonNullHelper(arg0)), NonNullHelper(Constify(arg1)))); |
3719 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3720 | 0 | args.rval().setInt32(int32_t(result)); |
3721 | 0 | return true; |
3722 | 0 | } |
3723 | | |
3724 | | static const JSJitInfo getFragDataLocation_methodinfo = { |
3725 | | { (JSJitGetterOp)getFragDataLocation }, |
3726 | | { prototypes::id::WebGL2RenderingContext }, |
3727 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3728 | | JSJitInfo::Method, |
3729 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3730 | | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ |
3731 | | false, /* isInfallible. False in setters. */ |
3732 | | false, /* isMovable. Not relevant for setters. */ |
3733 | | false, /* isEliminatable. Not relevant for setters. */ |
3734 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3735 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3736 | | false, /* isTypedMethod. Only relevant for methods. */ |
3737 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3738 | | }; |
3739 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3740 | | static_assert(0 < 1, "There is no slot for us"); |
3741 | | |
3742 | | MOZ_CAN_RUN_SCRIPT static bool |
3743 | | uniform1ui(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3744 | 0 | { |
3745 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform1ui", DOM, cx); |
3746 | 0 |
|
3747 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
3748 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform1ui"); |
3749 | 0 | } |
3750 | 0 | mozilla::WebGLUniformLocation* arg0; |
3751 | 0 | if (args[0].isObject()) { |
3752 | 0 | { |
3753 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
3754 | 0 | if (NS_FAILED(rv)) { |
3755 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform1ui", "WebGLUniformLocation"); |
3756 | 0 | return false; |
3757 | 0 | } |
3758 | 0 | } |
3759 | 0 | } else if (args[0].isNullOrUndefined()) { |
3760 | 0 | arg0 = nullptr; |
3761 | 0 | } else { |
3762 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform1ui"); |
3763 | 0 | return false; |
3764 | 0 | } |
3765 | 0 | uint32_t arg1; |
3766 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
3767 | 0 | return false; |
3768 | 0 | } |
3769 | 0 | self->Uniform1ui(MOZ_KnownLive(Constify(arg0)), arg1); |
3770 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3771 | 0 | args.rval().setUndefined(); |
3772 | 0 | return true; |
3773 | 0 | } |
3774 | | |
3775 | | static const JSJitInfo uniform1ui_methodinfo = { |
3776 | | { (JSJitGetterOp)uniform1ui }, |
3777 | | { prototypes::id::WebGL2RenderingContext }, |
3778 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3779 | | JSJitInfo::Method, |
3780 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3781 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
3782 | | false, /* isInfallible. False in setters. */ |
3783 | | false, /* isMovable. Not relevant for setters. */ |
3784 | | false, /* isEliminatable. Not relevant for setters. */ |
3785 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3786 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3787 | | false, /* isTypedMethod. Only relevant for methods. */ |
3788 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3789 | | }; |
3790 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3791 | | static_assert(0 < 1, "There is no slot for us"); |
3792 | | |
3793 | | MOZ_CAN_RUN_SCRIPT static bool |
3794 | | uniform2ui(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3795 | 0 | { |
3796 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform2ui", DOM, cx); |
3797 | 0 |
|
3798 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
3799 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform2ui"); |
3800 | 0 | } |
3801 | 0 | mozilla::WebGLUniformLocation* arg0; |
3802 | 0 | if (args[0].isObject()) { |
3803 | 0 | { |
3804 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
3805 | 0 | if (NS_FAILED(rv)) { |
3806 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform2ui", "WebGLUniformLocation"); |
3807 | 0 | return false; |
3808 | 0 | } |
3809 | 0 | } |
3810 | 0 | } else if (args[0].isNullOrUndefined()) { |
3811 | 0 | arg0 = nullptr; |
3812 | 0 | } else { |
3813 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform2ui"); |
3814 | 0 | return false; |
3815 | 0 | } |
3816 | 0 | uint32_t arg1; |
3817 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
3818 | 0 | return false; |
3819 | 0 | } |
3820 | 0 | uint32_t arg2; |
3821 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
3822 | 0 | return false; |
3823 | 0 | } |
3824 | 0 | self->Uniform2ui(MOZ_KnownLive(Constify(arg0)), arg1, arg2); |
3825 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3826 | 0 | args.rval().setUndefined(); |
3827 | 0 | return true; |
3828 | 0 | } |
3829 | | |
3830 | | static const JSJitInfo uniform2ui_methodinfo = { |
3831 | | { (JSJitGetterOp)uniform2ui }, |
3832 | | { prototypes::id::WebGL2RenderingContext }, |
3833 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3834 | | JSJitInfo::Method, |
3835 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3836 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
3837 | | false, /* isInfallible. False in setters. */ |
3838 | | false, /* isMovable. Not relevant for setters. */ |
3839 | | false, /* isEliminatable. Not relevant for setters. */ |
3840 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3841 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3842 | | false, /* isTypedMethod. Only relevant for methods. */ |
3843 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3844 | | }; |
3845 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3846 | | static_assert(0 < 1, "There is no slot for us"); |
3847 | | |
3848 | | MOZ_CAN_RUN_SCRIPT static bool |
3849 | | uniform3ui(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3850 | 0 | { |
3851 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform3ui", DOM, cx); |
3852 | 0 |
|
3853 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
3854 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform3ui"); |
3855 | 0 | } |
3856 | 0 | mozilla::WebGLUniformLocation* arg0; |
3857 | 0 | if (args[0].isObject()) { |
3858 | 0 | { |
3859 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
3860 | 0 | if (NS_FAILED(rv)) { |
3861 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform3ui", "WebGLUniformLocation"); |
3862 | 0 | return false; |
3863 | 0 | } |
3864 | 0 | } |
3865 | 0 | } else if (args[0].isNullOrUndefined()) { |
3866 | 0 | arg0 = nullptr; |
3867 | 0 | } else { |
3868 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform3ui"); |
3869 | 0 | return false; |
3870 | 0 | } |
3871 | 0 | uint32_t arg1; |
3872 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
3873 | 0 | return false; |
3874 | 0 | } |
3875 | 0 | uint32_t arg2; |
3876 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
3877 | 0 | return false; |
3878 | 0 | } |
3879 | 0 | uint32_t arg3; |
3880 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
3881 | 0 | return false; |
3882 | 0 | } |
3883 | 0 | self->Uniform3ui(MOZ_KnownLive(Constify(arg0)), arg1, arg2, arg3); |
3884 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3885 | 0 | args.rval().setUndefined(); |
3886 | 0 | return true; |
3887 | 0 | } |
3888 | | |
3889 | | static const JSJitInfo uniform3ui_methodinfo = { |
3890 | | { (JSJitGetterOp)uniform3ui }, |
3891 | | { prototypes::id::WebGL2RenderingContext }, |
3892 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3893 | | JSJitInfo::Method, |
3894 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3895 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
3896 | | false, /* isInfallible. False in setters. */ |
3897 | | false, /* isMovable. Not relevant for setters. */ |
3898 | | false, /* isEliminatable. Not relevant for setters. */ |
3899 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3900 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3901 | | false, /* isTypedMethod. Only relevant for methods. */ |
3902 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3903 | | }; |
3904 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3905 | | static_assert(0 < 1, "There is no slot for us"); |
3906 | | |
3907 | | MOZ_CAN_RUN_SCRIPT static bool |
3908 | | uniform4ui(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3909 | 0 | { |
3910 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform4ui", DOM, cx); |
3911 | 0 |
|
3912 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
3913 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform4ui"); |
3914 | 0 | } |
3915 | 0 | mozilla::WebGLUniformLocation* arg0; |
3916 | 0 | if (args[0].isObject()) { |
3917 | 0 | { |
3918 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
3919 | 0 | if (NS_FAILED(rv)) { |
3920 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform4ui", "WebGLUniformLocation"); |
3921 | 0 | return false; |
3922 | 0 | } |
3923 | 0 | } |
3924 | 0 | } else if (args[0].isNullOrUndefined()) { |
3925 | 0 | arg0 = nullptr; |
3926 | 0 | } else { |
3927 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform4ui"); |
3928 | 0 | return false; |
3929 | 0 | } |
3930 | 0 | uint32_t arg1; |
3931 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
3932 | 0 | return false; |
3933 | 0 | } |
3934 | 0 | uint32_t arg2; |
3935 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
3936 | 0 | return false; |
3937 | 0 | } |
3938 | 0 | uint32_t arg3; |
3939 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
3940 | 0 | return false; |
3941 | 0 | } |
3942 | 0 | uint32_t arg4; |
3943 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
3944 | 0 | return false; |
3945 | 0 | } |
3946 | 0 | self->Uniform4ui(MOZ_KnownLive(Constify(arg0)), arg1, arg2, arg3, arg4); |
3947 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
3948 | 0 | args.rval().setUndefined(); |
3949 | 0 | return true; |
3950 | 0 | } |
3951 | | |
3952 | | static const JSJitInfo uniform4ui_methodinfo = { |
3953 | | { (JSJitGetterOp)uniform4ui }, |
3954 | | { prototypes::id::WebGL2RenderingContext }, |
3955 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
3956 | | JSJitInfo::Method, |
3957 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
3958 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
3959 | | false, /* isInfallible. False in setters. */ |
3960 | | false, /* isMovable. Not relevant for setters. */ |
3961 | | false, /* isEliminatable. Not relevant for setters. */ |
3962 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
3963 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
3964 | | false, /* isTypedMethod. Only relevant for methods. */ |
3965 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
3966 | | }; |
3967 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
3968 | | static_assert(0 < 1, "There is no slot for us"); |
3969 | | |
3970 | | MOZ_CAN_RUN_SCRIPT static bool |
3971 | | uniform1fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
3972 | 0 | { |
3973 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform1fv", DOM, cx); |
3974 | 0 |
|
3975 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
3976 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform1fv"); |
3977 | 0 | } |
3978 | 0 | mozilla::WebGLUniformLocation* arg0; |
3979 | 0 | if (args[0].isObject()) { |
3980 | 0 | { |
3981 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
3982 | 0 | if (NS_FAILED(rv)) { |
3983 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform1fv", "WebGLUniformLocation"); |
3984 | 0 | return false; |
3985 | 0 | } |
3986 | 0 | } |
3987 | 0 | } else if (args[0].isNullOrUndefined()) { |
3988 | 0 | arg0 = nullptr; |
3989 | 0 | } else { |
3990 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform1fv"); |
3991 | 0 | return false; |
3992 | 0 | } |
3993 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
3994 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
3995 | 0 | { |
3996 | 0 | bool done = false, failed = false, tryNext; |
3997 | 0 | if (args[1].isObject()) { |
3998 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
3999 | 0 |
|
4000 | 0 | if (!done) { |
4001 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
4002 | 0 | } |
4003 | 0 | } |
4004 | 0 | if (failed) { |
4005 | 0 | return false; |
4006 | 0 | } |
4007 | 0 | if (!done) { |
4008 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform1fv", "Float32Array, UnrestrictedFloatSequence"); |
4009 | 0 | return false; |
4010 | 0 | } |
4011 | 0 | } |
4012 | 0 | uint32_t arg2; |
4013 | 0 | if (args.hasDefined(2)) { |
4014 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4015 | 0 | return false; |
4016 | 0 | } |
4017 | 0 | } else { |
4018 | 0 | arg2 = 0U; |
4019 | 0 | } |
4020 | 0 | uint32_t arg3; |
4021 | 0 | if (args.hasDefined(3)) { |
4022 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4023 | 0 | return false; |
4024 | 0 | } |
4025 | 0 | } else { |
4026 | 0 | arg3 = 0U; |
4027 | 0 | } |
4028 | 0 | self->Uniform1fv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4029 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4030 | 0 | args.rval().setUndefined(); |
4031 | 0 | return true; |
4032 | 0 | } |
4033 | | |
4034 | | static const JSJitInfo uniform1fv_methodinfo = { |
4035 | | { (JSJitGetterOp)uniform1fv }, |
4036 | | { prototypes::id::WebGL2RenderingContext }, |
4037 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4038 | | JSJitInfo::Method, |
4039 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4040 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4041 | | false, /* isInfallible. False in setters. */ |
4042 | | false, /* isMovable. Not relevant for setters. */ |
4043 | | false, /* isEliminatable. Not relevant for setters. */ |
4044 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4045 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4046 | | false, /* isTypedMethod. Only relevant for methods. */ |
4047 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4048 | | }; |
4049 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4050 | | static_assert(0 < 1, "There is no slot for us"); |
4051 | | |
4052 | | MOZ_CAN_RUN_SCRIPT static bool |
4053 | | uniform2fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4054 | 0 | { |
4055 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform2fv", DOM, cx); |
4056 | 0 |
|
4057 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4058 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform2fv"); |
4059 | 0 | } |
4060 | 0 | mozilla::WebGLUniformLocation* arg0; |
4061 | 0 | if (args[0].isObject()) { |
4062 | 0 | { |
4063 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4064 | 0 | if (NS_FAILED(rv)) { |
4065 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform2fv", "WebGLUniformLocation"); |
4066 | 0 | return false; |
4067 | 0 | } |
4068 | 0 | } |
4069 | 0 | } else if (args[0].isNullOrUndefined()) { |
4070 | 0 | arg0 = nullptr; |
4071 | 0 | } else { |
4072 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform2fv"); |
4073 | 0 | return false; |
4074 | 0 | } |
4075 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
4076 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
4077 | 0 | { |
4078 | 0 | bool done = false, failed = false, tryNext; |
4079 | 0 | if (args[1].isObject()) { |
4080 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
4081 | 0 |
|
4082 | 0 | if (!done) { |
4083 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
4084 | 0 | } |
4085 | 0 | } |
4086 | 0 | if (failed) { |
4087 | 0 | return false; |
4088 | 0 | } |
4089 | 0 | if (!done) { |
4090 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform2fv", "Float32Array, UnrestrictedFloatSequence"); |
4091 | 0 | return false; |
4092 | 0 | } |
4093 | 0 | } |
4094 | 0 | uint32_t arg2; |
4095 | 0 | if (args.hasDefined(2)) { |
4096 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4097 | 0 | return false; |
4098 | 0 | } |
4099 | 0 | } else { |
4100 | 0 | arg2 = 0U; |
4101 | 0 | } |
4102 | 0 | uint32_t arg3; |
4103 | 0 | if (args.hasDefined(3)) { |
4104 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4105 | 0 | return false; |
4106 | 0 | } |
4107 | 0 | } else { |
4108 | 0 | arg3 = 0U; |
4109 | 0 | } |
4110 | 0 | self->Uniform2fv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4111 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4112 | 0 | args.rval().setUndefined(); |
4113 | 0 | return true; |
4114 | 0 | } |
4115 | | |
4116 | | static const JSJitInfo uniform2fv_methodinfo = { |
4117 | | { (JSJitGetterOp)uniform2fv }, |
4118 | | { prototypes::id::WebGL2RenderingContext }, |
4119 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4120 | | JSJitInfo::Method, |
4121 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4122 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4123 | | false, /* isInfallible. False in setters. */ |
4124 | | false, /* isMovable. Not relevant for setters. */ |
4125 | | false, /* isEliminatable. Not relevant for setters. */ |
4126 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4127 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4128 | | false, /* isTypedMethod. Only relevant for methods. */ |
4129 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4130 | | }; |
4131 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4132 | | static_assert(0 < 1, "There is no slot for us"); |
4133 | | |
4134 | | MOZ_CAN_RUN_SCRIPT static bool |
4135 | | uniform3fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4136 | 0 | { |
4137 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform3fv", DOM, cx); |
4138 | 0 |
|
4139 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4140 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform3fv"); |
4141 | 0 | } |
4142 | 0 | mozilla::WebGLUniformLocation* arg0; |
4143 | 0 | if (args[0].isObject()) { |
4144 | 0 | { |
4145 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4146 | 0 | if (NS_FAILED(rv)) { |
4147 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform3fv", "WebGLUniformLocation"); |
4148 | 0 | return false; |
4149 | 0 | } |
4150 | 0 | } |
4151 | 0 | } else if (args[0].isNullOrUndefined()) { |
4152 | 0 | arg0 = nullptr; |
4153 | 0 | } else { |
4154 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform3fv"); |
4155 | 0 | return false; |
4156 | 0 | } |
4157 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
4158 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
4159 | 0 | { |
4160 | 0 | bool done = false, failed = false, tryNext; |
4161 | 0 | if (args[1].isObject()) { |
4162 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
4163 | 0 |
|
4164 | 0 | if (!done) { |
4165 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
4166 | 0 | } |
4167 | 0 | } |
4168 | 0 | if (failed) { |
4169 | 0 | return false; |
4170 | 0 | } |
4171 | 0 | if (!done) { |
4172 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform3fv", "Float32Array, UnrestrictedFloatSequence"); |
4173 | 0 | return false; |
4174 | 0 | } |
4175 | 0 | } |
4176 | 0 | uint32_t arg2; |
4177 | 0 | if (args.hasDefined(2)) { |
4178 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4179 | 0 | return false; |
4180 | 0 | } |
4181 | 0 | } else { |
4182 | 0 | arg2 = 0U; |
4183 | 0 | } |
4184 | 0 | uint32_t arg3; |
4185 | 0 | if (args.hasDefined(3)) { |
4186 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4187 | 0 | return false; |
4188 | 0 | } |
4189 | 0 | } else { |
4190 | 0 | arg3 = 0U; |
4191 | 0 | } |
4192 | 0 | self->Uniform3fv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4193 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4194 | 0 | args.rval().setUndefined(); |
4195 | 0 | return true; |
4196 | 0 | } |
4197 | | |
4198 | | static const JSJitInfo uniform3fv_methodinfo = { |
4199 | | { (JSJitGetterOp)uniform3fv }, |
4200 | | { prototypes::id::WebGL2RenderingContext }, |
4201 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4202 | | JSJitInfo::Method, |
4203 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4204 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4205 | | false, /* isInfallible. False in setters. */ |
4206 | | false, /* isMovable. Not relevant for setters. */ |
4207 | | false, /* isEliminatable. Not relevant for setters. */ |
4208 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4209 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4210 | | false, /* isTypedMethod. Only relevant for methods. */ |
4211 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4212 | | }; |
4213 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4214 | | static_assert(0 < 1, "There is no slot for us"); |
4215 | | |
4216 | | MOZ_CAN_RUN_SCRIPT static bool |
4217 | | uniform4fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4218 | 0 | { |
4219 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform4fv", DOM, cx); |
4220 | 0 |
|
4221 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4222 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform4fv"); |
4223 | 0 | } |
4224 | 0 | mozilla::WebGLUniformLocation* arg0; |
4225 | 0 | if (args[0].isObject()) { |
4226 | 0 | { |
4227 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4228 | 0 | if (NS_FAILED(rv)) { |
4229 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform4fv", "WebGLUniformLocation"); |
4230 | 0 | return false; |
4231 | 0 | } |
4232 | 0 | } |
4233 | 0 | } else if (args[0].isNullOrUndefined()) { |
4234 | 0 | arg0 = nullptr; |
4235 | 0 | } else { |
4236 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform4fv"); |
4237 | 0 | return false; |
4238 | 0 | } |
4239 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
4240 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
4241 | 0 | { |
4242 | 0 | bool done = false, failed = false, tryNext; |
4243 | 0 | if (args[1].isObject()) { |
4244 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
4245 | 0 |
|
4246 | 0 | if (!done) { |
4247 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
4248 | 0 | } |
4249 | 0 | } |
4250 | 0 | if (failed) { |
4251 | 0 | return false; |
4252 | 0 | } |
4253 | 0 | if (!done) { |
4254 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform4fv", "Float32Array, UnrestrictedFloatSequence"); |
4255 | 0 | return false; |
4256 | 0 | } |
4257 | 0 | } |
4258 | 0 | uint32_t arg2; |
4259 | 0 | if (args.hasDefined(2)) { |
4260 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4261 | 0 | return false; |
4262 | 0 | } |
4263 | 0 | } else { |
4264 | 0 | arg2 = 0U; |
4265 | 0 | } |
4266 | 0 | uint32_t arg3; |
4267 | 0 | if (args.hasDefined(3)) { |
4268 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4269 | 0 | return false; |
4270 | 0 | } |
4271 | 0 | } else { |
4272 | 0 | arg3 = 0U; |
4273 | 0 | } |
4274 | 0 | self->Uniform4fv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4275 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4276 | 0 | args.rval().setUndefined(); |
4277 | 0 | return true; |
4278 | 0 | } |
4279 | | |
4280 | | static const JSJitInfo uniform4fv_methodinfo = { |
4281 | | { (JSJitGetterOp)uniform4fv }, |
4282 | | { prototypes::id::WebGL2RenderingContext }, |
4283 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4284 | | JSJitInfo::Method, |
4285 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4286 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4287 | | false, /* isInfallible. False in setters. */ |
4288 | | false, /* isMovable. Not relevant for setters. */ |
4289 | | false, /* isEliminatable. Not relevant for setters. */ |
4290 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4291 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4292 | | false, /* isTypedMethod. Only relevant for methods. */ |
4293 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4294 | | }; |
4295 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4296 | | static_assert(0 < 1, "There is no slot for us"); |
4297 | | |
4298 | | MOZ_CAN_RUN_SCRIPT static bool |
4299 | | uniform1iv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4300 | 0 | { |
4301 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform1iv", DOM, cx); |
4302 | 0 |
|
4303 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4304 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform1iv"); |
4305 | 0 | } |
4306 | 0 | mozilla::WebGLUniformLocation* arg0; |
4307 | 0 | if (args[0].isObject()) { |
4308 | 0 | { |
4309 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4310 | 0 | if (NS_FAILED(rv)) { |
4311 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform1iv", "WebGLUniformLocation"); |
4312 | 0 | return false; |
4313 | 0 | } |
4314 | 0 | } |
4315 | 0 | } else if (args[0].isNullOrUndefined()) { |
4316 | 0 | arg0 = nullptr; |
4317 | 0 | } else { |
4318 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform1iv"); |
4319 | 0 | return false; |
4320 | 0 | } |
4321 | 0 | Int32ArrayOrLongSequence arg1; |
4322 | 0 | Int32ArrayOrLongSequenceArgument arg1_holder(arg1); |
4323 | 0 | { |
4324 | 0 | bool done = false, failed = false, tryNext; |
4325 | 0 | if (args[1].isObject()) { |
4326 | 0 | done = (failed = !arg1_holder.TrySetToInt32Array(cx, args[1], tryNext, false)) || !tryNext; |
4327 | 0 |
|
4328 | 0 | if (!done) { |
4329 | 0 | done = (failed = !arg1_holder.TrySetToLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4330 | 0 | } |
4331 | 0 | } |
4332 | 0 | if (failed) { |
4333 | 0 | return false; |
4334 | 0 | } |
4335 | 0 | if (!done) { |
4336 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform1iv", "Int32Array, LongSequence"); |
4337 | 0 | return false; |
4338 | 0 | } |
4339 | 0 | } |
4340 | 0 | uint32_t arg2; |
4341 | 0 | if (args.hasDefined(2)) { |
4342 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4343 | 0 | return false; |
4344 | 0 | } |
4345 | 0 | } else { |
4346 | 0 | arg2 = 0U; |
4347 | 0 | } |
4348 | 0 | uint32_t arg3; |
4349 | 0 | if (args.hasDefined(3)) { |
4350 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4351 | 0 | return false; |
4352 | 0 | } |
4353 | 0 | } else { |
4354 | 0 | arg3 = 0U; |
4355 | 0 | } |
4356 | 0 | self->Uniform1iv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4357 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4358 | 0 | args.rval().setUndefined(); |
4359 | 0 | return true; |
4360 | 0 | } |
4361 | | |
4362 | | static const JSJitInfo uniform1iv_methodinfo = { |
4363 | | { (JSJitGetterOp)uniform1iv }, |
4364 | | { prototypes::id::WebGL2RenderingContext }, |
4365 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4366 | | JSJitInfo::Method, |
4367 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4368 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4369 | | false, /* isInfallible. False in setters. */ |
4370 | | false, /* isMovable. Not relevant for setters. */ |
4371 | | false, /* isEliminatable. Not relevant for setters. */ |
4372 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4373 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4374 | | false, /* isTypedMethod. Only relevant for methods. */ |
4375 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4376 | | }; |
4377 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4378 | | static_assert(0 < 1, "There is no slot for us"); |
4379 | | |
4380 | | MOZ_CAN_RUN_SCRIPT static bool |
4381 | | uniform2iv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4382 | 0 | { |
4383 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform2iv", DOM, cx); |
4384 | 0 |
|
4385 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4386 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform2iv"); |
4387 | 0 | } |
4388 | 0 | mozilla::WebGLUniformLocation* arg0; |
4389 | 0 | if (args[0].isObject()) { |
4390 | 0 | { |
4391 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4392 | 0 | if (NS_FAILED(rv)) { |
4393 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform2iv", "WebGLUniformLocation"); |
4394 | 0 | return false; |
4395 | 0 | } |
4396 | 0 | } |
4397 | 0 | } else if (args[0].isNullOrUndefined()) { |
4398 | 0 | arg0 = nullptr; |
4399 | 0 | } else { |
4400 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform2iv"); |
4401 | 0 | return false; |
4402 | 0 | } |
4403 | 0 | Int32ArrayOrLongSequence arg1; |
4404 | 0 | Int32ArrayOrLongSequenceArgument arg1_holder(arg1); |
4405 | 0 | { |
4406 | 0 | bool done = false, failed = false, tryNext; |
4407 | 0 | if (args[1].isObject()) { |
4408 | 0 | done = (failed = !arg1_holder.TrySetToInt32Array(cx, args[1], tryNext, false)) || !tryNext; |
4409 | 0 |
|
4410 | 0 | if (!done) { |
4411 | 0 | done = (failed = !arg1_holder.TrySetToLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4412 | 0 | } |
4413 | 0 | } |
4414 | 0 | if (failed) { |
4415 | 0 | return false; |
4416 | 0 | } |
4417 | 0 | if (!done) { |
4418 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform2iv", "Int32Array, LongSequence"); |
4419 | 0 | return false; |
4420 | 0 | } |
4421 | 0 | } |
4422 | 0 | uint32_t arg2; |
4423 | 0 | if (args.hasDefined(2)) { |
4424 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4425 | 0 | return false; |
4426 | 0 | } |
4427 | 0 | } else { |
4428 | 0 | arg2 = 0U; |
4429 | 0 | } |
4430 | 0 | uint32_t arg3; |
4431 | 0 | if (args.hasDefined(3)) { |
4432 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4433 | 0 | return false; |
4434 | 0 | } |
4435 | 0 | } else { |
4436 | 0 | arg3 = 0U; |
4437 | 0 | } |
4438 | 0 | self->Uniform2iv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4439 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4440 | 0 | args.rval().setUndefined(); |
4441 | 0 | return true; |
4442 | 0 | } |
4443 | | |
4444 | | static const JSJitInfo uniform2iv_methodinfo = { |
4445 | | { (JSJitGetterOp)uniform2iv }, |
4446 | | { prototypes::id::WebGL2RenderingContext }, |
4447 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4448 | | JSJitInfo::Method, |
4449 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4450 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4451 | | false, /* isInfallible. False in setters. */ |
4452 | | false, /* isMovable. Not relevant for setters. */ |
4453 | | false, /* isEliminatable. Not relevant for setters. */ |
4454 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4455 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4456 | | false, /* isTypedMethod. Only relevant for methods. */ |
4457 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4458 | | }; |
4459 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4460 | | static_assert(0 < 1, "There is no slot for us"); |
4461 | | |
4462 | | MOZ_CAN_RUN_SCRIPT static bool |
4463 | | uniform3iv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4464 | 0 | { |
4465 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform3iv", DOM, cx); |
4466 | 0 |
|
4467 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4468 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform3iv"); |
4469 | 0 | } |
4470 | 0 | mozilla::WebGLUniformLocation* arg0; |
4471 | 0 | if (args[0].isObject()) { |
4472 | 0 | { |
4473 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4474 | 0 | if (NS_FAILED(rv)) { |
4475 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform3iv", "WebGLUniformLocation"); |
4476 | 0 | return false; |
4477 | 0 | } |
4478 | 0 | } |
4479 | 0 | } else if (args[0].isNullOrUndefined()) { |
4480 | 0 | arg0 = nullptr; |
4481 | 0 | } else { |
4482 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform3iv"); |
4483 | 0 | return false; |
4484 | 0 | } |
4485 | 0 | Int32ArrayOrLongSequence arg1; |
4486 | 0 | Int32ArrayOrLongSequenceArgument arg1_holder(arg1); |
4487 | 0 | { |
4488 | 0 | bool done = false, failed = false, tryNext; |
4489 | 0 | if (args[1].isObject()) { |
4490 | 0 | done = (failed = !arg1_holder.TrySetToInt32Array(cx, args[1], tryNext, false)) || !tryNext; |
4491 | 0 |
|
4492 | 0 | if (!done) { |
4493 | 0 | done = (failed = !arg1_holder.TrySetToLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4494 | 0 | } |
4495 | 0 | } |
4496 | 0 | if (failed) { |
4497 | 0 | return false; |
4498 | 0 | } |
4499 | 0 | if (!done) { |
4500 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform3iv", "Int32Array, LongSequence"); |
4501 | 0 | return false; |
4502 | 0 | } |
4503 | 0 | } |
4504 | 0 | uint32_t arg2; |
4505 | 0 | if (args.hasDefined(2)) { |
4506 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4507 | 0 | return false; |
4508 | 0 | } |
4509 | 0 | } else { |
4510 | 0 | arg2 = 0U; |
4511 | 0 | } |
4512 | 0 | uint32_t arg3; |
4513 | 0 | if (args.hasDefined(3)) { |
4514 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4515 | 0 | return false; |
4516 | 0 | } |
4517 | 0 | } else { |
4518 | 0 | arg3 = 0U; |
4519 | 0 | } |
4520 | 0 | self->Uniform3iv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4521 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4522 | 0 | args.rval().setUndefined(); |
4523 | 0 | return true; |
4524 | 0 | } |
4525 | | |
4526 | | static const JSJitInfo uniform3iv_methodinfo = { |
4527 | | { (JSJitGetterOp)uniform3iv }, |
4528 | | { prototypes::id::WebGL2RenderingContext }, |
4529 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4530 | | JSJitInfo::Method, |
4531 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4532 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4533 | | false, /* isInfallible. False in setters. */ |
4534 | | false, /* isMovable. Not relevant for setters. */ |
4535 | | false, /* isEliminatable. Not relevant for setters. */ |
4536 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4537 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4538 | | false, /* isTypedMethod. Only relevant for methods. */ |
4539 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4540 | | }; |
4541 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4542 | | static_assert(0 < 1, "There is no slot for us"); |
4543 | | |
4544 | | MOZ_CAN_RUN_SCRIPT static bool |
4545 | | uniform4iv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4546 | 0 | { |
4547 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform4iv", DOM, cx); |
4548 | 0 |
|
4549 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4550 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform4iv"); |
4551 | 0 | } |
4552 | 0 | mozilla::WebGLUniformLocation* arg0; |
4553 | 0 | if (args[0].isObject()) { |
4554 | 0 | { |
4555 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4556 | 0 | if (NS_FAILED(rv)) { |
4557 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform4iv", "WebGLUniformLocation"); |
4558 | 0 | return false; |
4559 | 0 | } |
4560 | 0 | } |
4561 | 0 | } else if (args[0].isNullOrUndefined()) { |
4562 | 0 | arg0 = nullptr; |
4563 | 0 | } else { |
4564 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform4iv"); |
4565 | 0 | return false; |
4566 | 0 | } |
4567 | 0 | Int32ArrayOrLongSequence arg1; |
4568 | 0 | Int32ArrayOrLongSequenceArgument arg1_holder(arg1); |
4569 | 0 | { |
4570 | 0 | bool done = false, failed = false, tryNext; |
4571 | 0 | if (args[1].isObject()) { |
4572 | 0 | done = (failed = !arg1_holder.TrySetToInt32Array(cx, args[1], tryNext, false)) || !tryNext; |
4573 | 0 |
|
4574 | 0 | if (!done) { |
4575 | 0 | done = (failed = !arg1_holder.TrySetToLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4576 | 0 | } |
4577 | 0 | } |
4578 | 0 | if (failed) { |
4579 | 0 | return false; |
4580 | 0 | } |
4581 | 0 | if (!done) { |
4582 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform4iv", "Int32Array, LongSequence"); |
4583 | 0 | return false; |
4584 | 0 | } |
4585 | 0 | } |
4586 | 0 | uint32_t arg2; |
4587 | 0 | if (args.hasDefined(2)) { |
4588 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4589 | 0 | return false; |
4590 | 0 | } |
4591 | 0 | } else { |
4592 | 0 | arg2 = 0U; |
4593 | 0 | } |
4594 | 0 | uint32_t arg3; |
4595 | 0 | if (args.hasDefined(3)) { |
4596 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4597 | 0 | return false; |
4598 | 0 | } |
4599 | 0 | } else { |
4600 | 0 | arg3 = 0U; |
4601 | 0 | } |
4602 | 0 | self->Uniform4iv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4603 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4604 | 0 | args.rval().setUndefined(); |
4605 | 0 | return true; |
4606 | 0 | } |
4607 | | |
4608 | | static const JSJitInfo uniform4iv_methodinfo = { |
4609 | | { (JSJitGetterOp)uniform4iv }, |
4610 | | { prototypes::id::WebGL2RenderingContext }, |
4611 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4612 | | JSJitInfo::Method, |
4613 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4614 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4615 | | false, /* isInfallible. False in setters. */ |
4616 | | false, /* isMovable. Not relevant for setters. */ |
4617 | | false, /* isEliminatable. Not relevant for setters. */ |
4618 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4619 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4620 | | false, /* isTypedMethod. Only relevant for methods. */ |
4621 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4622 | | }; |
4623 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4624 | | static_assert(0 < 1, "There is no slot for us"); |
4625 | | |
4626 | | MOZ_CAN_RUN_SCRIPT static bool |
4627 | | uniform1uiv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4628 | 0 | { |
4629 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform1uiv", DOM, cx); |
4630 | 0 |
|
4631 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4632 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform1uiv"); |
4633 | 0 | } |
4634 | 0 | mozilla::WebGLUniformLocation* arg0; |
4635 | 0 | if (args[0].isObject()) { |
4636 | 0 | { |
4637 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4638 | 0 | if (NS_FAILED(rv)) { |
4639 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform1uiv", "WebGLUniformLocation"); |
4640 | 0 | return false; |
4641 | 0 | } |
4642 | 0 | } |
4643 | 0 | } else if (args[0].isNullOrUndefined()) { |
4644 | 0 | arg0 = nullptr; |
4645 | 0 | } else { |
4646 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform1uiv"); |
4647 | 0 | return false; |
4648 | 0 | } |
4649 | 0 | Uint32ArrayOrUnsignedLongSequence arg1; |
4650 | 0 | Uint32ArrayOrUnsignedLongSequenceArgument arg1_holder(arg1); |
4651 | 0 | { |
4652 | 0 | bool done = false, failed = false, tryNext; |
4653 | 0 | if (args[1].isObject()) { |
4654 | 0 | done = (failed = !arg1_holder.TrySetToUint32Array(cx, args[1], tryNext, false)) || !tryNext; |
4655 | 0 |
|
4656 | 0 | if (!done) { |
4657 | 0 | done = (failed = !arg1_holder.TrySetToUnsignedLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4658 | 0 | } |
4659 | 0 | } |
4660 | 0 | if (failed) { |
4661 | 0 | return false; |
4662 | 0 | } |
4663 | 0 | if (!done) { |
4664 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform1uiv", "Uint32Array, UnsignedLongSequence"); |
4665 | 0 | return false; |
4666 | 0 | } |
4667 | 0 | } |
4668 | 0 | uint32_t arg2; |
4669 | 0 | if (args.hasDefined(2)) { |
4670 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4671 | 0 | return false; |
4672 | 0 | } |
4673 | 0 | } else { |
4674 | 0 | arg2 = 0U; |
4675 | 0 | } |
4676 | 0 | uint32_t arg3; |
4677 | 0 | if (args.hasDefined(3)) { |
4678 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4679 | 0 | return false; |
4680 | 0 | } |
4681 | 0 | } else { |
4682 | 0 | arg3 = 0U; |
4683 | 0 | } |
4684 | 0 | self->Uniform1uiv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4685 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4686 | 0 | args.rval().setUndefined(); |
4687 | 0 | return true; |
4688 | 0 | } |
4689 | | |
4690 | | static const JSJitInfo uniform1uiv_methodinfo = { |
4691 | | { (JSJitGetterOp)uniform1uiv }, |
4692 | | { prototypes::id::WebGL2RenderingContext }, |
4693 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4694 | | JSJitInfo::Method, |
4695 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4696 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4697 | | false, /* isInfallible. False in setters. */ |
4698 | | false, /* isMovable. Not relevant for setters. */ |
4699 | | false, /* isEliminatable. Not relevant for setters. */ |
4700 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4701 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4702 | | false, /* isTypedMethod. Only relevant for methods. */ |
4703 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4704 | | }; |
4705 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4706 | | static_assert(0 < 1, "There is no slot for us"); |
4707 | | |
4708 | | MOZ_CAN_RUN_SCRIPT static bool |
4709 | | uniform2uiv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4710 | 0 | { |
4711 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform2uiv", DOM, cx); |
4712 | 0 |
|
4713 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4714 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform2uiv"); |
4715 | 0 | } |
4716 | 0 | mozilla::WebGLUniformLocation* arg0; |
4717 | 0 | if (args[0].isObject()) { |
4718 | 0 | { |
4719 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4720 | 0 | if (NS_FAILED(rv)) { |
4721 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform2uiv", "WebGLUniformLocation"); |
4722 | 0 | return false; |
4723 | 0 | } |
4724 | 0 | } |
4725 | 0 | } else if (args[0].isNullOrUndefined()) { |
4726 | 0 | arg0 = nullptr; |
4727 | 0 | } else { |
4728 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform2uiv"); |
4729 | 0 | return false; |
4730 | 0 | } |
4731 | 0 | Uint32ArrayOrUnsignedLongSequence arg1; |
4732 | 0 | Uint32ArrayOrUnsignedLongSequenceArgument arg1_holder(arg1); |
4733 | 0 | { |
4734 | 0 | bool done = false, failed = false, tryNext; |
4735 | 0 | if (args[1].isObject()) { |
4736 | 0 | done = (failed = !arg1_holder.TrySetToUint32Array(cx, args[1], tryNext, false)) || !tryNext; |
4737 | 0 |
|
4738 | 0 | if (!done) { |
4739 | 0 | done = (failed = !arg1_holder.TrySetToUnsignedLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4740 | 0 | } |
4741 | 0 | } |
4742 | 0 | if (failed) { |
4743 | 0 | return false; |
4744 | 0 | } |
4745 | 0 | if (!done) { |
4746 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform2uiv", "Uint32Array, UnsignedLongSequence"); |
4747 | 0 | return false; |
4748 | 0 | } |
4749 | 0 | } |
4750 | 0 | uint32_t arg2; |
4751 | 0 | if (args.hasDefined(2)) { |
4752 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4753 | 0 | return false; |
4754 | 0 | } |
4755 | 0 | } else { |
4756 | 0 | arg2 = 0U; |
4757 | 0 | } |
4758 | 0 | uint32_t arg3; |
4759 | 0 | if (args.hasDefined(3)) { |
4760 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4761 | 0 | return false; |
4762 | 0 | } |
4763 | 0 | } else { |
4764 | 0 | arg3 = 0U; |
4765 | 0 | } |
4766 | 0 | self->Uniform2uiv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4767 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4768 | 0 | args.rval().setUndefined(); |
4769 | 0 | return true; |
4770 | 0 | } |
4771 | | |
4772 | | static const JSJitInfo uniform2uiv_methodinfo = { |
4773 | | { (JSJitGetterOp)uniform2uiv }, |
4774 | | { prototypes::id::WebGL2RenderingContext }, |
4775 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4776 | | JSJitInfo::Method, |
4777 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4778 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4779 | | false, /* isInfallible. False in setters. */ |
4780 | | false, /* isMovable. Not relevant for setters. */ |
4781 | | false, /* isEliminatable. Not relevant for setters. */ |
4782 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4783 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4784 | | false, /* isTypedMethod. Only relevant for methods. */ |
4785 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4786 | | }; |
4787 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4788 | | static_assert(0 < 1, "There is no slot for us"); |
4789 | | |
4790 | | MOZ_CAN_RUN_SCRIPT static bool |
4791 | | uniform3uiv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4792 | 0 | { |
4793 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform3uiv", DOM, cx); |
4794 | 0 |
|
4795 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4796 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform3uiv"); |
4797 | 0 | } |
4798 | 0 | mozilla::WebGLUniformLocation* arg0; |
4799 | 0 | if (args[0].isObject()) { |
4800 | 0 | { |
4801 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4802 | 0 | if (NS_FAILED(rv)) { |
4803 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform3uiv", "WebGLUniformLocation"); |
4804 | 0 | return false; |
4805 | 0 | } |
4806 | 0 | } |
4807 | 0 | } else if (args[0].isNullOrUndefined()) { |
4808 | 0 | arg0 = nullptr; |
4809 | 0 | } else { |
4810 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform3uiv"); |
4811 | 0 | return false; |
4812 | 0 | } |
4813 | 0 | Uint32ArrayOrUnsignedLongSequence arg1; |
4814 | 0 | Uint32ArrayOrUnsignedLongSequenceArgument arg1_holder(arg1); |
4815 | 0 | { |
4816 | 0 | bool done = false, failed = false, tryNext; |
4817 | 0 | if (args[1].isObject()) { |
4818 | 0 | done = (failed = !arg1_holder.TrySetToUint32Array(cx, args[1], tryNext, false)) || !tryNext; |
4819 | 0 |
|
4820 | 0 | if (!done) { |
4821 | 0 | done = (failed = !arg1_holder.TrySetToUnsignedLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4822 | 0 | } |
4823 | 0 | } |
4824 | 0 | if (failed) { |
4825 | 0 | return false; |
4826 | 0 | } |
4827 | 0 | if (!done) { |
4828 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform3uiv", "Uint32Array, UnsignedLongSequence"); |
4829 | 0 | return false; |
4830 | 0 | } |
4831 | 0 | } |
4832 | 0 | uint32_t arg2; |
4833 | 0 | if (args.hasDefined(2)) { |
4834 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4835 | 0 | return false; |
4836 | 0 | } |
4837 | 0 | } else { |
4838 | 0 | arg2 = 0U; |
4839 | 0 | } |
4840 | 0 | uint32_t arg3; |
4841 | 0 | if (args.hasDefined(3)) { |
4842 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4843 | 0 | return false; |
4844 | 0 | } |
4845 | 0 | } else { |
4846 | 0 | arg3 = 0U; |
4847 | 0 | } |
4848 | 0 | self->Uniform3uiv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4849 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4850 | 0 | args.rval().setUndefined(); |
4851 | 0 | return true; |
4852 | 0 | } |
4853 | | |
4854 | | static const JSJitInfo uniform3uiv_methodinfo = { |
4855 | | { (JSJitGetterOp)uniform3uiv }, |
4856 | | { prototypes::id::WebGL2RenderingContext }, |
4857 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4858 | | JSJitInfo::Method, |
4859 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4860 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4861 | | false, /* isInfallible. False in setters. */ |
4862 | | false, /* isMovable. Not relevant for setters. */ |
4863 | | false, /* isEliminatable. Not relevant for setters. */ |
4864 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4865 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4866 | | false, /* isTypedMethod. Only relevant for methods. */ |
4867 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4868 | | }; |
4869 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4870 | | static_assert(0 < 1, "There is no slot for us"); |
4871 | | |
4872 | | MOZ_CAN_RUN_SCRIPT static bool |
4873 | | uniform4uiv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4874 | 0 | { |
4875 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform4uiv", DOM, cx); |
4876 | 0 |
|
4877 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
4878 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform4uiv"); |
4879 | 0 | } |
4880 | 0 | mozilla::WebGLUniformLocation* arg0; |
4881 | 0 | if (args[0].isObject()) { |
4882 | 0 | { |
4883 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4884 | 0 | if (NS_FAILED(rv)) { |
4885 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform4uiv", "WebGLUniformLocation"); |
4886 | 0 | return false; |
4887 | 0 | } |
4888 | 0 | } |
4889 | 0 | } else if (args[0].isNullOrUndefined()) { |
4890 | 0 | arg0 = nullptr; |
4891 | 0 | } else { |
4892 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform4uiv"); |
4893 | 0 | return false; |
4894 | 0 | } |
4895 | 0 | Uint32ArrayOrUnsignedLongSequence arg1; |
4896 | 0 | Uint32ArrayOrUnsignedLongSequenceArgument arg1_holder(arg1); |
4897 | 0 | { |
4898 | 0 | bool done = false, failed = false, tryNext; |
4899 | 0 | if (args[1].isObject()) { |
4900 | 0 | done = (failed = !arg1_holder.TrySetToUint32Array(cx, args[1], tryNext, false)) || !tryNext; |
4901 | 0 |
|
4902 | 0 | if (!done) { |
4903 | 0 | done = (failed = !arg1_holder.TrySetToUnsignedLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
4904 | 0 | } |
4905 | 0 | } |
4906 | 0 | if (failed) { |
4907 | 0 | return false; |
4908 | 0 | } |
4909 | 0 | if (!done) { |
4910 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.uniform4uiv", "Uint32Array, UnsignedLongSequence"); |
4911 | 0 | return false; |
4912 | 0 | } |
4913 | 0 | } |
4914 | 0 | uint32_t arg2; |
4915 | 0 | if (args.hasDefined(2)) { |
4916 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
4917 | 0 | return false; |
4918 | 0 | } |
4919 | 0 | } else { |
4920 | 0 | arg2 = 0U; |
4921 | 0 | } |
4922 | 0 | uint32_t arg3; |
4923 | 0 | if (args.hasDefined(3)) { |
4924 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
4925 | 0 | return false; |
4926 | 0 | } |
4927 | 0 | } else { |
4928 | 0 | arg3 = 0U; |
4929 | 0 | } |
4930 | 0 | self->Uniform4uiv(MOZ_KnownLive(Constify(arg0)), Constify(arg1), arg2, arg3); |
4931 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
4932 | 0 | args.rval().setUndefined(); |
4933 | 0 | return true; |
4934 | 0 | } |
4935 | | |
4936 | | static const JSJitInfo uniform4uiv_methodinfo = { |
4937 | | { (JSJitGetterOp)uniform4uiv }, |
4938 | | { prototypes::id::WebGL2RenderingContext }, |
4939 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
4940 | | JSJitInfo::Method, |
4941 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
4942 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
4943 | | false, /* isInfallible. False in setters. */ |
4944 | | false, /* isMovable. Not relevant for setters. */ |
4945 | | false, /* isEliminatable. Not relevant for setters. */ |
4946 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
4947 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
4948 | | false, /* isTypedMethod. Only relevant for methods. */ |
4949 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
4950 | | }; |
4951 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
4952 | | static_assert(0 < 1, "There is no slot for us"); |
4953 | | |
4954 | | MOZ_CAN_RUN_SCRIPT static bool |
4955 | | uniformMatrix2fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
4956 | 0 | { |
4957 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix2fv", DOM, cx); |
4958 | 0 |
|
4959 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
4960 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix2fv"); |
4961 | 0 | } |
4962 | 0 | mozilla::WebGLUniformLocation* arg0; |
4963 | 0 | if (args[0].isObject()) { |
4964 | 0 | { |
4965 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
4966 | 0 | if (NS_FAILED(rv)) { |
4967 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix2fv", "WebGLUniformLocation"); |
4968 | 0 | return false; |
4969 | 0 | } |
4970 | 0 | } |
4971 | 0 | } else if (args[0].isNullOrUndefined()) { |
4972 | 0 | arg0 = nullptr; |
4973 | 0 | } else { |
4974 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix2fv"); |
4975 | 0 | return false; |
4976 | 0 | } |
4977 | 0 | bool arg1; |
4978 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
4979 | 0 | return false; |
4980 | 0 | } |
4981 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
4982 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
4983 | 0 | { |
4984 | 0 | bool done = false, failed = false, tryNext; |
4985 | 0 | if (args[2].isObject()) { |
4986 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
4987 | 0 |
|
4988 | 0 | if (!done) { |
4989 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
4990 | 0 | } |
4991 | 0 | } |
4992 | 0 | if (failed) { |
4993 | 0 | return false; |
4994 | 0 | } |
4995 | 0 | if (!done) { |
4996 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix2fv", "Float32Array, UnrestrictedFloatSequence"); |
4997 | 0 | return false; |
4998 | 0 | } |
4999 | 0 | } |
5000 | 0 | uint32_t arg3; |
5001 | 0 | if (args.hasDefined(3)) { |
5002 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5003 | 0 | return false; |
5004 | 0 | } |
5005 | 0 | } else { |
5006 | 0 | arg3 = 0U; |
5007 | 0 | } |
5008 | 0 | uint32_t arg4; |
5009 | 0 | if (args.hasDefined(4)) { |
5010 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5011 | 0 | return false; |
5012 | 0 | } |
5013 | 0 | } else { |
5014 | 0 | arg4 = 0U; |
5015 | 0 | } |
5016 | 0 | self->UniformMatrix2fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5017 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5018 | 0 | args.rval().setUndefined(); |
5019 | 0 | return true; |
5020 | 0 | } |
5021 | | |
5022 | | static const JSJitInfo uniformMatrix2fv_methodinfo = { |
5023 | | { (JSJitGetterOp)uniformMatrix2fv }, |
5024 | | { prototypes::id::WebGL2RenderingContext }, |
5025 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5026 | | JSJitInfo::Method, |
5027 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5028 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5029 | | false, /* isInfallible. False in setters. */ |
5030 | | false, /* isMovable. Not relevant for setters. */ |
5031 | | false, /* isEliminatable. Not relevant for setters. */ |
5032 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5033 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5034 | | false, /* isTypedMethod. Only relevant for methods. */ |
5035 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5036 | | }; |
5037 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5038 | | static_assert(0 < 1, "There is no slot for us"); |
5039 | | |
5040 | | MOZ_CAN_RUN_SCRIPT static bool |
5041 | | uniformMatrix3x2fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5042 | 0 | { |
5043 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix3x2fv", DOM, cx); |
5044 | 0 |
|
5045 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5046 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix3x2fv"); |
5047 | 0 | } |
5048 | 0 | mozilla::WebGLUniformLocation* arg0; |
5049 | 0 | if (args[0].isObject()) { |
5050 | 0 | { |
5051 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5052 | 0 | if (NS_FAILED(rv)) { |
5053 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix3x2fv", "WebGLUniformLocation"); |
5054 | 0 | return false; |
5055 | 0 | } |
5056 | 0 | } |
5057 | 0 | } else if (args[0].isNullOrUndefined()) { |
5058 | 0 | arg0 = nullptr; |
5059 | 0 | } else { |
5060 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix3x2fv"); |
5061 | 0 | return false; |
5062 | 0 | } |
5063 | 0 | bool arg1; |
5064 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5065 | 0 | return false; |
5066 | 0 | } |
5067 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5068 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5069 | 0 | { |
5070 | 0 | bool done = false, failed = false, tryNext; |
5071 | 0 | if (args[2].isObject()) { |
5072 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5073 | 0 |
|
5074 | 0 | if (!done) { |
5075 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5076 | 0 | } |
5077 | 0 | } |
5078 | 0 | if (failed) { |
5079 | 0 | return false; |
5080 | 0 | } |
5081 | 0 | if (!done) { |
5082 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix3x2fv", "Float32Array, UnrestrictedFloatSequence"); |
5083 | 0 | return false; |
5084 | 0 | } |
5085 | 0 | } |
5086 | 0 | uint32_t arg3; |
5087 | 0 | if (args.hasDefined(3)) { |
5088 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5089 | 0 | return false; |
5090 | 0 | } |
5091 | 0 | } else { |
5092 | 0 | arg3 = 0U; |
5093 | 0 | } |
5094 | 0 | uint32_t arg4; |
5095 | 0 | if (args.hasDefined(4)) { |
5096 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5097 | 0 | return false; |
5098 | 0 | } |
5099 | 0 | } else { |
5100 | 0 | arg4 = 0U; |
5101 | 0 | } |
5102 | 0 | self->UniformMatrix3x2fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5103 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5104 | 0 | args.rval().setUndefined(); |
5105 | 0 | return true; |
5106 | 0 | } |
5107 | | |
5108 | | static const JSJitInfo uniformMatrix3x2fv_methodinfo = { |
5109 | | { (JSJitGetterOp)uniformMatrix3x2fv }, |
5110 | | { prototypes::id::WebGL2RenderingContext }, |
5111 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5112 | | JSJitInfo::Method, |
5113 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5114 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5115 | | false, /* isInfallible. False in setters. */ |
5116 | | false, /* isMovable. Not relevant for setters. */ |
5117 | | false, /* isEliminatable. Not relevant for setters. */ |
5118 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5119 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5120 | | false, /* isTypedMethod. Only relevant for methods. */ |
5121 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5122 | | }; |
5123 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5124 | | static_assert(0 < 1, "There is no slot for us"); |
5125 | | |
5126 | | MOZ_CAN_RUN_SCRIPT static bool |
5127 | | uniformMatrix4x2fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5128 | 0 | { |
5129 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix4x2fv", DOM, cx); |
5130 | 0 |
|
5131 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5132 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix4x2fv"); |
5133 | 0 | } |
5134 | 0 | mozilla::WebGLUniformLocation* arg0; |
5135 | 0 | if (args[0].isObject()) { |
5136 | 0 | { |
5137 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5138 | 0 | if (NS_FAILED(rv)) { |
5139 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix4x2fv", "WebGLUniformLocation"); |
5140 | 0 | return false; |
5141 | 0 | } |
5142 | 0 | } |
5143 | 0 | } else if (args[0].isNullOrUndefined()) { |
5144 | 0 | arg0 = nullptr; |
5145 | 0 | } else { |
5146 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix4x2fv"); |
5147 | 0 | return false; |
5148 | 0 | } |
5149 | 0 | bool arg1; |
5150 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5151 | 0 | return false; |
5152 | 0 | } |
5153 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5154 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5155 | 0 | { |
5156 | 0 | bool done = false, failed = false, tryNext; |
5157 | 0 | if (args[2].isObject()) { |
5158 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5159 | 0 |
|
5160 | 0 | if (!done) { |
5161 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5162 | 0 | } |
5163 | 0 | } |
5164 | 0 | if (failed) { |
5165 | 0 | return false; |
5166 | 0 | } |
5167 | 0 | if (!done) { |
5168 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix4x2fv", "Float32Array, UnrestrictedFloatSequence"); |
5169 | 0 | return false; |
5170 | 0 | } |
5171 | 0 | } |
5172 | 0 | uint32_t arg3; |
5173 | 0 | if (args.hasDefined(3)) { |
5174 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5175 | 0 | return false; |
5176 | 0 | } |
5177 | 0 | } else { |
5178 | 0 | arg3 = 0U; |
5179 | 0 | } |
5180 | 0 | uint32_t arg4; |
5181 | 0 | if (args.hasDefined(4)) { |
5182 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5183 | 0 | return false; |
5184 | 0 | } |
5185 | 0 | } else { |
5186 | 0 | arg4 = 0U; |
5187 | 0 | } |
5188 | 0 | self->UniformMatrix4x2fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5189 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5190 | 0 | args.rval().setUndefined(); |
5191 | 0 | return true; |
5192 | 0 | } |
5193 | | |
5194 | | static const JSJitInfo uniformMatrix4x2fv_methodinfo = { |
5195 | | { (JSJitGetterOp)uniformMatrix4x2fv }, |
5196 | | { prototypes::id::WebGL2RenderingContext }, |
5197 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5198 | | JSJitInfo::Method, |
5199 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5200 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5201 | | false, /* isInfallible. False in setters. */ |
5202 | | false, /* isMovable. Not relevant for setters. */ |
5203 | | false, /* isEliminatable. Not relevant for setters. */ |
5204 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5205 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5206 | | false, /* isTypedMethod. Only relevant for methods. */ |
5207 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5208 | | }; |
5209 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5210 | | static_assert(0 < 1, "There is no slot for us"); |
5211 | | |
5212 | | MOZ_CAN_RUN_SCRIPT static bool |
5213 | | uniformMatrix2x3fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5214 | 0 | { |
5215 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix2x3fv", DOM, cx); |
5216 | 0 |
|
5217 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5218 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix2x3fv"); |
5219 | 0 | } |
5220 | 0 | mozilla::WebGLUniformLocation* arg0; |
5221 | 0 | if (args[0].isObject()) { |
5222 | 0 | { |
5223 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5224 | 0 | if (NS_FAILED(rv)) { |
5225 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix2x3fv", "WebGLUniformLocation"); |
5226 | 0 | return false; |
5227 | 0 | } |
5228 | 0 | } |
5229 | 0 | } else if (args[0].isNullOrUndefined()) { |
5230 | 0 | arg0 = nullptr; |
5231 | 0 | } else { |
5232 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix2x3fv"); |
5233 | 0 | return false; |
5234 | 0 | } |
5235 | 0 | bool arg1; |
5236 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5237 | 0 | return false; |
5238 | 0 | } |
5239 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5240 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5241 | 0 | { |
5242 | 0 | bool done = false, failed = false, tryNext; |
5243 | 0 | if (args[2].isObject()) { |
5244 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5245 | 0 |
|
5246 | 0 | if (!done) { |
5247 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5248 | 0 | } |
5249 | 0 | } |
5250 | 0 | if (failed) { |
5251 | 0 | return false; |
5252 | 0 | } |
5253 | 0 | if (!done) { |
5254 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix2x3fv", "Float32Array, UnrestrictedFloatSequence"); |
5255 | 0 | return false; |
5256 | 0 | } |
5257 | 0 | } |
5258 | 0 | uint32_t arg3; |
5259 | 0 | if (args.hasDefined(3)) { |
5260 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5261 | 0 | return false; |
5262 | 0 | } |
5263 | 0 | } else { |
5264 | 0 | arg3 = 0U; |
5265 | 0 | } |
5266 | 0 | uint32_t arg4; |
5267 | 0 | if (args.hasDefined(4)) { |
5268 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5269 | 0 | return false; |
5270 | 0 | } |
5271 | 0 | } else { |
5272 | 0 | arg4 = 0U; |
5273 | 0 | } |
5274 | 0 | self->UniformMatrix2x3fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5275 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5276 | 0 | args.rval().setUndefined(); |
5277 | 0 | return true; |
5278 | 0 | } |
5279 | | |
5280 | | static const JSJitInfo uniformMatrix2x3fv_methodinfo = { |
5281 | | { (JSJitGetterOp)uniformMatrix2x3fv }, |
5282 | | { prototypes::id::WebGL2RenderingContext }, |
5283 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5284 | | JSJitInfo::Method, |
5285 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5286 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5287 | | false, /* isInfallible. False in setters. */ |
5288 | | false, /* isMovable. Not relevant for setters. */ |
5289 | | false, /* isEliminatable. Not relevant for setters. */ |
5290 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5291 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5292 | | false, /* isTypedMethod. Only relevant for methods. */ |
5293 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5294 | | }; |
5295 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5296 | | static_assert(0 < 1, "There is no slot for us"); |
5297 | | |
5298 | | MOZ_CAN_RUN_SCRIPT static bool |
5299 | | uniformMatrix3fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5300 | 0 | { |
5301 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix3fv", DOM, cx); |
5302 | 0 |
|
5303 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5304 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix3fv"); |
5305 | 0 | } |
5306 | 0 | mozilla::WebGLUniformLocation* arg0; |
5307 | 0 | if (args[0].isObject()) { |
5308 | 0 | { |
5309 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5310 | 0 | if (NS_FAILED(rv)) { |
5311 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix3fv", "WebGLUniformLocation"); |
5312 | 0 | return false; |
5313 | 0 | } |
5314 | 0 | } |
5315 | 0 | } else if (args[0].isNullOrUndefined()) { |
5316 | 0 | arg0 = nullptr; |
5317 | 0 | } else { |
5318 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix3fv"); |
5319 | 0 | return false; |
5320 | 0 | } |
5321 | 0 | bool arg1; |
5322 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5323 | 0 | return false; |
5324 | 0 | } |
5325 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5326 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5327 | 0 | { |
5328 | 0 | bool done = false, failed = false, tryNext; |
5329 | 0 | if (args[2].isObject()) { |
5330 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5331 | 0 |
|
5332 | 0 | if (!done) { |
5333 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5334 | 0 | } |
5335 | 0 | } |
5336 | 0 | if (failed) { |
5337 | 0 | return false; |
5338 | 0 | } |
5339 | 0 | if (!done) { |
5340 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix3fv", "Float32Array, UnrestrictedFloatSequence"); |
5341 | 0 | return false; |
5342 | 0 | } |
5343 | 0 | } |
5344 | 0 | uint32_t arg3; |
5345 | 0 | if (args.hasDefined(3)) { |
5346 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5347 | 0 | return false; |
5348 | 0 | } |
5349 | 0 | } else { |
5350 | 0 | arg3 = 0U; |
5351 | 0 | } |
5352 | 0 | uint32_t arg4; |
5353 | 0 | if (args.hasDefined(4)) { |
5354 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5355 | 0 | return false; |
5356 | 0 | } |
5357 | 0 | } else { |
5358 | 0 | arg4 = 0U; |
5359 | 0 | } |
5360 | 0 | self->UniformMatrix3fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5361 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5362 | 0 | args.rval().setUndefined(); |
5363 | 0 | return true; |
5364 | 0 | } |
5365 | | |
5366 | | static const JSJitInfo uniformMatrix3fv_methodinfo = { |
5367 | | { (JSJitGetterOp)uniformMatrix3fv }, |
5368 | | { prototypes::id::WebGL2RenderingContext }, |
5369 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5370 | | JSJitInfo::Method, |
5371 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5372 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5373 | | false, /* isInfallible. False in setters. */ |
5374 | | false, /* isMovable. Not relevant for setters. */ |
5375 | | false, /* isEliminatable. Not relevant for setters. */ |
5376 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5377 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5378 | | false, /* isTypedMethod. Only relevant for methods. */ |
5379 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5380 | | }; |
5381 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5382 | | static_assert(0 < 1, "There is no slot for us"); |
5383 | | |
5384 | | MOZ_CAN_RUN_SCRIPT static bool |
5385 | | uniformMatrix4x3fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5386 | 0 | { |
5387 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix4x3fv", DOM, cx); |
5388 | 0 |
|
5389 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5390 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix4x3fv"); |
5391 | 0 | } |
5392 | 0 | mozilla::WebGLUniformLocation* arg0; |
5393 | 0 | if (args[0].isObject()) { |
5394 | 0 | { |
5395 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5396 | 0 | if (NS_FAILED(rv)) { |
5397 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix4x3fv", "WebGLUniformLocation"); |
5398 | 0 | return false; |
5399 | 0 | } |
5400 | 0 | } |
5401 | 0 | } else if (args[0].isNullOrUndefined()) { |
5402 | 0 | arg0 = nullptr; |
5403 | 0 | } else { |
5404 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix4x3fv"); |
5405 | 0 | return false; |
5406 | 0 | } |
5407 | 0 | bool arg1; |
5408 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5409 | 0 | return false; |
5410 | 0 | } |
5411 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5412 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5413 | 0 | { |
5414 | 0 | bool done = false, failed = false, tryNext; |
5415 | 0 | if (args[2].isObject()) { |
5416 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5417 | 0 |
|
5418 | 0 | if (!done) { |
5419 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5420 | 0 | } |
5421 | 0 | } |
5422 | 0 | if (failed) { |
5423 | 0 | return false; |
5424 | 0 | } |
5425 | 0 | if (!done) { |
5426 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix4x3fv", "Float32Array, UnrestrictedFloatSequence"); |
5427 | 0 | return false; |
5428 | 0 | } |
5429 | 0 | } |
5430 | 0 | uint32_t arg3; |
5431 | 0 | if (args.hasDefined(3)) { |
5432 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5433 | 0 | return false; |
5434 | 0 | } |
5435 | 0 | } else { |
5436 | 0 | arg3 = 0U; |
5437 | 0 | } |
5438 | 0 | uint32_t arg4; |
5439 | 0 | if (args.hasDefined(4)) { |
5440 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5441 | 0 | return false; |
5442 | 0 | } |
5443 | 0 | } else { |
5444 | 0 | arg4 = 0U; |
5445 | 0 | } |
5446 | 0 | self->UniformMatrix4x3fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5447 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5448 | 0 | args.rval().setUndefined(); |
5449 | 0 | return true; |
5450 | 0 | } |
5451 | | |
5452 | | static const JSJitInfo uniformMatrix4x3fv_methodinfo = { |
5453 | | { (JSJitGetterOp)uniformMatrix4x3fv }, |
5454 | | { prototypes::id::WebGL2RenderingContext }, |
5455 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5456 | | JSJitInfo::Method, |
5457 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5458 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5459 | | false, /* isInfallible. False in setters. */ |
5460 | | false, /* isMovable. Not relevant for setters. */ |
5461 | | false, /* isEliminatable. Not relevant for setters. */ |
5462 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5463 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5464 | | false, /* isTypedMethod. Only relevant for methods. */ |
5465 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5466 | | }; |
5467 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5468 | | static_assert(0 < 1, "There is no slot for us"); |
5469 | | |
5470 | | MOZ_CAN_RUN_SCRIPT static bool |
5471 | | uniformMatrix2x4fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5472 | 0 | { |
5473 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix2x4fv", DOM, cx); |
5474 | 0 |
|
5475 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5476 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix2x4fv"); |
5477 | 0 | } |
5478 | 0 | mozilla::WebGLUniformLocation* arg0; |
5479 | 0 | if (args[0].isObject()) { |
5480 | 0 | { |
5481 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5482 | 0 | if (NS_FAILED(rv)) { |
5483 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix2x4fv", "WebGLUniformLocation"); |
5484 | 0 | return false; |
5485 | 0 | } |
5486 | 0 | } |
5487 | 0 | } else if (args[0].isNullOrUndefined()) { |
5488 | 0 | arg0 = nullptr; |
5489 | 0 | } else { |
5490 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix2x4fv"); |
5491 | 0 | return false; |
5492 | 0 | } |
5493 | 0 | bool arg1; |
5494 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5495 | 0 | return false; |
5496 | 0 | } |
5497 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5498 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5499 | 0 | { |
5500 | 0 | bool done = false, failed = false, tryNext; |
5501 | 0 | if (args[2].isObject()) { |
5502 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5503 | 0 |
|
5504 | 0 | if (!done) { |
5505 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5506 | 0 | } |
5507 | 0 | } |
5508 | 0 | if (failed) { |
5509 | 0 | return false; |
5510 | 0 | } |
5511 | 0 | if (!done) { |
5512 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix2x4fv", "Float32Array, UnrestrictedFloatSequence"); |
5513 | 0 | return false; |
5514 | 0 | } |
5515 | 0 | } |
5516 | 0 | uint32_t arg3; |
5517 | 0 | if (args.hasDefined(3)) { |
5518 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5519 | 0 | return false; |
5520 | 0 | } |
5521 | 0 | } else { |
5522 | 0 | arg3 = 0U; |
5523 | 0 | } |
5524 | 0 | uint32_t arg4; |
5525 | 0 | if (args.hasDefined(4)) { |
5526 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5527 | 0 | return false; |
5528 | 0 | } |
5529 | 0 | } else { |
5530 | 0 | arg4 = 0U; |
5531 | 0 | } |
5532 | 0 | self->UniformMatrix2x4fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5533 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5534 | 0 | args.rval().setUndefined(); |
5535 | 0 | return true; |
5536 | 0 | } |
5537 | | |
5538 | | static const JSJitInfo uniformMatrix2x4fv_methodinfo = { |
5539 | | { (JSJitGetterOp)uniformMatrix2x4fv }, |
5540 | | { prototypes::id::WebGL2RenderingContext }, |
5541 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5542 | | JSJitInfo::Method, |
5543 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5544 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5545 | | false, /* isInfallible. False in setters. */ |
5546 | | false, /* isMovable. Not relevant for setters. */ |
5547 | | false, /* isEliminatable. Not relevant for setters. */ |
5548 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5549 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5550 | | false, /* isTypedMethod. Only relevant for methods. */ |
5551 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5552 | | }; |
5553 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5554 | | static_assert(0 < 1, "There is no slot for us"); |
5555 | | |
5556 | | MOZ_CAN_RUN_SCRIPT static bool |
5557 | | uniformMatrix3x4fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5558 | 0 | { |
5559 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix3x4fv", DOM, cx); |
5560 | 0 |
|
5561 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5562 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix3x4fv"); |
5563 | 0 | } |
5564 | 0 | mozilla::WebGLUniformLocation* arg0; |
5565 | 0 | if (args[0].isObject()) { |
5566 | 0 | { |
5567 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5568 | 0 | if (NS_FAILED(rv)) { |
5569 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix3x4fv", "WebGLUniformLocation"); |
5570 | 0 | return false; |
5571 | 0 | } |
5572 | 0 | } |
5573 | 0 | } else if (args[0].isNullOrUndefined()) { |
5574 | 0 | arg0 = nullptr; |
5575 | 0 | } else { |
5576 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix3x4fv"); |
5577 | 0 | return false; |
5578 | 0 | } |
5579 | 0 | bool arg1; |
5580 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5581 | 0 | return false; |
5582 | 0 | } |
5583 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5584 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5585 | 0 | { |
5586 | 0 | bool done = false, failed = false, tryNext; |
5587 | 0 | if (args[2].isObject()) { |
5588 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5589 | 0 |
|
5590 | 0 | if (!done) { |
5591 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5592 | 0 | } |
5593 | 0 | } |
5594 | 0 | if (failed) { |
5595 | 0 | return false; |
5596 | 0 | } |
5597 | 0 | if (!done) { |
5598 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix3x4fv", "Float32Array, UnrestrictedFloatSequence"); |
5599 | 0 | return false; |
5600 | 0 | } |
5601 | 0 | } |
5602 | 0 | uint32_t arg3; |
5603 | 0 | if (args.hasDefined(3)) { |
5604 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5605 | 0 | return false; |
5606 | 0 | } |
5607 | 0 | } else { |
5608 | 0 | arg3 = 0U; |
5609 | 0 | } |
5610 | 0 | uint32_t arg4; |
5611 | 0 | if (args.hasDefined(4)) { |
5612 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5613 | 0 | return false; |
5614 | 0 | } |
5615 | 0 | } else { |
5616 | 0 | arg4 = 0U; |
5617 | 0 | } |
5618 | 0 | self->UniformMatrix3x4fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5619 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5620 | 0 | args.rval().setUndefined(); |
5621 | 0 | return true; |
5622 | 0 | } |
5623 | | |
5624 | | static const JSJitInfo uniformMatrix3x4fv_methodinfo = { |
5625 | | { (JSJitGetterOp)uniformMatrix3x4fv }, |
5626 | | { prototypes::id::WebGL2RenderingContext }, |
5627 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5628 | | JSJitInfo::Method, |
5629 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5630 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5631 | | false, /* isInfallible. False in setters. */ |
5632 | | false, /* isMovable. Not relevant for setters. */ |
5633 | | false, /* isEliminatable. Not relevant for setters. */ |
5634 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5635 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5636 | | false, /* isTypedMethod. Only relevant for methods. */ |
5637 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5638 | | }; |
5639 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5640 | | static_assert(0 < 1, "There is no slot for us"); |
5641 | | |
5642 | | MOZ_CAN_RUN_SCRIPT static bool |
5643 | | uniformMatrix4fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5644 | 0 | { |
5645 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformMatrix4fv", DOM, cx); |
5646 | 0 |
|
5647 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
5648 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformMatrix4fv"); |
5649 | 0 | } |
5650 | 0 | mozilla::WebGLUniformLocation* arg0; |
5651 | 0 | if (args[0].isObject()) { |
5652 | 0 | { |
5653 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
5654 | 0 | if (NS_FAILED(rv)) { |
5655 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformMatrix4fv", "WebGLUniformLocation"); |
5656 | 0 | return false; |
5657 | 0 | } |
5658 | 0 | } |
5659 | 0 | } else if (args[0].isNullOrUndefined()) { |
5660 | 0 | arg0 = nullptr; |
5661 | 0 | } else { |
5662 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformMatrix4fv"); |
5663 | 0 | return false; |
5664 | 0 | } |
5665 | 0 | bool arg1; |
5666 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
5667 | 0 | return false; |
5668 | 0 | } |
5669 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
5670 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
5671 | 0 | { |
5672 | 0 | bool done = false, failed = false, tryNext; |
5673 | 0 | if (args[2].isObject()) { |
5674 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
5675 | 0 |
|
5676 | 0 | if (!done) { |
5677 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
5678 | 0 | } |
5679 | 0 | } |
5680 | 0 | if (failed) { |
5681 | 0 | return false; |
5682 | 0 | } |
5683 | 0 | if (!done) { |
5684 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.uniformMatrix4fv", "Float32Array, UnrestrictedFloatSequence"); |
5685 | 0 | return false; |
5686 | 0 | } |
5687 | 0 | } |
5688 | 0 | uint32_t arg3; |
5689 | 0 | if (args.hasDefined(3)) { |
5690 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5691 | 0 | return false; |
5692 | 0 | } |
5693 | 0 | } else { |
5694 | 0 | arg3 = 0U; |
5695 | 0 | } |
5696 | 0 | uint32_t arg4; |
5697 | 0 | if (args.hasDefined(4)) { |
5698 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5699 | 0 | return false; |
5700 | 0 | } |
5701 | 0 | } else { |
5702 | 0 | arg4 = 0U; |
5703 | 0 | } |
5704 | 0 | self->UniformMatrix4fv(MOZ_KnownLive(Constify(arg0)), arg1, Constify(arg2), arg3, arg4); |
5705 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5706 | 0 | args.rval().setUndefined(); |
5707 | 0 | return true; |
5708 | 0 | } |
5709 | | |
5710 | | static const JSJitInfo uniformMatrix4fv_methodinfo = { |
5711 | | { (JSJitGetterOp)uniformMatrix4fv }, |
5712 | | { prototypes::id::WebGL2RenderingContext }, |
5713 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5714 | | JSJitInfo::Method, |
5715 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5716 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5717 | | false, /* isInfallible. False in setters. */ |
5718 | | false, /* isMovable. Not relevant for setters. */ |
5719 | | false, /* isEliminatable. Not relevant for setters. */ |
5720 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5721 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5722 | | false, /* isTypedMethod. Only relevant for methods. */ |
5723 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5724 | | }; |
5725 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5726 | | static_assert(0 < 1, "There is no slot for us"); |
5727 | | |
5728 | | MOZ_CAN_RUN_SCRIPT static bool |
5729 | | vertexAttribI4i(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5730 | 0 | { |
5731 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttribI4i", DOM, cx); |
5732 | 0 |
|
5733 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
5734 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttribI4i"); |
5735 | 0 | } |
5736 | 0 | uint32_t arg0; |
5737 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
5738 | 0 | return false; |
5739 | 0 | } |
5740 | 0 | int32_t arg1; |
5741 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
5742 | 0 | return false; |
5743 | 0 | } |
5744 | 0 | int32_t arg2; |
5745 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
5746 | 0 | return false; |
5747 | 0 | } |
5748 | 0 | int32_t arg3; |
5749 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
5750 | 0 | return false; |
5751 | 0 | } |
5752 | 0 | int32_t arg4; |
5753 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
5754 | 0 | return false; |
5755 | 0 | } |
5756 | 0 | self->VertexAttribI4i(arg0, arg1, arg2, arg3, arg4); |
5757 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5758 | 0 | args.rval().setUndefined(); |
5759 | 0 | return true; |
5760 | 0 | } |
5761 | | |
5762 | | static const JSJitInfo vertexAttribI4i_methodinfo = { |
5763 | | { (JSJitGetterOp)vertexAttribI4i }, |
5764 | | { prototypes::id::WebGL2RenderingContext }, |
5765 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5766 | | JSJitInfo::Method, |
5767 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5768 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5769 | | false, /* isInfallible. False in setters. */ |
5770 | | false, /* isMovable. Not relevant for setters. */ |
5771 | | false, /* isEliminatable. Not relevant for setters. */ |
5772 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5773 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5774 | | false, /* isTypedMethod. Only relevant for methods. */ |
5775 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5776 | | }; |
5777 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5778 | | static_assert(0 < 1, "There is no slot for us"); |
5779 | | |
5780 | | MOZ_CAN_RUN_SCRIPT static bool |
5781 | | vertexAttribI4iv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5782 | 0 | { |
5783 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttribI4iv", DOM, cx); |
5784 | 0 |
|
5785 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
5786 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttribI4iv"); |
5787 | 0 | } |
5788 | 0 | uint32_t arg0; |
5789 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
5790 | 0 | return false; |
5791 | 0 | } |
5792 | 0 | Int32ArrayOrLongSequence arg1; |
5793 | 0 | Int32ArrayOrLongSequenceArgument arg1_holder(arg1); |
5794 | 0 | { |
5795 | 0 | bool done = false, failed = false, tryNext; |
5796 | 0 | if (args[1].isObject()) { |
5797 | 0 | done = (failed = !arg1_holder.TrySetToInt32Array(cx, args[1], tryNext, false)) || !tryNext; |
5798 | 0 |
|
5799 | 0 | if (!done) { |
5800 | 0 | done = (failed = !arg1_holder.TrySetToLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
5801 | 0 | } |
5802 | 0 | } |
5803 | 0 | if (failed) { |
5804 | 0 | return false; |
5805 | 0 | } |
5806 | 0 | if (!done) { |
5807 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.vertexAttribI4iv", "Int32Array, LongSequence"); |
5808 | 0 | return false; |
5809 | 0 | } |
5810 | 0 | } |
5811 | 0 | self->VertexAttribI4iv(arg0, Constify(arg1)); |
5812 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5813 | 0 | args.rval().setUndefined(); |
5814 | 0 | return true; |
5815 | 0 | } |
5816 | | |
5817 | | static const JSJitInfo vertexAttribI4iv_methodinfo = { |
5818 | | { (JSJitGetterOp)vertexAttribI4iv }, |
5819 | | { prototypes::id::WebGL2RenderingContext }, |
5820 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5821 | | JSJitInfo::Method, |
5822 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5823 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5824 | | false, /* isInfallible. False in setters. */ |
5825 | | false, /* isMovable. Not relevant for setters. */ |
5826 | | false, /* isEliminatable. Not relevant for setters. */ |
5827 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5828 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5829 | | false, /* isTypedMethod. Only relevant for methods. */ |
5830 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5831 | | }; |
5832 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5833 | | static_assert(0 < 1, "There is no slot for us"); |
5834 | | |
5835 | | MOZ_CAN_RUN_SCRIPT static bool |
5836 | | vertexAttribI4ui(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5837 | 0 | { |
5838 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttribI4ui", DOM, cx); |
5839 | 0 |
|
5840 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
5841 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttribI4ui"); |
5842 | 0 | } |
5843 | 0 | uint32_t arg0; |
5844 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
5845 | 0 | return false; |
5846 | 0 | } |
5847 | 0 | uint32_t arg1; |
5848 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
5849 | 0 | return false; |
5850 | 0 | } |
5851 | 0 | uint32_t arg2; |
5852 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
5853 | 0 | return false; |
5854 | 0 | } |
5855 | 0 | uint32_t arg3; |
5856 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
5857 | 0 | return false; |
5858 | 0 | } |
5859 | 0 | uint32_t arg4; |
5860 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
5861 | 0 | return false; |
5862 | 0 | } |
5863 | 0 | self->VertexAttribI4ui(arg0, arg1, arg2, arg3, arg4); |
5864 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5865 | 0 | args.rval().setUndefined(); |
5866 | 0 | return true; |
5867 | 0 | } |
5868 | | |
5869 | | static const JSJitInfo vertexAttribI4ui_methodinfo = { |
5870 | | { (JSJitGetterOp)vertexAttribI4ui }, |
5871 | | { prototypes::id::WebGL2RenderingContext }, |
5872 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5873 | | JSJitInfo::Method, |
5874 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5875 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5876 | | false, /* isInfallible. False in setters. */ |
5877 | | false, /* isMovable. Not relevant for setters. */ |
5878 | | false, /* isEliminatable. Not relevant for setters. */ |
5879 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5880 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5881 | | false, /* isTypedMethod. Only relevant for methods. */ |
5882 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5883 | | }; |
5884 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5885 | | static_assert(0 < 1, "There is no slot for us"); |
5886 | | |
5887 | | MOZ_CAN_RUN_SCRIPT static bool |
5888 | | vertexAttribI4uiv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5889 | 0 | { |
5890 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttribI4uiv", DOM, cx); |
5891 | 0 |
|
5892 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
5893 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttribI4uiv"); |
5894 | 0 | } |
5895 | 0 | uint32_t arg0; |
5896 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
5897 | 0 | return false; |
5898 | 0 | } |
5899 | 0 | Uint32ArrayOrUnsignedLongSequence arg1; |
5900 | 0 | Uint32ArrayOrUnsignedLongSequenceArgument arg1_holder(arg1); |
5901 | 0 | { |
5902 | 0 | bool done = false, failed = false, tryNext; |
5903 | 0 | if (args[1].isObject()) { |
5904 | 0 | done = (failed = !arg1_holder.TrySetToUint32Array(cx, args[1], tryNext, false)) || !tryNext; |
5905 | 0 |
|
5906 | 0 | if (!done) { |
5907 | 0 | done = (failed = !arg1_holder.TrySetToUnsignedLongSequence(cx, args[1], tryNext, false)) || !tryNext; |
5908 | 0 | } |
5909 | 0 | } |
5910 | 0 | if (failed) { |
5911 | 0 | return false; |
5912 | 0 | } |
5913 | 0 | if (!done) { |
5914 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.vertexAttribI4uiv", "Uint32Array, UnsignedLongSequence"); |
5915 | 0 | return false; |
5916 | 0 | } |
5917 | 0 | } |
5918 | 0 | self->VertexAttribI4uiv(arg0, Constify(arg1)); |
5919 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5920 | 0 | args.rval().setUndefined(); |
5921 | 0 | return true; |
5922 | 0 | } |
5923 | | |
5924 | | static const JSJitInfo vertexAttribI4uiv_methodinfo = { |
5925 | | { (JSJitGetterOp)vertexAttribI4uiv }, |
5926 | | { prototypes::id::WebGL2RenderingContext }, |
5927 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5928 | | JSJitInfo::Method, |
5929 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5930 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5931 | | false, /* isInfallible. False in setters. */ |
5932 | | false, /* isMovable. Not relevant for setters. */ |
5933 | | false, /* isEliminatable. Not relevant for setters. */ |
5934 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5935 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5936 | | false, /* isTypedMethod. Only relevant for methods. */ |
5937 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5938 | | }; |
5939 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5940 | | static_assert(0 < 1, "There is no slot for us"); |
5941 | | |
5942 | | MOZ_CAN_RUN_SCRIPT static bool |
5943 | | vertexAttribIPointer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5944 | 0 | { |
5945 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttribIPointer", DOM, cx); |
5946 | 0 |
|
5947 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
5948 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttribIPointer"); |
5949 | 0 | } |
5950 | 0 | uint32_t arg0; |
5951 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
5952 | 0 | return false; |
5953 | 0 | } |
5954 | 0 | int32_t arg1; |
5955 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
5956 | 0 | return false; |
5957 | 0 | } |
5958 | 0 | uint32_t arg2; |
5959 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
5960 | 0 | return false; |
5961 | 0 | } |
5962 | 0 | int32_t arg3; |
5963 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
5964 | 0 | return false; |
5965 | 0 | } |
5966 | 0 | int64_t arg4; |
5967 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[4], &arg4)) { |
5968 | 0 | return false; |
5969 | 0 | } |
5970 | 0 | self->VertexAttribIPointer(arg0, arg1, arg2, arg3, arg4); |
5971 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
5972 | 0 | args.rval().setUndefined(); |
5973 | 0 | return true; |
5974 | 0 | } |
5975 | | |
5976 | | static const JSJitInfo vertexAttribIPointer_methodinfo = { |
5977 | | { (JSJitGetterOp)vertexAttribIPointer }, |
5978 | | { prototypes::id::WebGL2RenderingContext }, |
5979 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
5980 | | JSJitInfo::Method, |
5981 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
5982 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
5983 | | false, /* isInfallible. False in setters. */ |
5984 | | false, /* isMovable. Not relevant for setters. */ |
5985 | | false, /* isEliminatable. Not relevant for setters. */ |
5986 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
5987 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
5988 | | false, /* isTypedMethod. Only relevant for methods. */ |
5989 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
5990 | | }; |
5991 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
5992 | | static_assert(0 < 1, "There is no slot for us"); |
5993 | | |
5994 | | MOZ_CAN_RUN_SCRIPT static bool |
5995 | | vertexAttribDivisor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
5996 | 0 | { |
5997 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttribDivisor", DOM, cx); |
5998 | 0 |
|
5999 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
6000 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttribDivisor"); |
6001 | 0 | } |
6002 | 0 | uint32_t arg0; |
6003 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6004 | 0 | return false; |
6005 | 0 | } |
6006 | 0 | uint32_t arg1; |
6007 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
6008 | 0 | return false; |
6009 | 0 | } |
6010 | 0 | self->VertexAttribDivisor(arg0, arg1); |
6011 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6012 | 0 | args.rval().setUndefined(); |
6013 | 0 | return true; |
6014 | 0 | } |
6015 | | |
6016 | | static const JSJitInfo vertexAttribDivisor_methodinfo = { |
6017 | | { (JSJitGetterOp)vertexAttribDivisor }, |
6018 | | { prototypes::id::WebGL2RenderingContext }, |
6019 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6020 | | JSJitInfo::Method, |
6021 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6022 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6023 | | false, /* isInfallible. False in setters. */ |
6024 | | false, /* isMovable. Not relevant for setters. */ |
6025 | | false, /* isEliminatable. Not relevant for setters. */ |
6026 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6027 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6028 | | false, /* isTypedMethod. Only relevant for methods. */ |
6029 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6030 | | }; |
6031 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6032 | | static_assert(0 < 1, "There is no slot for us"); |
6033 | | |
6034 | | MOZ_CAN_RUN_SCRIPT static bool |
6035 | | drawArraysInstanced(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6036 | 0 | { |
6037 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.drawArraysInstanced", DOM, cx); |
6038 | 0 |
|
6039 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
6040 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.drawArraysInstanced"); |
6041 | 0 | } |
6042 | 0 | uint32_t arg0; |
6043 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6044 | 0 | return false; |
6045 | 0 | } |
6046 | 0 | int32_t arg1; |
6047 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6048 | 0 | return false; |
6049 | 0 | } |
6050 | 0 | int32_t arg2; |
6051 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
6052 | 0 | return false; |
6053 | 0 | } |
6054 | 0 | int32_t arg3; |
6055 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
6056 | 0 | return false; |
6057 | 0 | } |
6058 | 0 | self->DrawArraysInstanced(arg0, arg1, arg2, arg3); |
6059 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6060 | 0 | args.rval().setUndefined(); |
6061 | 0 | return true; |
6062 | 0 | } |
6063 | | |
6064 | | static const JSJitInfo drawArraysInstanced_methodinfo = { |
6065 | | { (JSJitGetterOp)drawArraysInstanced }, |
6066 | | { prototypes::id::WebGL2RenderingContext }, |
6067 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6068 | | JSJitInfo::Method, |
6069 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6070 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6071 | | false, /* isInfallible. False in setters. */ |
6072 | | false, /* isMovable. Not relevant for setters. */ |
6073 | | false, /* isEliminatable. Not relevant for setters. */ |
6074 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6075 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6076 | | false, /* isTypedMethod. Only relevant for methods. */ |
6077 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6078 | | }; |
6079 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6080 | | static_assert(0 < 1, "There is no slot for us"); |
6081 | | |
6082 | | MOZ_CAN_RUN_SCRIPT static bool |
6083 | | drawElementsInstanced(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6084 | 0 | { |
6085 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.drawElementsInstanced", DOM, cx); |
6086 | 0 |
|
6087 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
6088 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.drawElementsInstanced"); |
6089 | 0 | } |
6090 | 0 | uint32_t arg0; |
6091 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6092 | 0 | return false; |
6093 | 0 | } |
6094 | 0 | int32_t arg1; |
6095 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6096 | 0 | return false; |
6097 | 0 | } |
6098 | 0 | uint32_t arg2; |
6099 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
6100 | 0 | return false; |
6101 | 0 | } |
6102 | 0 | int64_t arg3; |
6103 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[3], &arg3)) { |
6104 | 0 | return false; |
6105 | 0 | } |
6106 | 0 | int32_t arg4; |
6107 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
6108 | 0 | return false; |
6109 | 0 | } |
6110 | 0 | self->DrawElementsInstanced(arg0, arg1, arg2, arg3, arg4); |
6111 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6112 | 0 | args.rval().setUndefined(); |
6113 | 0 | return true; |
6114 | 0 | } |
6115 | | |
6116 | | static const JSJitInfo drawElementsInstanced_methodinfo = { |
6117 | | { (JSJitGetterOp)drawElementsInstanced }, |
6118 | | { prototypes::id::WebGL2RenderingContext }, |
6119 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6120 | | JSJitInfo::Method, |
6121 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6122 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6123 | | false, /* isInfallible. False in setters. */ |
6124 | | false, /* isMovable. Not relevant for setters. */ |
6125 | | false, /* isEliminatable. Not relevant for setters. */ |
6126 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6127 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6128 | | false, /* isTypedMethod. Only relevant for methods. */ |
6129 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6130 | | }; |
6131 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6132 | | static_assert(0 < 1, "There is no slot for us"); |
6133 | | |
6134 | | MOZ_CAN_RUN_SCRIPT static bool |
6135 | | drawRangeElements(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6136 | 0 | { |
6137 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.drawRangeElements", DOM, cx); |
6138 | 0 |
|
6139 | 0 | if (MOZ_UNLIKELY(args.length() < 6)) { |
6140 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.drawRangeElements"); |
6141 | 0 | } |
6142 | 0 | uint32_t arg0; |
6143 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6144 | 0 | return false; |
6145 | 0 | } |
6146 | 0 | uint32_t arg1; |
6147 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
6148 | 0 | return false; |
6149 | 0 | } |
6150 | 0 | uint32_t arg2; |
6151 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
6152 | 0 | return false; |
6153 | 0 | } |
6154 | 0 | int32_t arg3; |
6155 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
6156 | 0 | return false; |
6157 | 0 | } |
6158 | 0 | uint32_t arg4; |
6159 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
6160 | 0 | return false; |
6161 | 0 | } |
6162 | 0 | int64_t arg5; |
6163 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[5], &arg5)) { |
6164 | 0 | return false; |
6165 | 0 | } |
6166 | 0 | self->DrawRangeElements(arg0, arg1, arg2, arg3, arg4, arg5); |
6167 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6168 | 0 | args.rval().setUndefined(); |
6169 | 0 | return true; |
6170 | 0 | } |
6171 | | |
6172 | | static const JSJitInfo drawRangeElements_methodinfo = { |
6173 | | { (JSJitGetterOp)drawRangeElements }, |
6174 | | { prototypes::id::WebGL2RenderingContext }, |
6175 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6176 | | JSJitInfo::Method, |
6177 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6178 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6179 | | false, /* isInfallible. False in setters. */ |
6180 | | false, /* isMovable. Not relevant for setters. */ |
6181 | | false, /* isEliminatable. Not relevant for setters. */ |
6182 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6183 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6184 | | false, /* isTypedMethod. Only relevant for methods. */ |
6185 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6186 | | }; |
6187 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6188 | | static_assert(0 < 1, "There is no slot for us"); |
6189 | | |
6190 | | MOZ_CAN_RUN_SCRIPT static bool |
6191 | | readPixels(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6192 | 0 | { |
6193 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.readPixels", DOM, cx); |
6194 | 0 |
|
6195 | 0 | unsigned argcount = std::min(args.length(), 8u); |
6196 | 0 | switch (argcount) { |
6197 | 0 | case 7: { |
6198 | 0 | int32_t arg0; |
6199 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) { |
6200 | 0 | return false; |
6201 | 0 | } |
6202 | 0 | int32_t arg1; |
6203 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6204 | 0 | return false; |
6205 | 0 | } |
6206 | 0 | int32_t arg2; |
6207 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
6208 | 0 | return false; |
6209 | 0 | } |
6210 | 0 | int32_t arg3; |
6211 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
6212 | 0 | return false; |
6213 | 0 | } |
6214 | 0 | uint32_t arg4; |
6215 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
6216 | 0 | return false; |
6217 | 0 | } |
6218 | 0 | uint32_t arg5; |
6219 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[5], &arg5)) { |
6220 | 0 | return false; |
6221 | 0 | } |
6222 | 0 | if (args[6].isNullOrUndefined()) { |
6223 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg6(cx); |
6224 | 0 | arg6.SetNull(); |
6225 | 0 | FastErrorResult rv; |
6226 | 0 | self->ReadPixels(arg0, arg1, arg2, arg3, arg4, arg5, Constify(arg6), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv); |
6227 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
6228 | 0 | return false; |
6229 | 0 | } |
6230 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6231 | 0 | args.rval().setUndefined(); |
6232 | 0 | return true; |
6233 | 0 | } |
6234 | 0 | if (args[6].isObject()) { |
6235 | 0 | do { |
6236 | 0 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg6(cx); |
6237 | 0 | if (!arg6.SetValue().Init(&args[6].toObject())) { |
6238 | 0 | break; |
6239 | 0 | } |
6240 | 0 | FastErrorResult rv; |
6241 | 0 | self->ReadPixels(arg0, arg1, arg2, arg3, arg4, arg5, Constify(arg6), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv); |
6242 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
6243 | 0 | return false; |
6244 | 0 | } |
6245 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6246 | 0 | args.rval().setUndefined(); |
6247 | 0 | return true; |
6248 | 0 | } while (false); |
6249 | 0 | } |
6250 | 0 | int64_t arg6; |
6251 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[6], &arg6)) { |
6252 | 0 | return false; |
6253 | 0 | } |
6254 | 0 | FastErrorResult rv; |
6255 | 0 | self->ReadPixels(arg0, arg1, arg2, arg3, arg4, arg5, arg6, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv); |
6256 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
6257 | 0 | return false; |
6258 | 0 | } |
6259 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6260 | 0 | args.rval().setUndefined(); |
6261 | 0 | return true; |
6262 | 0 | break; |
6263 | 0 | } |
6264 | 0 | case 8: { |
6265 | 0 | int32_t arg0; |
6266 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) { |
6267 | 0 | return false; |
6268 | 0 | } |
6269 | 0 | int32_t arg1; |
6270 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6271 | 0 | return false; |
6272 | 0 | } |
6273 | 0 | int32_t arg2; |
6274 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
6275 | 0 | return false; |
6276 | 0 | } |
6277 | 0 | int32_t arg3; |
6278 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
6279 | 0 | return false; |
6280 | 0 | } |
6281 | 0 | uint32_t arg4; |
6282 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) { |
6283 | 0 | return false; |
6284 | 0 | } |
6285 | 0 | uint32_t arg5; |
6286 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[5], &arg5)) { |
6287 | 0 | return false; |
6288 | 0 | } |
6289 | 0 | RootedSpiderMonkeyInterface<ArrayBufferView> arg6(cx); |
6290 | 0 | if (args[6].isObject()) { |
6291 | 0 | if (!arg6.Init(&args[6].toObject())) { |
6292 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 7 of WebGL2RenderingContext.readPixels", "ArrayBufferView"); |
6293 | 0 | return false; |
6294 | 0 | } |
6295 | 0 | } else { |
6296 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 7 of WebGL2RenderingContext.readPixels"); |
6297 | 0 | return false; |
6298 | 0 | } |
6299 | 0 | uint32_t arg7; |
6300 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[7], &arg7)) { |
6301 | 0 | return false; |
6302 | 0 | } |
6303 | 0 | FastErrorResult rv; |
6304 | 0 | self->ReadPixels(arg0, arg1, arg2, arg3, arg4, arg5, Constify(arg6), arg7, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv); |
6305 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
6306 | 0 | return false; |
6307 | 0 | } |
6308 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6309 | 0 | args.rval().setUndefined(); |
6310 | 0 | return true; |
6311 | 0 | break; |
6312 | 0 | } |
6313 | 0 | default: { |
6314 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.readPixels"); |
6315 | 0 | break; |
6316 | 0 | } |
6317 | 0 | } |
6318 | 0 | MOZ_CRASH("We have an always-returning default case"); |
6319 | 0 | return false; |
6320 | 0 | } |
6321 | | |
6322 | | static const JSJitInfo readPixels_methodinfo = { |
6323 | | { (JSJitGetterOp)readPixels }, |
6324 | | { prototypes::id::WebGL2RenderingContext }, |
6325 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6326 | | JSJitInfo::Method, |
6327 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6328 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6329 | | false, /* isInfallible. False in setters. */ |
6330 | | false, /* isMovable. Not relevant for setters. */ |
6331 | | false, /* isEliminatable. Not relevant for setters. */ |
6332 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6333 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6334 | | false, /* isTypedMethod. Only relevant for methods. */ |
6335 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6336 | | }; |
6337 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6338 | | static_assert(0 < 1, "There is no slot for us"); |
6339 | | |
6340 | | MOZ_CAN_RUN_SCRIPT static bool |
6341 | | drawBuffers(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6342 | 0 | { |
6343 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.drawBuffers", DOM, cx); |
6344 | 0 |
|
6345 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
6346 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.drawBuffers"); |
6347 | 0 | } |
6348 | 0 | binding_detail::AutoSequence<uint32_t> arg0; |
6349 | 0 | if (args[0].isObject()) { |
6350 | 0 | JS::ForOfIterator iter(cx); |
6351 | 0 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { |
6352 | 0 | return false; |
6353 | 0 | } |
6354 | 0 | if (!iter.valueIsIterable()) { |
6355 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 1 of WebGL2RenderingContext.drawBuffers"); |
6356 | 0 | return false; |
6357 | 0 | } |
6358 | 0 | binding_detail::AutoSequence<uint32_t> &arr = arg0; |
6359 | 0 | JS::Rooted<JS::Value> temp(cx); |
6360 | 0 | while (true) { |
6361 | 0 | bool done; |
6362 | 0 | if (!iter.next(&temp, &done)) { |
6363 | 0 | return false; |
6364 | 0 | } |
6365 | 0 | if (done) { |
6366 | 0 | break; |
6367 | 0 | } |
6368 | 0 | uint32_t* slotPtr = arr.AppendElement(mozilla::fallible); |
6369 | 0 | if (!slotPtr) { |
6370 | 0 | JS_ReportOutOfMemory(cx); |
6371 | 0 | return false; |
6372 | 0 | } |
6373 | 0 | uint32_t& slot = *slotPtr; |
6374 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) { |
6375 | 0 | return false; |
6376 | 0 | } |
6377 | 0 | } |
6378 | 0 | } else { |
6379 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 1 of WebGL2RenderingContext.drawBuffers"); |
6380 | 0 | return false; |
6381 | 0 | } |
6382 | 0 | self->DrawBuffers(Constify(arg0)); |
6383 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6384 | 0 | args.rval().setUndefined(); |
6385 | 0 | return true; |
6386 | 0 | } |
6387 | | |
6388 | | static const JSJitInfo drawBuffers_methodinfo = { |
6389 | | { (JSJitGetterOp)drawBuffers }, |
6390 | | { prototypes::id::WebGL2RenderingContext }, |
6391 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6392 | | JSJitInfo::Method, |
6393 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6394 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6395 | | false, /* isInfallible. False in setters. */ |
6396 | | false, /* isMovable. Not relevant for setters. */ |
6397 | | false, /* isEliminatable. Not relevant for setters. */ |
6398 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6399 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6400 | | false, /* isTypedMethod. Only relevant for methods. */ |
6401 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6402 | | }; |
6403 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6404 | | static_assert(0 < 1, "There is no slot for us"); |
6405 | | |
6406 | | MOZ_CAN_RUN_SCRIPT static bool |
6407 | | clearBufferfv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6408 | 0 | { |
6409 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clearBufferfv", DOM, cx); |
6410 | 0 |
|
6411 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
6412 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clearBufferfv"); |
6413 | 0 | } |
6414 | 0 | uint32_t arg0; |
6415 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6416 | 0 | return false; |
6417 | 0 | } |
6418 | 0 | int32_t arg1; |
6419 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6420 | 0 | return false; |
6421 | 0 | } |
6422 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg2; |
6423 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg2_holder(arg2); |
6424 | 0 | { |
6425 | 0 | bool done = false, failed = false, tryNext; |
6426 | 0 | if (args[2].isObject()) { |
6427 | 0 | done = (failed = !arg2_holder.TrySetToFloat32Array(cx, args[2], tryNext, false)) || !tryNext; |
6428 | 0 |
|
6429 | 0 | if (!done) { |
6430 | 0 | done = (failed = !arg2_holder.TrySetToUnrestrictedFloatSequence(cx, args[2], tryNext, false)) || !tryNext; |
6431 | 0 | } |
6432 | 0 | } |
6433 | 0 | if (failed) { |
6434 | 0 | return false; |
6435 | 0 | } |
6436 | 0 | if (!done) { |
6437 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.clearBufferfv", "Float32Array, UnrestrictedFloatSequence"); |
6438 | 0 | return false; |
6439 | 0 | } |
6440 | 0 | } |
6441 | 0 | uint32_t arg3; |
6442 | 0 | if (args.hasDefined(3)) { |
6443 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
6444 | 0 | return false; |
6445 | 0 | } |
6446 | 0 | } else { |
6447 | 0 | arg3 = 0U; |
6448 | 0 | } |
6449 | 0 | self->ClearBufferfv(arg0, arg1, Constify(arg2), arg3); |
6450 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6451 | 0 | args.rval().setUndefined(); |
6452 | 0 | return true; |
6453 | 0 | } |
6454 | | |
6455 | | static const JSJitInfo clearBufferfv_methodinfo = { |
6456 | | { (JSJitGetterOp)clearBufferfv }, |
6457 | | { prototypes::id::WebGL2RenderingContext }, |
6458 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6459 | | JSJitInfo::Method, |
6460 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6461 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6462 | | false, /* isInfallible. False in setters. */ |
6463 | | false, /* isMovable. Not relevant for setters. */ |
6464 | | false, /* isEliminatable. Not relevant for setters. */ |
6465 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6466 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6467 | | false, /* isTypedMethod. Only relevant for methods. */ |
6468 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6469 | | }; |
6470 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6471 | | static_assert(0 < 1, "There is no slot for us"); |
6472 | | |
6473 | | MOZ_CAN_RUN_SCRIPT static bool |
6474 | | clearBufferiv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6475 | 0 | { |
6476 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clearBufferiv", DOM, cx); |
6477 | 0 |
|
6478 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
6479 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clearBufferiv"); |
6480 | 0 | } |
6481 | 0 | uint32_t arg0; |
6482 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6483 | 0 | return false; |
6484 | 0 | } |
6485 | 0 | int32_t arg1; |
6486 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6487 | 0 | return false; |
6488 | 0 | } |
6489 | 0 | Int32ArrayOrLongSequence arg2; |
6490 | 0 | Int32ArrayOrLongSequenceArgument arg2_holder(arg2); |
6491 | 0 | { |
6492 | 0 | bool done = false, failed = false, tryNext; |
6493 | 0 | if (args[2].isObject()) { |
6494 | 0 | done = (failed = !arg2_holder.TrySetToInt32Array(cx, args[2], tryNext, false)) || !tryNext; |
6495 | 0 |
|
6496 | 0 | if (!done) { |
6497 | 0 | done = (failed = !arg2_holder.TrySetToLongSequence(cx, args[2], tryNext, false)) || !tryNext; |
6498 | 0 | } |
6499 | 0 | } |
6500 | 0 | if (failed) { |
6501 | 0 | return false; |
6502 | 0 | } |
6503 | 0 | if (!done) { |
6504 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.clearBufferiv", "Int32Array, LongSequence"); |
6505 | 0 | return false; |
6506 | 0 | } |
6507 | 0 | } |
6508 | 0 | uint32_t arg3; |
6509 | 0 | if (args.hasDefined(3)) { |
6510 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
6511 | 0 | return false; |
6512 | 0 | } |
6513 | 0 | } else { |
6514 | 0 | arg3 = 0U; |
6515 | 0 | } |
6516 | 0 | self->ClearBufferiv(arg0, arg1, Constify(arg2), arg3); |
6517 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6518 | 0 | args.rval().setUndefined(); |
6519 | 0 | return true; |
6520 | 0 | } |
6521 | | |
6522 | | static const JSJitInfo clearBufferiv_methodinfo = { |
6523 | | { (JSJitGetterOp)clearBufferiv }, |
6524 | | { prototypes::id::WebGL2RenderingContext }, |
6525 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6526 | | JSJitInfo::Method, |
6527 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6528 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6529 | | false, /* isInfallible. False in setters. */ |
6530 | | false, /* isMovable. Not relevant for setters. */ |
6531 | | false, /* isEliminatable. Not relevant for setters. */ |
6532 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6533 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6534 | | false, /* isTypedMethod. Only relevant for methods. */ |
6535 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6536 | | }; |
6537 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6538 | | static_assert(0 < 1, "There is no slot for us"); |
6539 | | |
6540 | | MOZ_CAN_RUN_SCRIPT static bool |
6541 | | clearBufferuiv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6542 | 0 | { |
6543 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clearBufferuiv", DOM, cx); |
6544 | 0 |
|
6545 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
6546 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clearBufferuiv"); |
6547 | 0 | } |
6548 | 0 | uint32_t arg0; |
6549 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6550 | 0 | return false; |
6551 | 0 | } |
6552 | 0 | int32_t arg1; |
6553 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6554 | 0 | return false; |
6555 | 0 | } |
6556 | 0 | Uint32ArrayOrUnsignedLongSequence arg2; |
6557 | 0 | Uint32ArrayOrUnsignedLongSequenceArgument arg2_holder(arg2); |
6558 | 0 | { |
6559 | 0 | bool done = false, failed = false, tryNext; |
6560 | 0 | if (args[2].isObject()) { |
6561 | 0 | done = (failed = !arg2_holder.TrySetToUint32Array(cx, args[2], tryNext, false)) || !tryNext; |
6562 | 0 |
|
6563 | 0 | if (!done) { |
6564 | 0 | done = (failed = !arg2_holder.TrySetToUnsignedLongSequence(cx, args[2], tryNext, false)) || !tryNext; |
6565 | 0 | } |
6566 | 0 | } |
6567 | 0 | if (failed) { |
6568 | 0 | return false; |
6569 | 0 | } |
6570 | 0 | if (!done) { |
6571 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of WebGL2RenderingContext.clearBufferuiv", "Uint32Array, UnsignedLongSequence"); |
6572 | 0 | return false; |
6573 | 0 | } |
6574 | 0 | } |
6575 | 0 | uint32_t arg3; |
6576 | 0 | if (args.hasDefined(3)) { |
6577 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
6578 | 0 | return false; |
6579 | 0 | } |
6580 | 0 | } else { |
6581 | 0 | arg3 = 0U; |
6582 | 0 | } |
6583 | 0 | self->ClearBufferuiv(arg0, arg1, Constify(arg2), arg3); |
6584 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6585 | 0 | args.rval().setUndefined(); |
6586 | 0 | return true; |
6587 | 0 | } |
6588 | | |
6589 | | static const JSJitInfo clearBufferuiv_methodinfo = { |
6590 | | { (JSJitGetterOp)clearBufferuiv }, |
6591 | | { prototypes::id::WebGL2RenderingContext }, |
6592 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6593 | | JSJitInfo::Method, |
6594 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6595 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6596 | | false, /* isInfallible. False in setters. */ |
6597 | | false, /* isMovable. Not relevant for setters. */ |
6598 | | false, /* isEliminatable. Not relevant for setters. */ |
6599 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6600 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6601 | | false, /* isTypedMethod. Only relevant for methods. */ |
6602 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6603 | | }; |
6604 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6605 | | static_assert(0 < 1, "There is no slot for us"); |
6606 | | |
6607 | | MOZ_CAN_RUN_SCRIPT static bool |
6608 | | clearBufferfi(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6609 | 0 | { |
6610 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clearBufferfi", DOM, cx); |
6611 | 0 |
|
6612 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
6613 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clearBufferfi"); |
6614 | 0 | } |
6615 | 0 | uint32_t arg0; |
6616 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6617 | 0 | return false; |
6618 | 0 | } |
6619 | 0 | int32_t arg1; |
6620 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
6621 | 0 | return false; |
6622 | 0 | } |
6623 | 0 | float arg2; |
6624 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
6625 | 0 | return false; |
6626 | 0 | } |
6627 | 0 | int32_t arg3; |
6628 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
6629 | 0 | return false; |
6630 | 0 | } |
6631 | 0 | self->ClearBufferfi(arg0, arg1, arg2, arg3); |
6632 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6633 | 0 | args.rval().setUndefined(); |
6634 | 0 | return true; |
6635 | 0 | } |
6636 | | |
6637 | | static const JSJitInfo clearBufferfi_methodinfo = { |
6638 | | { (JSJitGetterOp)clearBufferfi }, |
6639 | | { prototypes::id::WebGL2RenderingContext }, |
6640 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6641 | | JSJitInfo::Method, |
6642 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6643 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6644 | | false, /* isInfallible. False in setters. */ |
6645 | | false, /* isMovable. Not relevant for setters. */ |
6646 | | false, /* isEliminatable. Not relevant for setters. */ |
6647 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6648 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6649 | | false, /* isTypedMethod. Only relevant for methods. */ |
6650 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6651 | | }; |
6652 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6653 | | static_assert(0 < 1, "There is no slot for us"); |
6654 | | |
6655 | | MOZ_CAN_RUN_SCRIPT static bool |
6656 | | createQuery(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6657 | 0 | { |
6658 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createQuery", DOM, cx); |
6659 | 0 |
|
6660 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLQuery>(self->CreateQuery())); |
6661 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6662 | 0 | if (!result) { |
6663 | 0 | args.rval().setNull(); |
6664 | 0 | return true; |
6665 | 0 | } |
6666 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
6667 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
6668 | 0 | return false; |
6669 | 0 | } |
6670 | 0 | return true; |
6671 | 0 | } |
6672 | | |
6673 | | static const JSJitInfo createQuery_methodinfo = { |
6674 | | { (JSJitGetterOp)createQuery }, |
6675 | | { prototypes::id::WebGL2RenderingContext }, |
6676 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6677 | | JSJitInfo::Method, |
6678 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6679 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
6680 | | false, /* isInfallible. False in setters. */ |
6681 | | false, /* isMovable. Not relevant for setters. */ |
6682 | | false, /* isEliminatable. Not relevant for setters. */ |
6683 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6684 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6685 | | false, /* isTypedMethod. Only relevant for methods. */ |
6686 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6687 | | }; |
6688 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6689 | | static_assert(0 < 1, "There is no slot for us"); |
6690 | | |
6691 | | MOZ_CAN_RUN_SCRIPT static bool |
6692 | | deleteQuery(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6693 | 0 | { |
6694 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteQuery", DOM, cx); |
6695 | 0 |
|
6696 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
6697 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteQuery"); |
6698 | 0 | } |
6699 | 0 | mozilla::WebGLQuery* arg0; |
6700 | 0 | if (args[0].isObject()) { |
6701 | 0 | { |
6702 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLQuery, mozilla::WebGLQuery>(args[0], arg0); |
6703 | 0 | if (NS_FAILED(rv)) { |
6704 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteQuery", "WebGLQuery"); |
6705 | 0 | return false; |
6706 | 0 | } |
6707 | 0 | } |
6708 | 0 | } else if (args[0].isNullOrUndefined()) { |
6709 | 0 | arg0 = nullptr; |
6710 | 0 | } else { |
6711 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteQuery"); |
6712 | 0 | return false; |
6713 | 0 | } |
6714 | 0 | self->DeleteQuery(MOZ_KnownLive(Constify(arg0))); |
6715 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6716 | 0 | args.rval().setUndefined(); |
6717 | 0 | return true; |
6718 | 0 | } |
6719 | | |
6720 | | static const JSJitInfo deleteQuery_methodinfo = { |
6721 | | { (JSJitGetterOp)deleteQuery }, |
6722 | | { prototypes::id::WebGL2RenderingContext }, |
6723 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6724 | | JSJitInfo::Method, |
6725 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6726 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6727 | | false, /* isInfallible. False in setters. */ |
6728 | | false, /* isMovable. Not relevant for setters. */ |
6729 | | false, /* isEliminatable. Not relevant for setters. */ |
6730 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6731 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6732 | | false, /* isTypedMethod. Only relevant for methods. */ |
6733 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6734 | | }; |
6735 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6736 | | static_assert(0 < 1, "There is no slot for us"); |
6737 | | |
6738 | | MOZ_CAN_RUN_SCRIPT static bool |
6739 | | isQuery(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6740 | 0 | { |
6741 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isQuery", DOM, cx); |
6742 | 0 |
|
6743 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
6744 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isQuery"); |
6745 | 0 | } |
6746 | 0 | mozilla::WebGLQuery* arg0; |
6747 | 0 | if (args[0].isObject()) { |
6748 | 0 | { |
6749 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLQuery, mozilla::WebGLQuery>(args[0], arg0); |
6750 | 0 | if (NS_FAILED(rv)) { |
6751 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isQuery", "WebGLQuery"); |
6752 | 0 | return false; |
6753 | 0 | } |
6754 | 0 | } |
6755 | 0 | } else if (args[0].isNullOrUndefined()) { |
6756 | 0 | arg0 = nullptr; |
6757 | 0 | } else { |
6758 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isQuery"); |
6759 | 0 | return false; |
6760 | 0 | } |
6761 | 0 | bool result(self->IsQuery(MOZ_KnownLive(Constify(arg0)))); |
6762 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6763 | 0 | args.rval().setBoolean(result); |
6764 | 0 | return true; |
6765 | 0 | } |
6766 | | |
6767 | | static const JSJitInfo isQuery_methodinfo = { |
6768 | | { (JSJitGetterOp)isQuery }, |
6769 | | { prototypes::id::WebGL2RenderingContext }, |
6770 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6771 | | JSJitInfo::Method, |
6772 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6773 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
6774 | | false, /* isInfallible. False in setters. */ |
6775 | | false, /* isMovable. Not relevant for setters. */ |
6776 | | false, /* isEliminatable. Not relevant for setters. */ |
6777 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6778 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6779 | | false, /* isTypedMethod. Only relevant for methods. */ |
6780 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6781 | | }; |
6782 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6783 | | static_assert(0 < 1, "There is no slot for us"); |
6784 | | |
6785 | | MOZ_CAN_RUN_SCRIPT static bool |
6786 | | beginQuery(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6787 | 0 | { |
6788 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.beginQuery", DOM, cx); |
6789 | 0 |
|
6790 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
6791 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.beginQuery"); |
6792 | 0 | } |
6793 | 0 | uint32_t arg0; |
6794 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6795 | 0 | return false; |
6796 | 0 | } |
6797 | 0 | NonNull<mozilla::WebGLQuery> arg1; |
6798 | 0 | if (args[1].isObject()) { |
6799 | 0 | { |
6800 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLQuery, mozilla::WebGLQuery>(args[1], arg1); |
6801 | 0 | if (NS_FAILED(rv)) { |
6802 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.beginQuery", "WebGLQuery"); |
6803 | 0 | return false; |
6804 | 0 | } |
6805 | 0 | } |
6806 | 0 | } else { |
6807 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.beginQuery"); |
6808 | 0 | return false; |
6809 | 0 | } |
6810 | 0 | self->BeginQuery(arg0, MOZ_KnownLive(NonNullHelper(arg1))); |
6811 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6812 | 0 | args.rval().setUndefined(); |
6813 | 0 | return true; |
6814 | 0 | } |
6815 | | |
6816 | | static const JSJitInfo beginQuery_methodinfo = { |
6817 | | { (JSJitGetterOp)beginQuery }, |
6818 | | { prototypes::id::WebGL2RenderingContext }, |
6819 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6820 | | JSJitInfo::Method, |
6821 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6822 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6823 | | false, /* isInfallible. False in setters. */ |
6824 | | false, /* isMovable. Not relevant for setters. */ |
6825 | | false, /* isEliminatable. Not relevant for setters. */ |
6826 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6827 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6828 | | false, /* isTypedMethod. Only relevant for methods. */ |
6829 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6830 | | }; |
6831 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6832 | | static_assert(0 < 1, "There is no slot for us"); |
6833 | | |
6834 | | MOZ_CAN_RUN_SCRIPT static bool |
6835 | | endQuery(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6836 | 0 | { |
6837 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.endQuery", DOM, cx); |
6838 | 0 |
|
6839 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
6840 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.endQuery"); |
6841 | 0 | } |
6842 | 0 | uint32_t arg0; |
6843 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6844 | 0 | return false; |
6845 | 0 | } |
6846 | 0 | self->EndQuery(arg0); |
6847 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6848 | 0 | args.rval().setUndefined(); |
6849 | 0 | return true; |
6850 | 0 | } |
6851 | | |
6852 | | static const JSJitInfo endQuery_methodinfo = { |
6853 | | { (JSJitGetterOp)endQuery }, |
6854 | | { prototypes::id::WebGL2RenderingContext }, |
6855 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6856 | | JSJitInfo::Method, |
6857 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6858 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
6859 | | false, /* isInfallible. False in setters. */ |
6860 | | false, /* isMovable. Not relevant for setters. */ |
6861 | | false, /* isEliminatable. Not relevant for setters. */ |
6862 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6863 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6864 | | false, /* isTypedMethod. Only relevant for methods. */ |
6865 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6866 | | }; |
6867 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6868 | | static_assert(0 < 1, "There is no slot for us"); |
6869 | | |
6870 | | MOZ_CAN_RUN_SCRIPT static bool |
6871 | | getQuery(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6872 | 0 | { |
6873 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getQuery", DOM, cx); |
6874 | 0 |
|
6875 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
6876 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getQuery"); |
6877 | 0 | } |
6878 | 0 | uint32_t arg0; |
6879 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
6880 | 0 | return false; |
6881 | 0 | } |
6882 | 0 | uint32_t arg1; |
6883 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
6884 | 0 | return false; |
6885 | 0 | } |
6886 | 0 | JS::Rooted<JS::Value> result(cx); |
6887 | 0 | self->GetQuery(cx, arg0, arg1, &result); |
6888 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6889 | 0 | JS::ExposeValueToActiveJS(result); |
6890 | 0 | args.rval().set(result); |
6891 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
6892 | 0 | return false; |
6893 | 0 | } |
6894 | 0 | return true; |
6895 | 0 | } |
6896 | | |
6897 | | static const JSJitInfo getQuery_methodinfo = { |
6898 | | { (JSJitGetterOp)getQuery }, |
6899 | | { prototypes::id::WebGL2RenderingContext }, |
6900 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6901 | | JSJitInfo::Method, |
6902 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6903 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
6904 | | false, /* isInfallible. False in setters. */ |
6905 | | false, /* isMovable. Not relevant for setters. */ |
6906 | | false, /* isEliminatable. Not relevant for setters. */ |
6907 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6908 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6909 | | false, /* isTypedMethod. Only relevant for methods. */ |
6910 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6911 | | }; |
6912 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6913 | | static_assert(0 < 1, "There is no slot for us"); |
6914 | | |
6915 | | MOZ_CAN_RUN_SCRIPT static bool |
6916 | | getQueryParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6917 | 0 | { |
6918 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getQueryParameter", DOM, cx); |
6919 | 0 |
|
6920 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
6921 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getQueryParameter"); |
6922 | 0 | } |
6923 | 0 | NonNull<mozilla::WebGLQuery> arg0; |
6924 | 0 | if (args[0].isObject()) { |
6925 | 0 | { |
6926 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLQuery, mozilla::WebGLQuery>(args[0], arg0); |
6927 | 0 | if (NS_FAILED(rv)) { |
6928 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getQueryParameter", "WebGLQuery"); |
6929 | 0 | return false; |
6930 | 0 | } |
6931 | 0 | } |
6932 | 0 | } else { |
6933 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getQueryParameter"); |
6934 | 0 | return false; |
6935 | 0 | } |
6936 | 0 | uint32_t arg1; |
6937 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
6938 | 0 | return false; |
6939 | 0 | } |
6940 | 0 | JS::Rooted<JS::Value> result(cx); |
6941 | 0 | self->GetQueryParameter(cx, MOZ_KnownLive(NonNullHelper(arg0)), arg1, &result); |
6942 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6943 | 0 | JS::ExposeValueToActiveJS(result); |
6944 | 0 | args.rval().set(result); |
6945 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
6946 | 0 | return false; |
6947 | 0 | } |
6948 | 0 | return true; |
6949 | 0 | } |
6950 | | |
6951 | | static const JSJitInfo getQueryParameter_methodinfo = { |
6952 | | { (JSJitGetterOp)getQueryParameter }, |
6953 | | { prototypes::id::WebGL2RenderingContext }, |
6954 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6955 | | JSJitInfo::Method, |
6956 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6957 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
6958 | | false, /* isInfallible. False in setters. */ |
6959 | | false, /* isMovable. Not relevant for setters. */ |
6960 | | false, /* isEliminatable. Not relevant for setters. */ |
6961 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6962 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6963 | | false, /* isTypedMethod. Only relevant for methods. */ |
6964 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
6965 | | }; |
6966 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
6967 | | static_assert(0 < 1, "There is no slot for us"); |
6968 | | |
6969 | | MOZ_CAN_RUN_SCRIPT static bool |
6970 | | createSampler(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
6971 | 0 | { |
6972 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createSampler", DOM, cx); |
6973 | 0 |
|
6974 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLSampler>(self->CreateSampler())); |
6975 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
6976 | 0 | if (!result) { |
6977 | 0 | args.rval().setNull(); |
6978 | 0 | return true; |
6979 | 0 | } |
6980 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
6981 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
6982 | 0 | return false; |
6983 | 0 | } |
6984 | 0 | return true; |
6985 | 0 | } |
6986 | | |
6987 | | static const JSJitInfo createSampler_methodinfo = { |
6988 | | { (JSJitGetterOp)createSampler }, |
6989 | | { prototypes::id::WebGL2RenderingContext }, |
6990 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
6991 | | JSJitInfo::Method, |
6992 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
6993 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
6994 | | false, /* isInfallible. False in setters. */ |
6995 | | false, /* isMovable. Not relevant for setters. */ |
6996 | | false, /* isEliminatable. Not relevant for setters. */ |
6997 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
6998 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
6999 | | false, /* isTypedMethod. Only relevant for methods. */ |
7000 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7001 | | }; |
7002 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7003 | | static_assert(0 < 1, "There is no slot for us"); |
7004 | | |
7005 | | MOZ_CAN_RUN_SCRIPT static bool |
7006 | | deleteSampler(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7007 | 0 | { |
7008 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteSampler", DOM, cx); |
7009 | 0 |
|
7010 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
7011 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteSampler"); |
7012 | 0 | } |
7013 | 0 | mozilla::WebGLSampler* arg0; |
7014 | 0 | if (args[0].isObject()) { |
7015 | 0 | { |
7016 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSampler, mozilla::WebGLSampler>(args[0], arg0); |
7017 | 0 | if (NS_FAILED(rv)) { |
7018 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteSampler", "WebGLSampler"); |
7019 | 0 | return false; |
7020 | 0 | } |
7021 | 0 | } |
7022 | 0 | } else if (args[0].isNullOrUndefined()) { |
7023 | 0 | arg0 = nullptr; |
7024 | 0 | } else { |
7025 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteSampler"); |
7026 | 0 | return false; |
7027 | 0 | } |
7028 | 0 | self->DeleteSampler(MOZ_KnownLive(Constify(arg0))); |
7029 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7030 | 0 | args.rval().setUndefined(); |
7031 | 0 | return true; |
7032 | 0 | } |
7033 | | |
7034 | | static const JSJitInfo deleteSampler_methodinfo = { |
7035 | | { (JSJitGetterOp)deleteSampler }, |
7036 | | { prototypes::id::WebGL2RenderingContext }, |
7037 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7038 | | JSJitInfo::Method, |
7039 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7040 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7041 | | false, /* isInfallible. False in setters. */ |
7042 | | false, /* isMovable. Not relevant for setters. */ |
7043 | | false, /* isEliminatable. Not relevant for setters. */ |
7044 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7045 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7046 | | false, /* isTypedMethod. Only relevant for methods. */ |
7047 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7048 | | }; |
7049 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7050 | | static_assert(0 < 1, "There is no slot for us"); |
7051 | | |
7052 | | MOZ_CAN_RUN_SCRIPT static bool |
7053 | | isSampler(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7054 | 0 | { |
7055 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isSampler", DOM, cx); |
7056 | 0 |
|
7057 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
7058 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isSampler"); |
7059 | 0 | } |
7060 | 0 | mozilla::WebGLSampler* arg0; |
7061 | 0 | if (args[0].isObject()) { |
7062 | 0 | { |
7063 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSampler, mozilla::WebGLSampler>(args[0], arg0); |
7064 | 0 | if (NS_FAILED(rv)) { |
7065 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isSampler", "WebGLSampler"); |
7066 | 0 | return false; |
7067 | 0 | } |
7068 | 0 | } |
7069 | 0 | } else if (args[0].isNullOrUndefined()) { |
7070 | 0 | arg0 = nullptr; |
7071 | 0 | } else { |
7072 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isSampler"); |
7073 | 0 | return false; |
7074 | 0 | } |
7075 | 0 | bool result(self->IsSampler(MOZ_KnownLive(Constify(arg0)))); |
7076 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7077 | 0 | args.rval().setBoolean(result); |
7078 | 0 | return true; |
7079 | 0 | } |
7080 | | |
7081 | | static const JSJitInfo isSampler_methodinfo = { |
7082 | | { (JSJitGetterOp)isSampler }, |
7083 | | { prototypes::id::WebGL2RenderingContext }, |
7084 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7085 | | JSJitInfo::Method, |
7086 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7087 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
7088 | | false, /* isInfallible. False in setters. */ |
7089 | | false, /* isMovable. Not relevant for setters. */ |
7090 | | false, /* isEliminatable. Not relevant for setters. */ |
7091 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7092 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7093 | | false, /* isTypedMethod. Only relevant for methods. */ |
7094 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7095 | | }; |
7096 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7097 | | static_assert(0 < 1, "There is no slot for us"); |
7098 | | |
7099 | | MOZ_CAN_RUN_SCRIPT static bool |
7100 | | bindSampler(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7101 | 0 | { |
7102 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindSampler", DOM, cx); |
7103 | 0 |
|
7104 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
7105 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindSampler"); |
7106 | 0 | } |
7107 | 0 | uint32_t arg0; |
7108 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
7109 | 0 | return false; |
7110 | 0 | } |
7111 | 0 | mozilla::WebGLSampler* arg1; |
7112 | 0 | if (args[1].isObject()) { |
7113 | 0 | { |
7114 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSampler, mozilla::WebGLSampler>(args[1], arg1); |
7115 | 0 | if (NS_FAILED(rv)) { |
7116 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.bindSampler", "WebGLSampler"); |
7117 | 0 | return false; |
7118 | 0 | } |
7119 | 0 | } |
7120 | 0 | } else if (args[1].isNullOrUndefined()) { |
7121 | 0 | arg1 = nullptr; |
7122 | 0 | } else { |
7123 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.bindSampler"); |
7124 | 0 | return false; |
7125 | 0 | } |
7126 | 0 | self->BindSampler(arg0, MOZ_KnownLive(Constify(arg1))); |
7127 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7128 | 0 | args.rval().setUndefined(); |
7129 | 0 | return true; |
7130 | 0 | } |
7131 | | |
7132 | | static const JSJitInfo bindSampler_methodinfo = { |
7133 | | { (JSJitGetterOp)bindSampler }, |
7134 | | { prototypes::id::WebGL2RenderingContext }, |
7135 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7136 | | JSJitInfo::Method, |
7137 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7138 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7139 | | false, /* isInfallible. False in setters. */ |
7140 | | false, /* isMovable. Not relevant for setters. */ |
7141 | | false, /* isEliminatable. Not relevant for setters. */ |
7142 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7143 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7144 | | false, /* isTypedMethod. Only relevant for methods. */ |
7145 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7146 | | }; |
7147 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7148 | | static_assert(0 < 1, "There is no slot for us"); |
7149 | | |
7150 | | MOZ_CAN_RUN_SCRIPT static bool |
7151 | | samplerParameteri(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7152 | 0 | { |
7153 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.samplerParameteri", DOM, cx); |
7154 | 0 |
|
7155 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
7156 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.samplerParameteri"); |
7157 | 0 | } |
7158 | 0 | NonNull<mozilla::WebGLSampler> arg0; |
7159 | 0 | if (args[0].isObject()) { |
7160 | 0 | { |
7161 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSampler, mozilla::WebGLSampler>(args[0], arg0); |
7162 | 0 | if (NS_FAILED(rv)) { |
7163 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.samplerParameteri", "WebGLSampler"); |
7164 | 0 | return false; |
7165 | 0 | } |
7166 | 0 | } |
7167 | 0 | } else { |
7168 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.samplerParameteri"); |
7169 | 0 | return false; |
7170 | 0 | } |
7171 | 0 | uint32_t arg1; |
7172 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7173 | 0 | return false; |
7174 | 0 | } |
7175 | 0 | int32_t arg2; |
7176 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
7177 | 0 | return false; |
7178 | 0 | } |
7179 | 0 | self->SamplerParameteri(MOZ_KnownLive(NonNullHelper(arg0)), arg1, arg2); |
7180 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7181 | 0 | args.rval().setUndefined(); |
7182 | 0 | return true; |
7183 | 0 | } |
7184 | | |
7185 | | static const JSJitInfo samplerParameteri_methodinfo = { |
7186 | | { (JSJitGetterOp)samplerParameteri }, |
7187 | | { prototypes::id::WebGL2RenderingContext }, |
7188 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7189 | | JSJitInfo::Method, |
7190 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7191 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7192 | | false, /* isInfallible. False in setters. */ |
7193 | | false, /* isMovable. Not relevant for setters. */ |
7194 | | false, /* isEliminatable. Not relevant for setters. */ |
7195 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7196 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7197 | | false, /* isTypedMethod. Only relevant for methods. */ |
7198 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7199 | | }; |
7200 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7201 | | static_assert(0 < 1, "There is no slot for us"); |
7202 | | |
7203 | | MOZ_CAN_RUN_SCRIPT static bool |
7204 | | samplerParameterf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7205 | 0 | { |
7206 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.samplerParameterf", DOM, cx); |
7207 | 0 |
|
7208 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
7209 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.samplerParameterf"); |
7210 | 0 | } |
7211 | 0 | NonNull<mozilla::WebGLSampler> arg0; |
7212 | 0 | if (args[0].isObject()) { |
7213 | 0 | { |
7214 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSampler, mozilla::WebGLSampler>(args[0], arg0); |
7215 | 0 | if (NS_FAILED(rv)) { |
7216 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.samplerParameterf", "WebGLSampler"); |
7217 | 0 | return false; |
7218 | 0 | } |
7219 | 0 | } |
7220 | 0 | } else { |
7221 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.samplerParameterf"); |
7222 | 0 | return false; |
7223 | 0 | } |
7224 | 0 | uint32_t arg1; |
7225 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7226 | 0 | return false; |
7227 | 0 | } |
7228 | 0 | float arg2; |
7229 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
7230 | 0 | return false; |
7231 | 0 | } |
7232 | 0 | self->SamplerParameterf(MOZ_KnownLive(NonNullHelper(arg0)), arg1, arg2); |
7233 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7234 | 0 | args.rval().setUndefined(); |
7235 | 0 | return true; |
7236 | 0 | } |
7237 | | |
7238 | | static const JSJitInfo samplerParameterf_methodinfo = { |
7239 | | { (JSJitGetterOp)samplerParameterf }, |
7240 | | { prototypes::id::WebGL2RenderingContext }, |
7241 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7242 | | JSJitInfo::Method, |
7243 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7244 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7245 | | false, /* isInfallible. False in setters. */ |
7246 | | false, /* isMovable. Not relevant for setters. */ |
7247 | | false, /* isEliminatable. Not relevant for setters. */ |
7248 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7249 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7250 | | false, /* isTypedMethod. Only relevant for methods. */ |
7251 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7252 | | }; |
7253 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7254 | | static_assert(0 < 1, "There is no slot for us"); |
7255 | | |
7256 | | MOZ_CAN_RUN_SCRIPT static bool |
7257 | | getSamplerParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7258 | 0 | { |
7259 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getSamplerParameter", DOM, cx); |
7260 | 0 |
|
7261 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
7262 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getSamplerParameter"); |
7263 | 0 | } |
7264 | 0 | NonNull<mozilla::WebGLSampler> arg0; |
7265 | 0 | if (args[0].isObject()) { |
7266 | 0 | { |
7267 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSampler, mozilla::WebGLSampler>(args[0], arg0); |
7268 | 0 | if (NS_FAILED(rv)) { |
7269 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getSamplerParameter", "WebGLSampler"); |
7270 | 0 | return false; |
7271 | 0 | } |
7272 | 0 | } |
7273 | 0 | } else { |
7274 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getSamplerParameter"); |
7275 | 0 | return false; |
7276 | 0 | } |
7277 | 0 | uint32_t arg1; |
7278 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7279 | 0 | return false; |
7280 | 0 | } |
7281 | 0 | JS::Rooted<JS::Value> result(cx); |
7282 | 0 | self->GetSamplerParameter(cx, MOZ_KnownLive(NonNullHelper(arg0)), arg1, &result); |
7283 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7284 | 0 | JS::ExposeValueToActiveJS(result); |
7285 | 0 | args.rval().set(result); |
7286 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
7287 | 0 | return false; |
7288 | 0 | } |
7289 | 0 | return true; |
7290 | 0 | } |
7291 | | |
7292 | | static const JSJitInfo getSamplerParameter_methodinfo = { |
7293 | | { (JSJitGetterOp)getSamplerParameter }, |
7294 | | { prototypes::id::WebGL2RenderingContext }, |
7295 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7296 | | JSJitInfo::Method, |
7297 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7298 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
7299 | | false, /* isInfallible. False in setters. */ |
7300 | | false, /* isMovable. Not relevant for setters. */ |
7301 | | false, /* isEliminatable. Not relevant for setters. */ |
7302 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7303 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7304 | | false, /* isTypedMethod. Only relevant for methods. */ |
7305 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7306 | | }; |
7307 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7308 | | static_assert(0 < 1, "There is no slot for us"); |
7309 | | |
7310 | | MOZ_CAN_RUN_SCRIPT static bool |
7311 | | fenceSync(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7312 | 0 | { |
7313 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.fenceSync", DOM, cx); |
7314 | 0 |
|
7315 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
7316 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.fenceSync"); |
7317 | 0 | } |
7318 | 0 | uint32_t arg0; |
7319 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
7320 | 0 | return false; |
7321 | 0 | } |
7322 | 0 | uint32_t arg1; |
7323 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7324 | 0 | return false; |
7325 | 0 | } |
7326 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLSync>(self->FenceSync(arg0, arg1))); |
7327 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7328 | 0 | if (!result) { |
7329 | 0 | args.rval().setNull(); |
7330 | 0 | return true; |
7331 | 0 | } |
7332 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
7333 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
7334 | 0 | return false; |
7335 | 0 | } |
7336 | 0 | return true; |
7337 | 0 | } |
7338 | | |
7339 | | static const JSJitInfo fenceSync_methodinfo = { |
7340 | | { (JSJitGetterOp)fenceSync }, |
7341 | | { prototypes::id::WebGL2RenderingContext }, |
7342 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7343 | | JSJitInfo::Method, |
7344 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7345 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
7346 | | false, /* isInfallible. False in setters. */ |
7347 | | false, /* isMovable. Not relevant for setters. */ |
7348 | | false, /* isEliminatable. Not relevant for setters. */ |
7349 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7350 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7351 | | false, /* isTypedMethod. Only relevant for methods. */ |
7352 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7353 | | }; |
7354 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7355 | | static_assert(0 < 1, "There is no slot for us"); |
7356 | | |
7357 | | MOZ_CAN_RUN_SCRIPT static bool |
7358 | | isSync(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7359 | 0 | { |
7360 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isSync", DOM, cx); |
7361 | 0 |
|
7362 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
7363 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isSync"); |
7364 | 0 | } |
7365 | 0 | mozilla::WebGLSync* arg0; |
7366 | 0 | if (args[0].isObject()) { |
7367 | 0 | { |
7368 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSync, mozilla::WebGLSync>(args[0], arg0); |
7369 | 0 | if (NS_FAILED(rv)) { |
7370 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isSync", "WebGLSync"); |
7371 | 0 | return false; |
7372 | 0 | } |
7373 | 0 | } |
7374 | 0 | } else if (args[0].isNullOrUndefined()) { |
7375 | 0 | arg0 = nullptr; |
7376 | 0 | } else { |
7377 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isSync"); |
7378 | 0 | return false; |
7379 | 0 | } |
7380 | 0 | bool result(self->IsSync(MOZ_KnownLive(Constify(arg0)))); |
7381 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7382 | 0 | args.rval().setBoolean(result); |
7383 | 0 | return true; |
7384 | 0 | } |
7385 | | |
7386 | | static const JSJitInfo isSync_methodinfo = { |
7387 | | { (JSJitGetterOp)isSync }, |
7388 | | { prototypes::id::WebGL2RenderingContext }, |
7389 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7390 | | JSJitInfo::Method, |
7391 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7392 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
7393 | | false, /* isInfallible. False in setters. */ |
7394 | | false, /* isMovable. Not relevant for setters. */ |
7395 | | false, /* isEliminatable. Not relevant for setters. */ |
7396 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7397 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7398 | | false, /* isTypedMethod. Only relevant for methods. */ |
7399 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7400 | | }; |
7401 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7402 | | static_assert(0 < 1, "There is no slot for us"); |
7403 | | |
7404 | | MOZ_CAN_RUN_SCRIPT static bool |
7405 | | deleteSync(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7406 | 0 | { |
7407 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteSync", DOM, cx); |
7408 | 0 |
|
7409 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
7410 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteSync"); |
7411 | 0 | } |
7412 | 0 | mozilla::WebGLSync* arg0; |
7413 | 0 | if (args[0].isObject()) { |
7414 | 0 | { |
7415 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSync, mozilla::WebGLSync>(args[0], arg0); |
7416 | 0 | if (NS_FAILED(rv)) { |
7417 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteSync", "WebGLSync"); |
7418 | 0 | return false; |
7419 | 0 | } |
7420 | 0 | } |
7421 | 0 | } else if (args[0].isNullOrUndefined()) { |
7422 | 0 | arg0 = nullptr; |
7423 | 0 | } else { |
7424 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteSync"); |
7425 | 0 | return false; |
7426 | 0 | } |
7427 | 0 | self->DeleteSync(MOZ_KnownLive(Constify(arg0))); |
7428 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7429 | 0 | args.rval().setUndefined(); |
7430 | 0 | return true; |
7431 | 0 | } |
7432 | | |
7433 | | static const JSJitInfo deleteSync_methodinfo = { |
7434 | | { (JSJitGetterOp)deleteSync }, |
7435 | | { prototypes::id::WebGL2RenderingContext }, |
7436 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7437 | | JSJitInfo::Method, |
7438 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7439 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7440 | | false, /* isInfallible. False in setters. */ |
7441 | | false, /* isMovable. Not relevant for setters. */ |
7442 | | false, /* isEliminatable. Not relevant for setters. */ |
7443 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7444 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7445 | | false, /* isTypedMethod. Only relevant for methods. */ |
7446 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7447 | | }; |
7448 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7449 | | static_assert(0 < 1, "There is no slot for us"); |
7450 | | |
7451 | | MOZ_CAN_RUN_SCRIPT static bool |
7452 | | clientWaitSync(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7453 | 0 | { |
7454 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clientWaitSync", DOM, cx); |
7455 | 0 |
|
7456 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
7457 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clientWaitSync"); |
7458 | 0 | } |
7459 | 0 | NonNull<mozilla::WebGLSync> arg0; |
7460 | 0 | if (args[0].isObject()) { |
7461 | 0 | { |
7462 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSync, mozilla::WebGLSync>(args[0], arg0); |
7463 | 0 | if (NS_FAILED(rv)) { |
7464 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.clientWaitSync", "WebGLSync"); |
7465 | 0 | return false; |
7466 | 0 | } |
7467 | 0 | } |
7468 | 0 | } else { |
7469 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.clientWaitSync"); |
7470 | 0 | return false; |
7471 | 0 | } |
7472 | 0 | uint32_t arg1; |
7473 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7474 | 0 | return false; |
7475 | 0 | } |
7476 | 0 | uint64_t arg2; |
7477 | 0 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[2], &arg2)) { |
7478 | 0 | return false; |
7479 | 0 | } |
7480 | 0 | uint32_t result(self->ClientWaitSync(MOZ_KnownLive(NonNullHelper(arg0)), arg1, arg2)); |
7481 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7482 | 0 | args.rval().setNumber(result); |
7483 | 0 | return true; |
7484 | 0 | } |
7485 | | |
7486 | | static const JSJitInfo clientWaitSync_methodinfo = { |
7487 | | { (JSJitGetterOp)clientWaitSync }, |
7488 | | { prototypes::id::WebGL2RenderingContext }, |
7489 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7490 | | JSJitInfo::Method, |
7491 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7492 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
7493 | | false, /* isInfallible. False in setters. */ |
7494 | | false, /* isMovable. Not relevant for setters. */ |
7495 | | false, /* isEliminatable. Not relevant for setters. */ |
7496 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7497 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7498 | | false, /* isTypedMethod. Only relevant for methods. */ |
7499 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7500 | | }; |
7501 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7502 | | static_assert(0 < 1, "There is no slot for us"); |
7503 | | |
7504 | | MOZ_CAN_RUN_SCRIPT static bool |
7505 | | waitSync(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7506 | 0 | { |
7507 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.waitSync", DOM, cx); |
7508 | 0 |
|
7509 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
7510 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.waitSync"); |
7511 | 0 | } |
7512 | 0 | NonNull<mozilla::WebGLSync> arg0; |
7513 | 0 | if (args[0].isObject()) { |
7514 | 0 | { |
7515 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSync, mozilla::WebGLSync>(args[0], arg0); |
7516 | 0 | if (NS_FAILED(rv)) { |
7517 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.waitSync", "WebGLSync"); |
7518 | 0 | return false; |
7519 | 0 | } |
7520 | 0 | } |
7521 | 0 | } else { |
7522 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.waitSync"); |
7523 | 0 | return false; |
7524 | 0 | } |
7525 | 0 | uint32_t arg1; |
7526 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7527 | 0 | return false; |
7528 | 0 | } |
7529 | 0 | int64_t arg2; |
7530 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[2], &arg2)) { |
7531 | 0 | return false; |
7532 | 0 | } |
7533 | 0 | self->WaitSync(MOZ_KnownLive(NonNullHelper(arg0)), arg1, arg2); |
7534 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7535 | 0 | args.rval().setUndefined(); |
7536 | 0 | return true; |
7537 | 0 | } |
7538 | | |
7539 | | static const JSJitInfo waitSync_methodinfo = { |
7540 | | { (JSJitGetterOp)waitSync }, |
7541 | | { prototypes::id::WebGL2RenderingContext }, |
7542 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7543 | | JSJitInfo::Method, |
7544 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7545 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7546 | | false, /* isInfallible. False in setters. */ |
7547 | | false, /* isMovable. Not relevant for setters. */ |
7548 | | false, /* isEliminatable. Not relevant for setters. */ |
7549 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7550 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7551 | | false, /* isTypedMethod. Only relevant for methods. */ |
7552 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7553 | | }; |
7554 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7555 | | static_assert(0 < 1, "There is no slot for us"); |
7556 | | |
7557 | | MOZ_CAN_RUN_SCRIPT static bool |
7558 | | getSyncParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7559 | 0 | { |
7560 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getSyncParameter", DOM, cx); |
7561 | 0 |
|
7562 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
7563 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getSyncParameter"); |
7564 | 0 | } |
7565 | 0 | NonNull<mozilla::WebGLSync> arg0; |
7566 | 0 | if (args[0].isObject()) { |
7567 | 0 | { |
7568 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLSync, mozilla::WebGLSync>(args[0], arg0); |
7569 | 0 | if (NS_FAILED(rv)) { |
7570 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getSyncParameter", "WebGLSync"); |
7571 | 0 | return false; |
7572 | 0 | } |
7573 | 0 | } |
7574 | 0 | } else { |
7575 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getSyncParameter"); |
7576 | 0 | return false; |
7577 | 0 | } |
7578 | 0 | uint32_t arg1; |
7579 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7580 | 0 | return false; |
7581 | 0 | } |
7582 | 0 | JS::Rooted<JS::Value> result(cx); |
7583 | 0 | self->GetSyncParameter(cx, MOZ_KnownLive(NonNullHelper(arg0)), arg1, &result); |
7584 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7585 | 0 | JS::ExposeValueToActiveJS(result); |
7586 | 0 | args.rval().set(result); |
7587 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
7588 | 0 | return false; |
7589 | 0 | } |
7590 | 0 | return true; |
7591 | 0 | } |
7592 | | |
7593 | | static const JSJitInfo getSyncParameter_methodinfo = { |
7594 | | { (JSJitGetterOp)getSyncParameter }, |
7595 | | { prototypes::id::WebGL2RenderingContext }, |
7596 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7597 | | JSJitInfo::Method, |
7598 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7599 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
7600 | | false, /* isInfallible. False in setters. */ |
7601 | | false, /* isMovable. Not relevant for setters. */ |
7602 | | false, /* isEliminatable. Not relevant for setters. */ |
7603 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7604 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7605 | | false, /* isTypedMethod. Only relevant for methods. */ |
7606 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7607 | | }; |
7608 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7609 | | static_assert(0 < 1, "There is no slot for us"); |
7610 | | |
7611 | | MOZ_CAN_RUN_SCRIPT static bool |
7612 | | createTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7613 | 0 | { |
7614 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createTransformFeedback", DOM, cx); |
7615 | 0 |
|
7616 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLTransformFeedback>(self->CreateTransformFeedback())); |
7617 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7618 | 0 | if (!result) { |
7619 | 0 | args.rval().setNull(); |
7620 | 0 | return true; |
7621 | 0 | } |
7622 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
7623 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
7624 | 0 | return false; |
7625 | 0 | } |
7626 | 0 | return true; |
7627 | 0 | } |
7628 | | |
7629 | | static const JSJitInfo createTransformFeedback_methodinfo = { |
7630 | | { (JSJitGetterOp)createTransformFeedback }, |
7631 | | { prototypes::id::WebGL2RenderingContext }, |
7632 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7633 | | JSJitInfo::Method, |
7634 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7635 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
7636 | | false, /* isInfallible. False in setters. */ |
7637 | | false, /* isMovable. Not relevant for setters. */ |
7638 | | false, /* isEliminatable. Not relevant for setters. */ |
7639 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7640 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7641 | | false, /* isTypedMethod. Only relevant for methods. */ |
7642 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7643 | | }; |
7644 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7645 | | static_assert(0 < 1, "There is no slot for us"); |
7646 | | |
7647 | | MOZ_CAN_RUN_SCRIPT static bool |
7648 | | deleteTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7649 | 0 | { |
7650 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteTransformFeedback", DOM, cx); |
7651 | 0 |
|
7652 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
7653 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteTransformFeedback"); |
7654 | 0 | } |
7655 | 0 | mozilla::WebGLTransformFeedback* arg0; |
7656 | 0 | if (args[0].isObject()) { |
7657 | 0 | { |
7658 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTransformFeedback, mozilla::WebGLTransformFeedback>(args[0], arg0); |
7659 | 0 | if (NS_FAILED(rv)) { |
7660 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteTransformFeedback", "WebGLTransformFeedback"); |
7661 | 0 | return false; |
7662 | 0 | } |
7663 | 0 | } |
7664 | 0 | } else if (args[0].isNullOrUndefined()) { |
7665 | 0 | arg0 = nullptr; |
7666 | 0 | } else { |
7667 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteTransformFeedback"); |
7668 | 0 | return false; |
7669 | 0 | } |
7670 | 0 | self->DeleteTransformFeedback(MOZ_KnownLive(Constify(arg0))); |
7671 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7672 | 0 | args.rval().setUndefined(); |
7673 | 0 | return true; |
7674 | 0 | } |
7675 | | |
7676 | | static const JSJitInfo deleteTransformFeedback_methodinfo = { |
7677 | | { (JSJitGetterOp)deleteTransformFeedback }, |
7678 | | { prototypes::id::WebGL2RenderingContext }, |
7679 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7680 | | JSJitInfo::Method, |
7681 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7682 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7683 | | false, /* isInfallible. False in setters. */ |
7684 | | false, /* isMovable. Not relevant for setters. */ |
7685 | | false, /* isEliminatable. Not relevant for setters. */ |
7686 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7687 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7688 | | false, /* isTypedMethod. Only relevant for methods. */ |
7689 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7690 | | }; |
7691 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7692 | | static_assert(0 < 1, "There is no slot for us"); |
7693 | | |
7694 | | MOZ_CAN_RUN_SCRIPT static bool |
7695 | | isTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7696 | 0 | { |
7697 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isTransformFeedback", DOM, cx); |
7698 | 0 |
|
7699 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
7700 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isTransformFeedback"); |
7701 | 0 | } |
7702 | 0 | mozilla::WebGLTransformFeedback* arg0; |
7703 | 0 | if (args[0].isObject()) { |
7704 | 0 | { |
7705 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTransformFeedback, mozilla::WebGLTransformFeedback>(args[0], arg0); |
7706 | 0 | if (NS_FAILED(rv)) { |
7707 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isTransformFeedback", "WebGLTransformFeedback"); |
7708 | 0 | return false; |
7709 | 0 | } |
7710 | 0 | } |
7711 | 0 | } else if (args[0].isNullOrUndefined()) { |
7712 | 0 | arg0 = nullptr; |
7713 | 0 | } else { |
7714 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isTransformFeedback"); |
7715 | 0 | return false; |
7716 | 0 | } |
7717 | 0 | bool result(self->IsTransformFeedback(MOZ_KnownLive(Constify(arg0)))); |
7718 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7719 | 0 | args.rval().setBoolean(result); |
7720 | 0 | return true; |
7721 | 0 | } |
7722 | | |
7723 | | static const JSJitInfo isTransformFeedback_methodinfo = { |
7724 | | { (JSJitGetterOp)isTransformFeedback }, |
7725 | | { prototypes::id::WebGL2RenderingContext }, |
7726 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7727 | | JSJitInfo::Method, |
7728 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7729 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
7730 | | false, /* isInfallible. False in setters. */ |
7731 | | false, /* isMovable. Not relevant for setters. */ |
7732 | | false, /* isEliminatable. Not relevant for setters. */ |
7733 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7734 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7735 | | false, /* isTypedMethod. Only relevant for methods. */ |
7736 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7737 | | }; |
7738 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7739 | | static_assert(0 < 1, "There is no slot for us"); |
7740 | | |
7741 | | MOZ_CAN_RUN_SCRIPT static bool |
7742 | | bindTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7743 | 0 | { |
7744 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindTransformFeedback", DOM, cx); |
7745 | 0 |
|
7746 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
7747 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindTransformFeedback"); |
7748 | 0 | } |
7749 | 0 | uint32_t arg0; |
7750 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
7751 | 0 | return false; |
7752 | 0 | } |
7753 | 0 | mozilla::WebGLTransformFeedback* arg1; |
7754 | 0 | if (args[1].isObject()) { |
7755 | 0 | { |
7756 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTransformFeedback, mozilla::WebGLTransformFeedback>(args[1], arg1); |
7757 | 0 | if (NS_FAILED(rv)) { |
7758 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.bindTransformFeedback", "WebGLTransformFeedback"); |
7759 | 0 | return false; |
7760 | 0 | } |
7761 | 0 | } |
7762 | 0 | } else if (args[1].isNullOrUndefined()) { |
7763 | 0 | arg1 = nullptr; |
7764 | 0 | } else { |
7765 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.bindTransformFeedback"); |
7766 | 0 | return false; |
7767 | 0 | } |
7768 | 0 | self->BindTransformFeedback(arg0, MOZ_KnownLive(Constify(arg1))); |
7769 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7770 | 0 | args.rval().setUndefined(); |
7771 | 0 | return true; |
7772 | 0 | } |
7773 | | |
7774 | | static const JSJitInfo bindTransformFeedback_methodinfo = { |
7775 | | { (JSJitGetterOp)bindTransformFeedback }, |
7776 | | { prototypes::id::WebGL2RenderingContext }, |
7777 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7778 | | JSJitInfo::Method, |
7779 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7780 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7781 | | false, /* isInfallible. False in setters. */ |
7782 | | false, /* isMovable. Not relevant for setters. */ |
7783 | | false, /* isEliminatable. Not relevant for setters. */ |
7784 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7785 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7786 | | false, /* isTypedMethod. Only relevant for methods. */ |
7787 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7788 | | }; |
7789 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7790 | | static_assert(0 < 1, "There is no slot for us"); |
7791 | | |
7792 | | MOZ_CAN_RUN_SCRIPT static bool |
7793 | | beginTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7794 | 0 | { |
7795 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.beginTransformFeedback", DOM, cx); |
7796 | 0 |
|
7797 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
7798 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.beginTransformFeedback"); |
7799 | 0 | } |
7800 | 0 | uint32_t arg0; |
7801 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
7802 | 0 | return false; |
7803 | 0 | } |
7804 | 0 | self->BeginTransformFeedback(arg0); |
7805 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7806 | 0 | args.rval().setUndefined(); |
7807 | 0 | return true; |
7808 | 0 | } |
7809 | | |
7810 | | static const JSJitInfo beginTransformFeedback_methodinfo = { |
7811 | | { (JSJitGetterOp)beginTransformFeedback }, |
7812 | | { prototypes::id::WebGL2RenderingContext }, |
7813 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7814 | | JSJitInfo::Method, |
7815 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7816 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7817 | | false, /* isInfallible. False in setters. */ |
7818 | | false, /* isMovable. Not relevant for setters. */ |
7819 | | false, /* isEliminatable. Not relevant for setters. */ |
7820 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7821 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7822 | | false, /* isTypedMethod. Only relevant for methods. */ |
7823 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7824 | | }; |
7825 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7826 | | static_assert(0 < 1, "There is no slot for us"); |
7827 | | |
7828 | | MOZ_CAN_RUN_SCRIPT static bool |
7829 | | endTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7830 | 0 | { |
7831 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.endTransformFeedback", DOM, cx); |
7832 | 0 |
|
7833 | 0 | self->EndTransformFeedback(); |
7834 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7835 | 0 | args.rval().setUndefined(); |
7836 | 0 | return true; |
7837 | 0 | } |
7838 | | |
7839 | | static const JSJitInfo endTransformFeedback_methodinfo = { |
7840 | | { (JSJitGetterOp)endTransformFeedback }, |
7841 | | { prototypes::id::WebGL2RenderingContext }, |
7842 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7843 | | JSJitInfo::Method, |
7844 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7845 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7846 | | true, /* isInfallible. False in setters. */ |
7847 | | false, /* isMovable. Not relevant for setters. */ |
7848 | | false, /* isEliminatable. Not relevant for setters. */ |
7849 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7850 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7851 | | false, /* isTypedMethod. Only relevant for methods. */ |
7852 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7853 | | }; |
7854 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7855 | | static_assert(0 < 1, "There is no slot for us"); |
7856 | | |
7857 | | MOZ_CAN_RUN_SCRIPT static bool |
7858 | | transformFeedbackVaryings(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7859 | 0 | { |
7860 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.transformFeedbackVaryings", DOM, cx); |
7861 | 0 |
|
7862 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
7863 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.transformFeedbackVaryings"); |
7864 | 0 | } |
7865 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
7866 | 0 | if (args[0].isObject()) { |
7867 | 0 | { |
7868 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
7869 | 0 | if (NS_FAILED(rv)) { |
7870 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.transformFeedbackVaryings", "WebGLProgram"); |
7871 | 0 | return false; |
7872 | 0 | } |
7873 | 0 | } |
7874 | 0 | } else { |
7875 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.transformFeedbackVaryings"); |
7876 | 0 | return false; |
7877 | 0 | } |
7878 | 0 | binding_detail::AutoSequence<nsString> arg1; |
7879 | 0 | if (args[1].isObject()) { |
7880 | 0 | JS::ForOfIterator iter(cx); |
7881 | 0 | if (!iter.init(args[1], JS::ForOfIterator::AllowNonIterable)) { |
7882 | 0 | return false; |
7883 | 0 | } |
7884 | 0 | if (!iter.valueIsIterable()) { |
7885 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.transformFeedbackVaryings"); |
7886 | 0 | return false; |
7887 | 0 | } |
7888 | 0 | binding_detail::AutoSequence<nsString> &arr = arg1; |
7889 | 0 | JS::Rooted<JS::Value> temp(cx); |
7890 | 0 | while (true) { |
7891 | 0 | bool done; |
7892 | 0 | if (!iter.next(&temp, &done)) { |
7893 | 0 | return false; |
7894 | 0 | } |
7895 | 0 | if (done) { |
7896 | 0 | break; |
7897 | 0 | } |
7898 | 0 | nsString* slotPtr = arr.AppendElement(mozilla::fallible); |
7899 | 0 | if (!slotPtr) { |
7900 | 0 | JS_ReportOutOfMemory(cx); |
7901 | 0 | return false; |
7902 | 0 | } |
7903 | 0 | nsString& slot = *slotPtr; |
7904 | 0 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { |
7905 | 0 | return false; |
7906 | 0 | } |
7907 | 0 | } |
7908 | 0 | } else { |
7909 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.transformFeedbackVaryings"); |
7910 | 0 | return false; |
7911 | 0 | } |
7912 | 0 | uint32_t arg2; |
7913 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
7914 | 0 | return false; |
7915 | 0 | } |
7916 | 0 | self->TransformFeedbackVaryings(MOZ_KnownLive(NonNullHelper(arg0)), Constify(arg1), arg2); |
7917 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7918 | 0 | args.rval().setUndefined(); |
7919 | 0 | return true; |
7920 | 0 | } |
7921 | | |
7922 | | static const JSJitInfo transformFeedbackVaryings_methodinfo = { |
7923 | | { (JSJitGetterOp)transformFeedbackVaryings }, |
7924 | | { prototypes::id::WebGL2RenderingContext }, |
7925 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7926 | | JSJitInfo::Method, |
7927 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7928 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
7929 | | false, /* isInfallible. False in setters. */ |
7930 | | false, /* isMovable. Not relevant for setters. */ |
7931 | | false, /* isEliminatable. Not relevant for setters. */ |
7932 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7933 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7934 | | false, /* isTypedMethod. Only relevant for methods. */ |
7935 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7936 | | }; |
7937 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7938 | | static_assert(0 < 1, "There is no slot for us"); |
7939 | | |
7940 | | MOZ_CAN_RUN_SCRIPT static bool |
7941 | | getTransformFeedbackVarying(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
7942 | 0 | { |
7943 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getTransformFeedbackVarying", DOM, cx); |
7944 | 0 |
|
7945 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
7946 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getTransformFeedbackVarying"); |
7947 | 0 | } |
7948 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
7949 | 0 | if (args[0].isObject()) { |
7950 | 0 | { |
7951 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
7952 | 0 | if (NS_FAILED(rv)) { |
7953 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getTransformFeedbackVarying", "WebGLProgram"); |
7954 | 0 | return false; |
7955 | 0 | } |
7956 | 0 | } |
7957 | 0 | } else { |
7958 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getTransformFeedbackVarying"); |
7959 | 0 | return false; |
7960 | 0 | } |
7961 | 0 | uint32_t arg1; |
7962 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
7963 | 0 | return false; |
7964 | 0 | } |
7965 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLActiveInfo>(self->GetTransformFeedbackVarying(MOZ_KnownLive(NonNullHelper(arg0)), arg1))); |
7966 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
7967 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
7968 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
7969 | 0 | if (!result) { |
7970 | 0 | args.rval().setNull(); |
7971 | 0 | return true; |
7972 | 0 | } |
7973 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
7974 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
7975 | 0 | return false; |
7976 | 0 | } |
7977 | 0 | return true; |
7978 | 0 | } |
7979 | | |
7980 | | static const JSJitInfo getTransformFeedbackVarying_methodinfo = { |
7981 | | { (JSJitGetterOp)getTransformFeedbackVarying }, |
7982 | | { prototypes::id::WebGL2RenderingContext }, |
7983 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
7984 | | JSJitInfo::Method, |
7985 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
7986 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
7987 | | false, /* isInfallible. False in setters. */ |
7988 | | false, /* isMovable. Not relevant for setters. */ |
7989 | | false, /* isEliminatable. Not relevant for setters. */ |
7990 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
7991 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
7992 | | false, /* isTypedMethod. Only relevant for methods. */ |
7993 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
7994 | | }; |
7995 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
7996 | | static_assert(0 < 1, "There is no slot for us"); |
7997 | | |
7998 | | MOZ_CAN_RUN_SCRIPT static bool |
7999 | | pauseTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8000 | 0 | { |
8001 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.pauseTransformFeedback", DOM, cx); |
8002 | 0 |
|
8003 | 0 | self->PauseTransformFeedback(); |
8004 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8005 | 0 | args.rval().setUndefined(); |
8006 | 0 | return true; |
8007 | 0 | } |
8008 | | |
8009 | | static const JSJitInfo pauseTransformFeedback_methodinfo = { |
8010 | | { (JSJitGetterOp)pauseTransformFeedback }, |
8011 | | { prototypes::id::WebGL2RenderingContext }, |
8012 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8013 | | JSJitInfo::Method, |
8014 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8015 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
8016 | | true, /* isInfallible. False in setters. */ |
8017 | | false, /* isMovable. Not relevant for setters. */ |
8018 | | false, /* isEliminatable. Not relevant for setters. */ |
8019 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8020 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8021 | | false, /* isTypedMethod. Only relevant for methods. */ |
8022 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8023 | | }; |
8024 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8025 | | static_assert(0 < 1, "There is no slot for us"); |
8026 | | |
8027 | | MOZ_CAN_RUN_SCRIPT static bool |
8028 | | resumeTransformFeedback(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8029 | 0 | { |
8030 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.resumeTransformFeedback", DOM, cx); |
8031 | 0 |
|
8032 | 0 | self->ResumeTransformFeedback(); |
8033 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8034 | 0 | args.rval().setUndefined(); |
8035 | 0 | return true; |
8036 | 0 | } |
8037 | | |
8038 | | static const JSJitInfo resumeTransformFeedback_methodinfo = { |
8039 | | { (JSJitGetterOp)resumeTransformFeedback }, |
8040 | | { prototypes::id::WebGL2RenderingContext }, |
8041 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8042 | | JSJitInfo::Method, |
8043 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8044 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
8045 | | true, /* isInfallible. False in setters. */ |
8046 | | false, /* isMovable. Not relevant for setters. */ |
8047 | | false, /* isEliminatable. Not relevant for setters. */ |
8048 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8049 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8050 | | false, /* isTypedMethod. Only relevant for methods. */ |
8051 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8052 | | }; |
8053 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8054 | | static_assert(0 < 1, "There is no slot for us"); |
8055 | | |
8056 | | MOZ_CAN_RUN_SCRIPT static bool |
8057 | | bindBufferBase(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8058 | 0 | { |
8059 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindBufferBase", DOM, cx); |
8060 | 0 |
|
8061 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
8062 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindBufferBase"); |
8063 | 0 | } |
8064 | 0 | uint32_t arg0; |
8065 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
8066 | 0 | return false; |
8067 | 0 | } |
8068 | 0 | uint32_t arg1; |
8069 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
8070 | 0 | return false; |
8071 | 0 | } |
8072 | 0 | mozilla::WebGLBuffer* arg2; |
8073 | 0 | if (args[2].isObject()) { |
8074 | 0 | { |
8075 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLBuffer, mozilla::WebGLBuffer>(args[2], arg2); |
8076 | 0 | if (NS_FAILED(rv)) { |
8077 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 3 of WebGL2RenderingContext.bindBufferBase", "WebGLBuffer"); |
8078 | 0 | return false; |
8079 | 0 | } |
8080 | 0 | } |
8081 | 0 | } else if (args[2].isNullOrUndefined()) { |
8082 | 0 | arg2 = nullptr; |
8083 | 0 | } else { |
8084 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of WebGL2RenderingContext.bindBufferBase"); |
8085 | 0 | return false; |
8086 | 0 | } |
8087 | 0 | self->BindBufferBase(arg0, arg1, MOZ_KnownLive(Constify(arg2))); |
8088 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8089 | 0 | args.rval().setUndefined(); |
8090 | 0 | return true; |
8091 | 0 | } |
8092 | | |
8093 | | static const JSJitInfo bindBufferBase_methodinfo = { |
8094 | | { (JSJitGetterOp)bindBufferBase }, |
8095 | | { prototypes::id::WebGL2RenderingContext }, |
8096 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8097 | | JSJitInfo::Method, |
8098 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8099 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
8100 | | false, /* isInfallible. False in setters. */ |
8101 | | false, /* isMovable. Not relevant for setters. */ |
8102 | | false, /* isEliminatable. Not relevant for setters. */ |
8103 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8104 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8105 | | false, /* isTypedMethod. Only relevant for methods. */ |
8106 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8107 | | }; |
8108 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8109 | | static_assert(0 < 1, "There is no slot for us"); |
8110 | | |
8111 | | MOZ_CAN_RUN_SCRIPT static bool |
8112 | | bindBufferRange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8113 | 0 | { |
8114 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindBufferRange", DOM, cx); |
8115 | 0 |
|
8116 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
8117 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindBufferRange"); |
8118 | 0 | } |
8119 | 0 | uint32_t arg0; |
8120 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
8121 | 0 | return false; |
8122 | 0 | } |
8123 | 0 | uint32_t arg1; |
8124 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
8125 | 0 | return false; |
8126 | 0 | } |
8127 | 0 | mozilla::WebGLBuffer* arg2; |
8128 | 0 | if (args[2].isObject()) { |
8129 | 0 | { |
8130 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLBuffer, mozilla::WebGLBuffer>(args[2], arg2); |
8131 | 0 | if (NS_FAILED(rv)) { |
8132 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 3 of WebGL2RenderingContext.bindBufferRange", "WebGLBuffer"); |
8133 | 0 | return false; |
8134 | 0 | } |
8135 | 0 | } |
8136 | 0 | } else if (args[2].isNullOrUndefined()) { |
8137 | 0 | arg2 = nullptr; |
8138 | 0 | } else { |
8139 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of WebGL2RenderingContext.bindBufferRange"); |
8140 | 0 | return false; |
8141 | 0 | } |
8142 | 0 | int64_t arg3; |
8143 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[3], &arg3)) { |
8144 | 0 | return false; |
8145 | 0 | } |
8146 | 0 | int64_t arg4; |
8147 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[4], &arg4)) { |
8148 | 0 | return false; |
8149 | 0 | } |
8150 | 0 | self->BindBufferRange(arg0, arg1, MOZ_KnownLive(Constify(arg2)), arg3, arg4); |
8151 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8152 | 0 | args.rval().setUndefined(); |
8153 | 0 | return true; |
8154 | 0 | } |
8155 | | |
8156 | | static const JSJitInfo bindBufferRange_methodinfo = { |
8157 | | { (JSJitGetterOp)bindBufferRange }, |
8158 | | { prototypes::id::WebGL2RenderingContext }, |
8159 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8160 | | JSJitInfo::Method, |
8161 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8162 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
8163 | | false, /* isInfallible. False in setters. */ |
8164 | | false, /* isMovable. Not relevant for setters. */ |
8165 | | false, /* isEliminatable. Not relevant for setters. */ |
8166 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8167 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8168 | | false, /* isTypedMethod. Only relevant for methods. */ |
8169 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8170 | | }; |
8171 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8172 | | static_assert(0 < 1, "There is no slot for us"); |
8173 | | |
8174 | | MOZ_CAN_RUN_SCRIPT static bool |
8175 | | getIndexedParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8176 | 0 | { |
8177 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getIndexedParameter", DOM, cx); |
8178 | 0 |
|
8179 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
8180 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getIndexedParameter"); |
8181 | 0 | } |
8182 | 0 | uint32_t arg0; |
8183 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
8184 | 0 | return false; |
8185 | 0 | } |
8186 | 0 | uint32_t arg1; |
8187 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
8188 | 0 | return false; |
8189 | 0 | } |
8190 | 0 | FastErrorResult rv; |
8191 | 0 | JS::Rooted<JS::Value> result(cx); |
8192 | 0 | self->GetIndexedParameter(cx, arg0, arg1, &result, rv); |
8193 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
8194 | 0 | return false; |
8195 | 0 | } |
8196 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8197 | 0 | JS::ExposeValueToActiveJS(result); |
8198 | 0 | args.rval().set(result); |
8199 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
8200 | 0 | return false; |
8201 | 0 | } |
8202 | 0 | return true; |
8203 | 0 | } |
8204 | | |
8205 | | static const JSJitInfo getIndexedParameter_methodinfo = { |
8206 | | { (JSJitGetterOp)getIndexedParameter }, |
8207 | | { prototypes::id::WebGL2RenderingContext }, |
8208 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8209 | | JSJitInfo::Method, |
8210 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8211 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8212 | | false, /* isInfallible. False in setters. */ |
8213 | | false, /* isMovable. Not relevant for setters. */ |
8214 | | false, /* isEliminatable. Not relevant for setters. */ |
8215 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8216 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8217 | | false, /* isTypedMethod. Only relevant for methods. */ |
8218 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8219 | | }; |
8220 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8221 | | static_assert(0 < 1, "There is no slot for us"); |
8222 | | |
8223 | | MOZ_CAN_RUN_SCRIPT static bool |
8224 | | getUniformIndices(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8225 | 0 | { |
8226 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getUniformIndices", DOM, cx); |
8227 | 0 |
|
8228 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
8229 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getUniformIndices"); |
8230 | 0 | } |
8231 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
8232 | 0 | if (args[0].isObject()) { |
8233 | 0 | { |
8234 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
8235 | 0 | if (NS_FAILED(rv)) { |
8236 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getUniformIndices", "WebGLProgram"); |
8237 | 0 | return false; |
8238 | 0 | } |
8239 | 0 | } |
8240 | 0 | } else { |
8241 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getUniformIndices"); |
8242 | 0 | return false; |
8243 | 0 | } |
8244 | 0 | binding_detail::AutoSequence<nsString> arg1; |
8245 | 0 | if (args[1].isObject()) { |
8246 | 0 | JS::ForOfIterator iter(cx); |
8247 | 0 | if (!iter.init(args[1], JS::ForOfIterator::AllowNonIterable)) { |
8248 | 0 | return false; |
8249 | 0 | } |
8250 | 0 | if (!iter.valueIsIterable()) { |
8251 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.getUniformIndices"); |
8252 | 0 | return false; |
8253 | 0 | } |
8254 | 0 | binding_detail::AutoSequence<nsString> &arr = arg1; |
8255 | 0 | JS::Rooted<JS::Value> temp(cx); |
8256 | 0 | while (true) { |
8257 | 0 | bool done; |
8258 | 0 | if (!iter.next(&temp, &done)) { |
8259 | 0 | return false; |
8260 | 0 | } |
8261 | 0 | if (done) { |
8262 | 0 | break; |
8263 | 0 | } |
8264 | 0 | nsString* slotPtr = arr.AppendElement(mozilla::fallible); |
8265 | 0 | if (!slotPtr) { |
8266 | 0 | JS_ReportOutOfMemory(cx); |
8267 | 0 | return false; |
8268 | 0 | } |
8269 | 0 | nsString& slot = *slotPtr; |
8270 | 0 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { |
8271 | 0 | return false; |
8272 | 0 | } |
8273 | 0 | } |
8274 | 0 | } else { |
8275 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.getUniformIndices"); |
8276 | 0 | return false; |
8277 | 0 | } |
8278 | 0 | Nullable<nsTArray<uint32_t>> result; |
8279 | 0 | self->GetUniformIndices(MOZ_KnownLive(NonNullHelper(arg0)), Constify(arg1), result); |
8280 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8281 | 0 |
|
8282 | 0 | if (result.IsNull()) { |
8283 | 0 | args.rval().setNull(); |
8284 | 0 | return true; |
8285 | 0 | } |
8286 | 0 | |
8287 | 0 | uint32_t length = result.Value().Length(); |
8288 | 0 | JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length)); |
8289 | 0 | if (!returnArray) { |
8290 | 0 | return false; |
8291 | 0 | } |
8292 | 0 | // Scope for 'tmp' |
8293 | 0 | { |
8294 | 0 | JS::Rooted<JS::Value> tmp(cx); |
8295 | 0 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { |
8296 | 0 | // Control block to let us common up the JS_DefineElement calls when there |
8297 | 0 | // are different ways to succeed at wrapping the object. |
8298 | 0 | do { |
8299 | 0 | tmp.setNumber(result.Value()[sequenceIdx0]); |
8300 | 0 | break; |
8301 | 0 | } while (false); |
8302 | 0 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, |
8303 | 0 | JSPROP_ENUMERATE)) { |
8304 | 0 | return false; |
8305 | 0 | } |
8306 | 0 | } |
8307 | 0 | } |
8308 | 0 | args.rval().setObject(*returnArray); |
8309 | 0 | return true; |
8310 | 0 | } |
8311 | | |
8312 | | static const JSJitInfo getUniformIndices_methodinfo = { |
8313 | | { (JSJitGetterOp)getUniformIndices }, |
8314 | | { prototypes::id::WebGL2RenderingContext }, |
8315 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8316 | | JSJitInfo::Method, |
8317 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8318 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8319 | | false, /* isInfallible. False in setters. */ |
8320 | | false, /* isMovable. Not relevant for setters. */ |
8321 | | false, /* isEliminatable. Not relevant for setters. */ |
8322 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8323 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8324 | | false, /* isTypedMethod. Only relevant for methods. */ |
8325 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8326 | | }; |
8327 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8328 | | static_assert(0 < 1, "There is no slot for us"); |
8329 | | |
8330 | | MOZ_CAN_RUN_SCRIPT static bool |
8331 | | getActiveUniforms(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8332 | 0 | { |
8333 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getActiveUniforms", DOM, cx); |
8334 | 0 |
|
8335 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
8336 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getActiveUniforms"); |
8337 | 0 | } |
8338 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
8339 | 0 | if (args[0].isObject()) { |
8340 | 0 | { |
8341 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
8342 | 0 | if (NS_FAILED(rv)) { |
8343 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getActiveUniforms", "WebGLProgram"); |
8344 | 0 | return false; |
8345 | 0 | } |
8346 | 0 | } |
8347 | 0 | } else { |
8348 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getActiveUniforms"); |
8349 | 0 | return false; |
8350 | 0 | } |
8351 | 0 | binding_detail::AutoSequence<uint32_t> arg1; |
8352 | 0 | if (args[1].isObject()) { |
8353 | 0 | JS::ForOfIterator iter(cx); |
8354 | 0 | if (!iter.init(args[1], JS::ForOfIterator::AllowNonIterable)) { |
8355 | 0 | return false; |
8356 | 0 | } |
8357 | 0 | if (!iter.valueIsIterable()) { |
8358 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.getActiveUniforms"); |
8359 | 0 | return false; |
8360 | 0 | } |
8361 | 0 | binding_detail::AutoSequence<uint32_t> &arr = arg1; |
8362 | 0 | JS::Rooted<JS::Value> temp(cx); |
8363 | 0 | while (true) { |
8364 | 0 | bool done; |
8365 | 0 | if (!iter.next(&temp, &done)) { |
8366 | 0 | return false; |
8367 | 0 | } |
8368 | 0 | if (done) { |
8369 | 0 | break; |
8370 | 0 | } |
8371 | 0 | uint32_t* slotPtr = arr.AppendElement(mozilla::fallible); |
8372 | 0 | if (!slotPtr) { |
8373 | 0 | JS_ReportOutOfMemory(cx); |
8374 | 0 | return false; |
8375 | 0 | } |
8376 | 0 | uint32_t& slot = *slotPtr; |
8377 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) { |
8378 | 0 | return false; |
8379 | 0 | } |
8380 | 0 | } |
8381 | 0 | } else { |
8382 | 0 | ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of WebGL2RenderingContext.getActiveUniforms"); |
8383 | 0 | return false; |
8384 | 0 | } |
8385 | 0 | uint32_t arg2; |
8386 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
8387 | 0 | return false; |
8388 | 0 | } |
8389 | 0 | JS::Rooted<JS::Value> result(cx); |
8390 | 0 | self->GetActiveUniforms(cx, MOZ_KnownLive(NonNullHelper(arg0)), Constify(arg1), arg2, &result); |
8391 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8392 | 0 | JS::ExposeValueToActiveJS(result); |
8393 | 0 | args.rval().set(result); |
8394 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
8395 | 0 | return false; |
8396 | 0 | } |
8397 | 0 | return true; |
8398 | 0 | } |
8399 | | |
8400 | | static const JSJitInfo getActiveUniforms_methodinfo = { |
8401 | | { (JSJitGetterOp)getActiveUniforms }, |
8402 | | { prototypes::id::WebGL2RenderingContext }, |
8403 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8404 | | JSJitInfo::Method, |
8405 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8406 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8407 | | false, /* isInfallible. False in setters. */ |
8408 | | false, /* isMovable. Not relevant for setters. */ |
8409 | | false, /* isEliminatable. Not relevant for setters. */ |
8410 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8411 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8412 | | false, /* isTypedMethod. Only relevant for methods. */ |
8413 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8414 | | }; |
8415 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8416 | | static_assert(0 < 1, "There is no slot for us"); |
8417 | | |
8418 | | MOZ_CAN_RUN_SCRIPT static bool |
8419 | | getUniformBlockIndex(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8420 | 0 | { |
8421 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getUniformBlockIndex", DOM, cx); |
8422 | 0 |
|
8423 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
8424 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getUniformBlockIndex"); |
8425 | 0 | } |
8426 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
8427 | 0 | if (args[0].isObject()) { |
8428 | 0 | { |
8429 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
8430 | 0 | if (NS_FAILED(rv)) { |
8431 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getUniformBlockIndex", "WebGLProgram"); |
8432 | 0 | return false; |
8433 | 0 | } |
8434 | 0 | } |
8435 | 0 | } else { |
8436 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getUniformBlockIndex"); |
8437 | 0 | return false; |
8438 | 0 | } |
8439 | 0 | binding_detail::FakeString arg1; |
8440 | 0 | if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) { |
8441 | 0 | return false; |
8442 | 0 | } |
8443 | 0 | uint32_t result(self->GetUniformBlockIndex(MOZ_KnownLive(NonNullHelper(arg0)), NonNullHelper(Constify(arg1)))); |
8444 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8445 | 0 | args.rval().setNumber(result); |
8446 | 0 | return true; |
8447 | 0 | } |
8448 | | |
8449 | | static const JSJitInfo getUniformBlockIndex_methodinfo = { |
8450 | | { (JSJitGetterOp)getUniformBlockIndex }, |
8451 | | { prototypes::id::WebGL2RenderingContext }, |
8452 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8453 | | JSJitInfo::Method, |
8454 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8455 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
8456 | | false, /* isInfallible. False in setters. */ |
8457 | | false, /* isMovable. Not relevant for setters. */ |
8458 | | false, /* isEliminatable. Not relevant for setters. */ |
8459 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8460 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8461 | | false, /* isTypedMethod. Only relevant for methods. */ |
8462 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8463 | | }; |
8464 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8465 | | static_assert(0 < 1, "There is no slot for us"); |
8466 | | |
8467 | | MOZ_CAN_RUN_SCRIPT static bool |
8468 | | getActiveUniformBlockParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8469 | 0 | { |
8470 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getActiveUniformBlockParameter", DOM, cx); |
8471 | 0 |
|
8472 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
8473 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getActiveUniformBlockParameter"); |
8474 | 0 | } |
8475 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
8476 | 0 | if (args[0].isObject()) { |
8477 | 0 | { |
8478 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
8479 | 0 | if (NS_FAILED(rv)) { |
8480 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getActiveUniformBlockParameter", "WebGLProgram"); |
8481 | 0 | return false; |
8482 | 0 | } |
8483 | 0 | } |
8484 | 0 | } else { |
8485 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getActiveUniformBlockParameter"); |
8486 | 0 | return false; |
8487 | 0 | } |
8488 | 0 | uint32_t arg1; |
8489 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
8490 | 0 | return false; |
8491 | 0 | } |
8492 | 0 | uint32_t arg2; |
8493 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
8494 | 0 | return false; |
8495 | 0 | } |
8496 | 0 | FastErrorResult rv; |
8497 | 0 | JS::Rooted<JS::Value> result(cx); |
8498 | 0 | self->GetActiveUniformBlockParameter(cx, MOZ_KnownLive(NonNullHelper(arg0)), arg1, arg2, &result, rv); |
8499 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
8500 | 0 | return false; |
8501 | 0 | } |
8502 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8503 | 0 | JS::ExposeValueToActiveJS(result); |
8504 | 0 | args.rval().set(result); |
8505 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
8506 | 0 | return false; |
8507 | 0 | } |
8508 | 0 | return true; |
8509 | 0 | } |
8510 | | |
8511 | | static const JSJitInfo getActiveUniformBlockParameter_methodinfo = { |
8512 | | { (JSJitGetterOp)getActiveUniformBlockParameter }, |
8513 | | { prototypes::id::WebGL2RenderingContext }, |
8514 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8515 | | JSJitInfo::Method, |
8516 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8517 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8518 | | false, /* isInfallible. False in setters. */ |
8519 | | false, /* isMovable. Not relevant for setters. */ |
8520 | | false, /* isEliminatable. Not relevant for setters. */ |
8521 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8522 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8523 | | false, /* isTypedMethod. Only relevant for methods. */ |
8524 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8525 | | }; |
8526 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8527 | | static_assert(0 < 1, "There is no slot for us"); |
8528 | | |
8529 | | MOZ_CAN_RUN_SCRIPT static bool |
8530 | | getActiveUniformBlockName(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8531 | 0 | { |
8532 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getActiveUniformBlockName", DOM, cx); |
8533 | 0 |
|
8534 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
8535 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getActiveUniformBlockName"); |
8536 | 0 | } |
8537 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
8538 | 0 | if (args[0].isObject()) { |
8539 | 0 | { |
8540 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
8541 | 0 | if (NS_FAILED(rv)) { |
8542 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getActiveUniformBlockName", "WebGLProgram"); |
8543 | 0 | return false; |
8544 | 0 | } |
8545 | 0 | } |
8546 | 0 | } else { |
8547 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getActiveUniformBlockName"); |
8548 | 0 | return false; |
8549 | 0 | } |
8550 | 0 | uint32_t arg1; |
8551 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
8552 | 0 | return false; |
8553 | 0 | } |
8554 | 0 | DOMString result; |
8555 | 0 | self->GetActiveUniformBlockName(MOZ_KnownLive(NonNullHelper(arg0)), arg1, result); |
8556 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8557 | 0 | if (!xpc::StringToJsval(cx, result, args.rval())) { |
8558 | 0 | return false; |
8559 | 0 | } |
8560 | 0 | return true; |
8561 | 0 | } |
8562 | | |
8563 | | static const JSJitInfo getActiveUniformBlockName_methodinfo = { |
8564 | | { (JSJitGetterOp)getActiveUniformBlockName }, |
8565 | | { prototypes::id::WebGL2RenderingContext }, |
8566 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8567 | | JSJitInfo::Method, |
8568 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8569 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8570 | | false, /* isInfallible. False in setters. */ |
8571 | | false, /* isMovable. Not relevant for setters. */ |
8572 | | false, /* isEliminatable. Not relevant for setters. */ |
8573 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8574 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8575 | | false, /* isTypedMethod. Only relevant for methods. */ |
8576 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8577 | | }; |
8578 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8579 | | static_assert(0 < 1, "There is no slot for us"); |
8580 | | |
8581 | | MOZ_CAN_RUN_SCRIPT static bool |
8582 | | uniformBlockBinding(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8583 | 0 | { |
8584 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniformBlockBinding", DOM, cx); |
8585 | 0 |
|
8586 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
8587 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniformBlockBinding"); |
8588 | 0 | } |
8589 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
8590 | 0 | if (args[0].isObject()) { |
8591 | 0 | { |
8592 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
8593 | 0 | if (NS_FAILED(rv)) { |
8594 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniformBlockBinding", "WebGLProgram"); |
8595 | 0 | return false; |
8596 | 0 | } |
8597 | 0 | } |
8598 | 0 | } else { |
8599 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniformBlockBinding"); |
8600 | 0 | return false; |
8601 | 0 | } |
8602 | 0 | uint32_t arg1; |
8603 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
8604 | 0 | return false; |
8605 | 0 | } |
8606 | 0 | uint32_t arg2; |
8607 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
8608 | 0 | return false; |
8609 | 0 | } |
8610 | 0 | self->UniformBlockBinding(MOZ_KnownLive(NonNullHelper(arg0)), arg1, arg2); |
8611 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8612 | 0 | args.rval().setUndefined(); |
8613 | 0 | return true; |
8614 | 0 | } |
8615 | | |
8616 | | static const JSJitInfo uniformBlockBinding_methodinfo = { |
8617 | | { (JSJitGetterOp)uniformBlockBinding }, |
8618 | | { prototypes::id::WebGL2RenderingContext }, |
8619 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8620 | | JSJitInfo::Method, |
8621 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8622 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
8623 | | false, /* isInfallible. False in setters. */ |
8624 | | false, /* isMovable. Not relevant for setters. */ |
8625 | | false, /* isEliminatable. Not relevant for setters. */ |
8626 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8627 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8628 | | false, /* isTypedMethod. Only relevant for methods. */ |
8629 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8630 | | }; |
8631 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8632 | | static_assert(0 < 1, "There is no slot for us"); |
8633 | | |
8634 | | MOZ_CAN_RUN_SCRIPT static bool |
8635 | | createVertexArray(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8636 | 0 | { |
8637 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createVertexArray", DOM, cx); |
8638 | 0 |
|
8639 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLVertexArray>(self->CreateVertexArray())); |
8640 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8641 | 0 | if (!result) { |
8642 | 0 | args.rval().setNull(); |
8643 | 0 | return true; |
8644 | 0 | } |
8645 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
8646 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
8647 | 0 | return false; |
8648 | 0 | } |
8649 | 0 | return true; |
8650 | 0 | } |
8651 | | |
8652 | | static const JSJitInfo createVertexArray_methodinfo = { |
8653 | | { (JSJitGetterOp)createVertexArray }, |
8654 | | { prototypes::id::WebGL2RenderingContext }, |
8655 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8656 | | JSJitInfo::Method, |
8657 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8658 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8659 | | false, /* isInfallible. False in setters. */ |
8660 | | false, /* isMovable. Not relevant for setters. */ |
8661 | | false, /* isEliminatable. Not relevant for setters. */ |
8662 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8663 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8664 | | false, /* isTypedMethod. Only relevant for methods. */ |
8665 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8666 | | }; |
8667 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8668 | | static_assert(0 < 1, "There is no slot for us"); |
8669 | | |
8670 | | MOZ_CAN_RUN_SCRIPT static bool |
8671 | | deleteVertexArray(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8672 | 0 | { |
8673 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteVertexArray", DOM, cx); |
8674 | 0 |
|
8675 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
8676 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteVertexArray"); |
8677 | 0 | } |
8678 | 0 | mozilla::WebGLVertexArray* arg0; |
8679 | 0 | if (args[0].isObject()) { |
8680 | 0 | { |
8681 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLVertexArrayObject, mozilla::WebGLVertexArray>(args[0], arg0); |
8682 | 0 | if (NS_FAILED(rv)) { |
8683 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteVertexArray", "WebGLVertexArrayObject"); |
8684 | 0 | return false; |
8685 | 0 | } |
8686 | 0 | } |
8687 | 0 | } else if (args[0].isNullOrUndefined()) { |
8688 | 0 | arg0 = nullptr; |
8689 | 0 | } else { |
8690 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteVertexArray"); |
8691 | 0 | return false; |
8692 | 0 | } |
8693 | 0 | self->DeleteVertexArray(MOZ_KnownLive(Constify(arg0))); |
8694 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8695 | 0 | args.rval().setUndefined(); |
8696 | 0 | return true; |
8697 | 0 | } |
8698 | | |
8699 | | static const JSJitInfo deleteVertexArray_methodinfo = { |
8700 | | { (JSJitGetterOp)deleteVertexArray }, |
8701 | | { prototypes::id::WebGL2RenderingContext }, |
8702 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8703 | | JSJitInfo::Method, |
8704 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8705 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
8706 | | false, /* isInfallible. False in setters. */ |
8707 | | false, /* isMovable. Not relevant for setters. */ |
8708 | | false, /* isEliminatable. Not relevant for setters. */ |
8709 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8710 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8711 | | false, /* isTypedMethod. Only relevant for methods. */ |
8712 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8713 | | }; |
8714 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8715 | | static_assert(0 < 1, "There is no slot for us"); |
8716 | | |
8717 | | MOZ_CAN_RUN_SCRIPT static bool |
8718 | | isVertexArray(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8719 | 0 | { |
8720 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isVertexArray", DOM, cx); |
8721 | 0 |
|
8722 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
8723 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isVertexArray"); |
8724 | 0 | } |
8725 | 0 | mozilla::WebGLVertexArray* arg0; |
8726 | 0 | if (args[0].isObject()) { |
8727 | 0 | { |
8728 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLVertexArrayObject, mozilla::WebGLVertexArray>(args[0], arg0); |
8729 | 0 | if (NS_FAILED(rv)) { |
8730 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isVertexArray", "WebGLVertexArrayObject"); |
8731 | 0 | return false; |
8732 | 0 | } |
8733 | 0 | } |
8734 | 0 | } else if (args[0].isNullOrUndefined()) { |
8735 | 0 | arg0 = nullptr; |
8736 | 0 | } else { |
8737 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isVertexArray"); |
8738 | 0 | return false; |
8739 | 0 | } |
8740 | 0 | bool result(self->IsVertexArray(MOZ_KnownLive(Constify(arg0)))); |
8741 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8742 | 0 | args.rval().setBoolean(result); |
8743 | 0 | return true; |
8744 | 0 | } |
8745 | | |
8746 | | static const JSJitInfo isVertexArray_methodinfo = { |
8747 | | { (JSJitGetterOp)isVertexArray }, |
8748 | | { prototypes::id::WebGL2RenderingContext }, |
8749 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8750 | | JSJitInfo::Method, |
8751 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8752 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
8753 | | false, /* isInfallible. False in setters. */ |
8754 | | false, /* isMovable. Not relevant for setters. */ |
8755 | | false, /* isEliminatable. Not relevant for setters. */ |
8756 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8757 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8758 | | false, /* isTypedMethod. Only relevant for methods. */ |
8759 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8760 | | }; |
8761 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8762 | | static_assert(0 < 1, "There is no slot for us"); |
8763 | | |
8764 | | MOZ_CAN_RUN_SCRIPT static bool |
8765 | | bindVertexArray(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8766 | 0 | { |
8767 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindVertexArray", DOM, cx); |
8768 | 0 |
|
8769 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
8770 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindVertexArray"); |
8771 | 0 | } |
8772 | 0 | mozilla::WebGLVertexArray* arg0; |
8773 | 0 | if (args[0].isObject()) { |
8774 | 0 | { |
8775 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLVertexArrayObject, mozilla::WebGLVertexArray>(args[0], arg0); |
8776 | 0 | if (NS_FAILED(rv)) { |
8777 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.bindVertexArray", "WebGLVertexArrayObject"); |
8778 | 0 | return false; |
8779 | 0 | } |
8780 | 0 | } |
8781 | 0 | } else if (args[0].isNullOrUndefined()) { |
8782 | 0 | arg0 = nullptr; |
8783 | 0 | } else { |
8784 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.bindVertexArray"); |
8785 | 0 | return false; |
8786 | 0 | } |
8787 | 0 | self->BindVertexArray(MOZ_KnownLive(Constify(arg0))); |
8788 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8789 | 0 | args.rval().setUndefined(); |
8790 | 0 | return true; |
8791 | 0 | } |
8792 | | |
8793 | | static const JSJitInfo bindVertexArray_methodinfo = { |
8794 | | { (JSJitGetterOp)bindVertexArray }, |
8795 | | { prototypes::id::WebGL2RenderingContext }, |
8796 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8797 | | JSJitInfo::Method, |
8798 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8799 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
8800 | | false, /* isInfallible. False in setters. */ |
8801 | | false, /* isMovable. Not relevant for setters. */ |
8802 | | false, /* isEliminatable. Not relevant for setters. */ |
8803 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8804 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8805 | | false, /* isTypedMethod. Only relevant for methods. */ |
8806 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8807 | | }; |
8808 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8809 | | static_assert(0 < 1, "There is no slot for us"); |
8810 | | |
8811 | | MOZ_CAN_RUN_SCRIPT static bool |
8812 | | get_canvas(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, JSJitGetterCallArgs args) |
8813 | 0 | { |
8814 | 0 | AUTO_PROFILER_LABEL_FAST("get WebGL2RenderingContext.canvas", DOM, cx); |
8815 | 0 |
|
8816 | 0 | Nullable<OwningHTMLCanvasElementOrOffscreenCanvas> result; |
8817 | 0 | self->GetCanvas(result); |
8818 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8819 | 0 | if (result.IsNull()) { |
8820 | 0 | args.rval().setNull(); |
8821 | 0 | return true; |
8822 | 0 | } |
8823 | 0 | if (!result.Value().ToJSVal(cx, obj, args.rval())) { |
8824 | 0 | return false; |
8825 | 0 | } |
8826 | 0 | return true; |
8827 | 0 | } |
8828 | | |
8829 | | static const JSJitInfo canvas_getterinfo = { |
8830 | | { (JSJitGetterOp)get_canvas }, |
8831 | | { prototypes::id::WebGL2RenderingContext }, |
8832 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8833 | | JSJitInfo::Getter, |
8834 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8835 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8836 | | false, /* isInfallible. False in setters. */ |
8837 | | false, /* isMovable. Not relevant for setters. */ |
8838 | | false, /* isEliminatable. Not relevant for setters. */ |
8839 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8840 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8841 | | false, /* isTypedMethod. Only relevant for methods. */ |
8842 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8843 | | }; |
8844 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8845 | | static_assert(0 < 1, "There is no slot for us"); |
8846 | | |
8847 | | MOZ_CAN_RUN_SCRIPT static bool |
8848 | | get_drawingBufferWidth(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, JSJitGetterCallArgs args) |
8849 | 0 | { |
8850 | 0 | AUTO_PROFILER_LABEL_FAST("get WebGL2RenderingContext.drawingBufferWidth", DOM, cx); |
8851 | 0 |
|
8852 | 0 | int32_t result(self->DrawingBufferWidth()); |
8853 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8854 | 0 | args.rval().setInt32(int32_t(result)); |
8855 | 0 | return true; |
8856 | 0 | } |
8857 | | |
8858 | | static const JSJitInfo drawingBufferWidth_getterinfo = { |
8859 | | { (JSJitGetterOp)get_drawingBufferWidth }, |
8860 | | { prototypes::id::WebGL2RenderingContext }, |
8861 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8862 | | JSJitInfo::Getter, |
8863 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8864 | | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ |
8865 | | true, /* isInfallible. False in setters. */ |
8866 | | false, /* isMovable. Not relevant for setters. */ |
8867 | | false, /* isEliminatable. Not relevant for setters. */ |
8868 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8869 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8870 | | false, /* isTypedMethod. Only relevant for methods. */ |
8871 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8872 | | }; |
8873 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8874 | | static_assert(0 < 1, "There is no slot for us"); |
8875 | | |
8876 | | MOZ_CAN_RUN_SCRIPT static bool |
8877 | | get_drawingBufferHeight(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, JSJitGetterCallArgs args) |
8878 | 0 | { |
8879 | 0 | AUTO_PROFILER_LABEL_FAST("get WebGL2RenderingContext.drawingBufferHeight", DOM, cx); |
8880 | 0 |
|
8881 | 0 | int32_t result(self->DrawingBufferHeight()); |
8882 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8883 | 0 | args.rval().setInt32(int32_t(result)); |
8884 | 0 | return true; |
8885 | 0 | } |
8886 | | |
8887 | | static const JSJitInfo drawingBufferHeight_getterinfo = { |
8888 | | { (JSJitGetterOp)get_drawingBufferHeight }, |
8889 | | { prototypes::id::WebGL2RenderingContext }, |
8890 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8891 | | JSJitInfo::Getter, |
8892 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8893 | | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ |
8894 | | true, /* isInfallible. False in setters. */ |
8895 | | false, /* isMovable. Not relevant for setters. */ |
8896 | | false, /* isEliminatable. Not relevant for setters. */ |
8897 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8898 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8899 | | false, /* isTypedMethod. Only relevant for methods. */ |
8900 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8901 | | }; |
8902 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8903 | | static_assert(0 < 1, "There is no slot for us"); |
8904 | | |
8905 | | MOZ_CAN_RUN_SCRIPT static bool |
8906 | | getContextAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8907 | 0 | { |
8908 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getContextAttributes", DOM, cx); |
8909 | 0 |
|
8910 | 0 | Nullable<WebGLContextAttributes> result; |
8911 | 0 | self->GetContextAttributes(result); |
8912 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8913 | 0 | if (result.IsNull()) { |
8914 | 0 | args.rval().setNull(); |
8915 | 0 | return true; |
8916 | 0 | } |
8917 | 0 | if (!result.Value().ToObjectInternal(cx, args.rval())) { |
8918 | 0 | return false; |
8919 | 0 | } |
8920 | 0 | return true; |
8921 | 0 | } |
8922 | | |
8923 | | static const JSJitInfo getContextAttributes_methodinfo = { |
8924 | | { (JSJitGetterOp)getContextAttributes }, |
8925 | | { prototypes::id::WebGL2RenderingContext }, |
8926 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8927 | | JSJitInfo::Method, |
8928 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8929 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
8930 | | false, /* isInfallible. False in setters. */ |
8931 | | false, /* isMovable. Not relevant for setters. */ |
8932 | | false, /* isEliminatable. Not relevant for setters. */ |
8933 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8934 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8935 | | false, /* isTypedMethod. Only relevant for methods. */ |
8936 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8937 | | }; |
8938 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8939 | | static_assert(0 < 1, "There is no slot for us"); |
8940 | | |
8941 | | MOZ_CAN_RUN_SCRIPT static bool |
8942 | | isContextLost(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8943 | 0 | { |
8944 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isContextLost", DOM, cx); |
8945 | 0 |
|
8946 | 0 | bool result(self->IsContextLost()); |
8947 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8948 | 0 | args.rval().setBoolean(result); |
8949 | 0 | return true; |
8950 | 0 | } |
8951 | | |
8952 | | static const JSJitInfo isContextLost_methodinfo = { |
8953 | | { (JSJitGetterOp)isContextLost }, |
8954 | | { prototypes::id::WebGL2RenderingContext }, |
8955 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
8956 | | JSJitInfo::Method, |
8957 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
8958 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
8959 | | true, /* isInfallible. False in setters. */ |
8960 | | false, /* isMovable. Not relevant for setters. */ |
8961 | | false, /* isEliminatable. Not relevant for setters. */ |
8962 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
8963 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
8964 | | false, /* isTypedMethod. Only relevant for methods. */ |
8965 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
8966 | | }; |
8967 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
8968 | | static_assert(0 < 1, "There is no slot for us"); |
8969 | | |
8970 | | MOZ_CAN_RUN_SCRIPT static bool |
8971 | | getSupportedExtensions(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
8972 | 0 | { |
8973 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getSupportedExtensions", DOM, cx); |
8974 | 0 |
|
8975 | 0 | Nullable<nsTArray<nsString>> result; |
8976 | 0 | self->GetSupportedExtensions(result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem); |
8977 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
8978 | 0 |
|
8979 | 0 | if (result.IsNull()) { |
8980 | 0 | args.rval().setNull(); |
8981 | 0 | return true; |
8982 | 0 | } |
8983 | 0 | |
8984 | 0 | uint32_t length = result.Value().Length(); |
8985 | 0 | JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length)); |
8986 | 0 | if (!returnArray) { |
8987 | 0 | return false; |
8988 | 0 | } |
8989 | 0 | // Scope for 'tmp' |
8990 | 0 | { |
8991 | 0 | JS::Rooted<JS::Value> tmp(cx); |
8992 | 0 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { |
8993 | 0 | // Control block to let us common up the JS_DefineElement calls when there |
8994 | 0 | // are different ways to succeed at wrapping the object. |
8995 | 0 | do { |
8996 | 0 | if (!xpc::NonVoidStringToJsval(cx, result.Value()[sequenceIdx0], &tmp)) { |
8997 | 0 | return false; |
8998 | 0 | } |
8999 | 0 | break; |
9000 | 0 | } while (false); |
9001 | 0 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, |
9002 | 0 | JSPROP_ENUMERATE)) { |
9003 | 0 | return false; |
9004 | 0 | } |
9005 | 0 | } |
9006 | 0 | } |
9007 | 0 | args.rval().setObject(*returnArray); |
9008 | 0 | return true; |
9009 | 0 | } |
9010 | | |
9011 | | static const JSJitInfo getSupportedExtensions_methodinfo = { |
9012 | | { (JSJitGetterOp)getSupportedExtensions }, |
9013 | | { prototypes::id::WebGL2RenderingContext }, |
9014 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9015 | | JSJitInfo::Method, |
9016 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9017 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
9018 | | false, /* isInfallible. False in setters. */ |
9019 | | false, /* isMovable. Not relevant for setters. */ |
9020 | | false, /* isEliminatable. Not relevant for setters. */ |
9021 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9022 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9023 | | false, /* isTypedMethod. Only relevant for methods. */ |
9024 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9025 | | }; |
9026 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9027 | | static_assert(0 < 1, "There is no slot for us"); |
9028 | | |
9029 | | MOZ_CAN_RUN_SCRIPT static bool |
9030 | | getExtension(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9031 | 0 | { |
9032 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getExtension", DOM, cx); |
9033 | 0 |
|
9034 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9035 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getExtension"); |
9036 | 0 | } |
9037 | 0 | binding_detail::FakeString arg0; |
9038 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
9039 | 0 | return false; |
9040 | 0 | } |
9041 | 0 | FastErrorResult rv; |
9042 | 0 | JS::Rooted<JSObject*> result(cx); |
9043 | 0 | self->GetExtension(cx, NonNullHelper(Constify(arg0)), &result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv); |
9044 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
9045 | 0 | return false; |
9046 | 0 | } |
9047 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9048 | 0 | if (result) { |
9049 | 0 | JS::ExposeObjectToActiveJS(result); |
9050 | 0 | } |
9051 | 0 | args.rval().setObjectOrNull(result); |
9052 | 0 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { |
9053 | 0 | return false; |
9054 | 0 | } |
9055 | 0 | return true; |
9056 | 0 | } |
9057 | | |
9058 | | static const JSJitInfo getExtension_methodinfo = { |
9059 | | { (JSJitGetterOp)getExtension }, |
9060 | | { prototypes::id::WebGL2RenderingContext }, |
9061 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9062 | | JSJitInfo::Method, |
9063 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9064 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
9065 | | false, /* isInfallible. False in setters. */ |
9066 | | false, /* isMovable. Not relevant for setters. */ |
9067 | | false, /* isEliminatable. Not relevant for setters. */ |
9068 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9069 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9070 | | false, /* isTypedMethod. Only relevant for methods. */ |
9071 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9072 | | }; |
9073 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9074 | | static_assert(0 < 1, "There is no slot for us"); |
9075 | | |
9076 | | MOZ_CAN_RUN_SCRIPT static bool |
9077 | | activeTexture(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9078 | 0 | { |
9079 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.activeTexture", DOM, cx); |
9080 | 0 |
|
9081 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9082 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.activeTexture"); |
9083 | 0 | } |
9084 | 0 | uint32_t arg0; |
9085 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9086 | 0 | return false; |
9087 | 0 | } |
9088 | 0 | self->ActiveTexture(arg0); |
9089 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9090 | 0 | args.rval().setUndefined(); |
9091 | 0 | return true; |
9092 | 0 | } |
9093 | | |
9094 | | static const JSJitInfo activeTexture_methodinfo = { |
9095 | | { (JSJitGetterOp)activeTexture }, |
9096 | | { prototypes::id::WebGL2RenderingContext }, |
9097 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9098 | | JSJitInfo::Method, |
9099 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9100 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9101 | | false, /* isInfallible. False in setters. */ |
9102 | | false, /* isMovable. Not relevant for setters. */ |
9103 | | false, /* isEliminatable. Not relevant for setters. */ |
9104 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9105 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9106 | | false, /* isTypedMethod. Only relevant for methods. */ |
9107 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9108 | | }; |
9109 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9110 | | static_assert(0 < 1, "There is no slot for us"); |
9111 | | |
9112 | | MOZ_CAN_RUN_SCRIPT static bool |
9113 | | attachShader(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9114 | 0 | { |
9115 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.attachShader", DOM, cx); |
9116 | 0 |
|
9117 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
9118 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.attachShader"); |
9119 | 0 | } |
9120 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
9121 | 0 | if (args[0].isObject()) { |
9122 | 0 | { |
9123 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
9124 | 0 | if (NS_FAILED(rv)) { |
9125 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.attachShader", "WebGLProgram"); |
9126 | 0 | return false; |
9127 | 0 | } |
9128 | 0 | } |
9129 | 0 | } else { |
9130 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.attachShader"); |
9131 | 0 | return false; |
9132 | 0 | } |
9133 | 0 | NonNull<mozilla::WebGLShader> arg1; |
9134 | 0 | if (args[1].isObject()) { |
9135 | 0 | { |
9136 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[1], arg1); |
9137 | 0 | if (NS_FAILED(rv)) { |
9138 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.attachShader", "WebGLShader"); |
9139 | 0 | return false; |
9140 | 0 | } |
9141 | 0 | } |
9142 | 0 | } else { |
9143 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.attachShader"); |
9144 | 0 | return false; |
9145 | 0 | } |
9146 | 0 | self->AttachShader(MOZ_KnownLive(NonNullHelper(arg0)), MOZ_KnownLive(NonNullHelper(arg1))); |
9147 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9148 | 0 | args.rval().setUndefined(); |
9149 | 0 | return true; |
9150 | 0 | } |
9151 | | |
9152 | | static const JSJitInfo attachShader_methodinfo = { |
9153 | | { (JSJitGetterOp)attachShader }, |
9154 | | { prototypes::id::WebGL2RenderingContext }, |
9155 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9156 | | JSJitInfo::Method, |
9157 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9158 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9159 | | false, /* isInfallible. False in setters. */ |
9160 | | false, /* isMovable. Not relevant for setters. */ |
9161 | | false, /* isEliminatable. Not relevant for setters. */ |
9162 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9163 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9164 | | false, /* isTypedMethod. Only relevant for methods. */ |
9165 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9166 | | }; |
9167 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9168 | | static_assert(0 < 1, "There is no slot for us"); |
9169 | | |
9170 | | MOZ_CAN_RUN_SCRIPT static bool |
9171 | | bindAttribLocation(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9172 | 0 | { |
9173 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindAttribLocation", DOM, cx); |
9174 | 0 |
|
9175 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
9176 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindAttribLocation"); |
9177 | 0 | } |
9178 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
9179 | 0 | if (args[0].isObject()) { |
9180 | 0 | { |
9181 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
9182 | 0 | if (NS_FAILED(rv)) { |
9183 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.bindAttribLocation", "WebGLProgram"); |
9184 | 0 | return false; |
9185 | 0 | } |
9186 | 0 | } |
9187 | 0 | } else { |
9188 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.bindAttribLocation"); |
9189 | 0 | return false; |
9190 | 0 | } |
9191 | 0 | uint32_t arg1; |
9192 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
9193 | 0 | return false; |
9194 | 0 | } |
9195 | 0 | binding_detail::FakeString arg2; |
9196 | 0 | if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2)) { |
9197 | 0 | return false; |
9198 | 0 | } |
9199 | 0 | self->BindAttribLocation(MOZ_KnownLive(NonNullHelper(arg0)), arg1, NonNullHelper(Constify(arg2))); |
9200 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9201 | 0 | args.rval().setUndefined(); |
9202 | 0 | return true; |
9203 | 0 | } |
9204 | | |
9205 | | static const JSJitInfo bindAttribLocation_methodinfo = { |
9206 | | { (JSJitGetterOp)bindAttribLocation }, |
9207 | | { prototypes::id::WebGL2RenderingContext }, |
9208 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9209 | | JSJitInfo::Method, |
9210 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9211 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9212 | | false, /* isInfallible. False in setters. */ |
9213 | | false, /* isMovable. Not relevant for setters. */ |
9214 | | false, /* isEliminatable. Not relevant for setters. */ |
9215 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9216 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9217 | | false, /* isTypedMethod. Only relevant for methods. */ |
9218 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9219 | | }; |
9220 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9221 | | static_assert(0 < 1, "There is no slot for us"); |
9222 | | |
9223 | | MOZ_CAN_RUN_SCRIPT static bool |
9224 | | bindBuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9225 | 0 | { |
9226 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindBuffer", DOM, cx); |
9227 | 0 |
|
9228 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
9229 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindBuffer"); |
9230 | 0 | } |
9231 | 0 | uint32_t arg0; |
9232 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9233 | 0 | return false; |
9234 | 0 | } |
9235 | 0 | mozilla::WebGLBuffer* arg1; |
9236 | 0 | if (args[1].isObject()) { |
9237 | 0 | { |
9238 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLBuffer, mozilla::WebGLBuffer>(args[1], arg1); |
9239 | 0 | if (NS_FAILED(rv)) { |
9240 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.bindBuffer", "WebGLBuffer"); |
9241 | 0 | return false; |
9242 | 0 | } |
9243 | 0 | } |
9244 | 0 | } else if (args[1].isNullOrUndefined()) { |
9245 | 0 | arg1 = nullptr; |
9246 | 0 | } else { |
9247 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.bindBuffer"); |
9248 | 0 | return false; |
9249 | 0 | } |
9250 | 0 | self->BindBuffer(arg0, MOZ_KnownLive(Constify(arg1))); |
9251 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9252 | 0 | args.rval().setUndefined(); |
9253 | 0 | return true; |
9254 | 0 | } |
9255 | | |
9256 | | static const JSJitInfo bindBuffer_methodinfo = { |
9257 | | { (JSJitGetterOp)bindBuffer }, |
9258 | | { prototypes::id::WebGL2RenderingContext }, |
9259 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9260 | | JSJitInfo::Method, |
9261 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9262 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9263 | | false, /* isInfallible. False in setters. */ |
9264 | | false, /* isMovable. Not relevant for setters. */ |
9265 | | false, /* isEliminatable. Not relevant for setters. */ |
9266 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9267 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9268 | | false, /* isTypedMethod. Only relevant for methods. */ |
9269 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9270 | | }; |
9271 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9272 | | static_assert(0 < 1, "There is no slot for us"); |
9273 | | |
9274 | | MOZ_CAN_RUN_SCRIPT static bool |
9275 | | bindFramebuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9276 | 0 | { |
9277 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindFramebuffer", DOM, cx); |
9278 | 0 |
|
9279 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
9280 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindFramebuffer"); |
9281 | 0 | } |
9282 | 0 | uint32_t arg0; |
9283 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9284 | 0 | return false; |
9285 | 0 | } |
9286 | 0 | mozilla::WebGLFramebuffer* arg1; |
9287 | 0 | if (args[1].isObject()) { |
9288 | 0 | { |
9289 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLFramebuffer, mozilla::WebGLFramebuffer>(args[1], arg1); |
9290 | 0 | if (NS_FAILED(rv)) { |
9291 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.bindFramebuffer", "WebGLFramebuffer"); |
9292 | 0 | return false; |
9293 | 0 | } |
9294 | 0 | } |
9295 | 0 | } else if (args[1].isNullOrUndefined()) { |
9296 | 0 | arg1 = nullptr; |
9297 | 0 | } else { |
9298 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.bindFramebuffer"); |
9299 | 0 | return false; |
9300 | 0 | } |
9301 | 0 | self->BindFramebuffer(arg0, MOZ_KnownLive(Constify(arg1))); |
9302 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9303 | 0 | args.rval().setUndefined(); |
9304 | 0 | return true; |
9305 | 0 | } |
9306 | | |
9307 | | static const JSJitInfo bindFramebuffer_methodinfo = { |
9308 | | { (JSJitGetterOp)bindFramebuffer }, |
9309 | | { prototypes::id::WebGL2RenderingContext }, |
9310 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9311 | | JSJitInfo::Method, |
9312 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9313 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9314 | | false, /* isInfallible. False in setters. */ |
9315 | | false, /* isMovable. Not relevant for setters. */ |
9316 | | false, /* isEliminatable. Not relevant for setters. */ |
9317 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9318 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9319 | | false, /* isTypedMethod. Only relevant for methods. */ |
9320 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9321 | | }; |
9322 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9323 | | static_assert(0 < 1, "There is no slot for us"); |
9324 | | |
9325 | | MOZ_CAN_RUN_SCRIPT static bool |
9326 | | bindRenderbuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9327 | 0 | { |
9328 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindRenderbuffer", DOM, cx); |
9329 | 0 |
|
9330 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
9331 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindRenderbuffer"); |
9332 | 0 | } |
9333 | 0 | uint32_t arg0; |
9334 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9335 | 0 | return false; |
9336 | 0 | } |
9337 | 0 | mozilla::WebGLRenderbuffer* arg1; |
9338 | 0 | if (args[1].isObject()) { |
9339 | 0 | { |
9340 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLRenderbuffer, mozilla::WebGLRenderbuffer>(args[1], arg1); |
9341 | 0 | if (NS_FAILED(rv)) { |
9342 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.bindRenderbuffer", "WebGLRenderbuffer"); |
9343 | 0 | return false; |
9344 | 0 | } |
9345 | 0 | } |
9346 | 0 | } else if (args[1].isNullOrUndefined()) { |
9347 | 0 | arg1 = nullptr; |
9348 | 0 | } else { |
9349 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.bindRenderbuffer"); |
9350 | 0 | return false; |
9351 | 0 | } |
9352 | 0 | self->BindRenderbuffer(arg0, MOZ_KnownLive(Constify(arg1))); |
9353 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9354 | 0 | args.rval().setUndefined(); |
9355 | 0 | return true; |
9356 | 0 | } |
9357 | | |
9358 | | static const JSJitInfo bindRenderbuffer_methodinfo = { |
9359 | | { (JSJitGetterOp)bindRenderbuffer }, |
9360 | | { prototypes::id::WebGL2RenderingContext }, |
9361 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9362 | | JSJitInfo::Method, |
9363 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9364 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9365 | | false, /* isInfallible. False in setters. */ |
9366 | | false, /* isMovable. Not relevant for setters. */ |
9367 | | false, /* isEliminatable. Not relevant for setters. */ |
9368 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9369 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9370 | | false, /* isTypedMethod. Only relevant for methods. */ |
9371 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9372 | | }; |
9373 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9374 | | static_assert(0 < 1, "There is no slot for us"); |
9375 | | |
9376 | | MOZ_CAN_RUN_SCRIPT static bool |
9377 | | bindTexture(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9378 | 0 | { |
9379 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.bindTexture", DOM, cx); |
9380 | 0 |
|
9381 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
9382 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.bindTexture"); |
9383 | 0 | } |
9384 | 0 | uint32_t arg0; |
9385 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9386 | 0 | return false; |
9387 | 0 | } |
9388 | 0 | mozilla::WebGLTexture* arg1; |
9389 | 0 | if (args[1].isObject()) { |
9390 | 0 | { |
9391 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTexture, mozilla::WebGLTexture>(args[1], arg1); |
9392 | 0 | if (NS_FAILED(rv)) { |
9393 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.bindTexture", "WebGLTexture"); |
9394 | 0 | return false; |
9395 | 0 | } |
9396 | 0 | } |
9397 | 0 | } else if (args[1].isNullOrUndefined()) { |
9398 | 0 | arg1 = nullptr; |
9399 | 0 | } else { |
9400 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.bindTexture"); |
9401 | 0 | return false; |
9402 | 0 | } |
9403 | 0 | self->BindTexture(arg0, MOZ_KnownLive(Constify(arg1))); |
9404 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9405 | 0 | args.rval().setUndefined(); |
9406 | 0 | return true; |
9407 | 0 | } |
9408 | | |
9409 | | static const JSJitInfo bindTexture_methodinfo = { |
9410 | | { (JSJitGetterOp)bindTexture }, |
9411 | | { prototypes::id::WebGL2RenderingContext }, |
9412 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9413 | | JSJitInfo::Method, |
9414 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9415 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9416 | | false, /* isInfallible. False in setters. */ |
9417 | | false, /* isMovable. Not relevant for setters. */ |
9418 | | false, /* isEliminatable. Not relevant for setters. */ |
9419 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9420 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9421 | | false, /* isTypedMethod. Only relevant for methods. */ |
9422 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9423 | | }; |
9424 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9425 | | static_assert(0 < 1, "There is no slot for us"); |
9426 | | |
9427 | | MOZ_CAN_RUN_SCRIPT static bool |
9428 | | blendColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9429 | 0 | { |
9430 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.blendColor", DOM, cx); |
9431 | 0 |
|
9432 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
9433 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.blendColor"); |
9434 | 0 | } |
9435 | 0 | float arg0; |
9436 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
9437 | 0 | return false; |
9438 | 0 | } |
9439 | 0 | float arg1; |
9440 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
9441 | 0 | return false; |
9442 | 0 | } |
9443 | 0 | float arg2; |
9444 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
9445 | 0 | return false; |
9446 | 0 | } |
9447 | 0 | float arg3; |
9448 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[3], &arg3)) { |
9449 | 0 | return false; |
9450 | 0 | } |
9451 | 0 | self->BlendColor(arg0, arg1, arg2, arg3); |
9452 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9453 | 0 | args.rval().setUndefined(); |
9454 | 0 | return true; |
9455 | 0 | } |
9456 | | |
9457 | | static const JSJitInfo blendColor_methodinfo = { |
9458 | | { (JSJitGetterOp)blendColor }, |
9459 | | { prototypes::id::WebGL2RenderingContext }, |
9460 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9461 | | JSJitInfo::Method, |
9462 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9463 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9464 | | false, /* isInfallible. False in setters. */ |
9465 | | false, /* isMovable. Not relevant for setters. */ |
9466 | | false, /* isEliminatable. Not relevant for setters. */ |
9467 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9468 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9469 | | false, /* isTypedMethod. Only relevant for methods. */ |
9470 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9471 | | }; |
9472 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9473 | | static_assert(0 < 1, "There is no slot for us"); |
9474 | | |
9475 | | MOZ_CAN_RUN_SCRIPT static bool |
9476 | | blendEquation(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9477 | 0 | { |
9478 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.blendEquation", DOM, cx); |
9479 | 0 |
|
9480 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9481 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.blendEquation"); |
9482 | 0 | } |
9483 | 0 | uint32_t arg0; |
9484 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9485 | 0 | return false; |
9486 | 0 | } |
9487 | 0 | self->BlendEquation(arg0); |
9488 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9489 | 0 | args.rval().setUndefined(); |
9490 | 0 | return true; |
9491 | 0 | } |
9492 | | |
9493 | | static const JSJitInfo blendEquation_methodinfo = { |
9494 | | { (JSJitGetterOp)blendEquation }, |
9495 | | { prototypes::id::WebGL2RenderingContext }, |
9496 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9497 | | JSJitInfo::Method, |
9498 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9499 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9500 | | false, /* isInfallible. False in setters. */ |
9501 | | false, /* isMovable. Not relevant for setters. */ |
9502 | | false, /* isEliminatable. Not relevant for setters. */ |
9503 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9504 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9505 | | false, /* isTypedMethod. Only relevant for methods. */ |
9506 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9507 | | }; |
9508 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9509 | | static_assert(0 < 1, "There is no slot for us"); |
9510 | | |
9511 | | MOZ_CAN_RUN_SCRIPT static bool |
9512 | | blendEquationSeparate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9513 | 0 | { |
9514 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.blendEquationSeparate", DOM, cx); |
9515 | 0 |
|
9516 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
9517 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.blendEquationSeparate"); |
9518 | 0 | } |
9519 | 0 | uint32_t arg0; |
9520 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9521 | 0 | return false; |
9522 | 0 | } |
9523 | 0 | uint32_t arg1; |
9524 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
9525 | 0 | return false; |
9526 | 0 | } |
9527 | 0 | self->BlendEquationSeparate(arg0, arg1); |
9528 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9529 | 0 | args.rval().setUndefined(); |
9530 | 0 | return true; |
9531 | 0 | } |
9532 | | |
9533 | | static const JSJitInfo blendEquationSeparate_methodinfo = { |
9534 | | { (JSJitGetterOp)blendEquationSeparate }, |
9535 | | { prototypes::id::WebGL2RenderingContext }, |
9536 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9537 | | JSJitInfo::Method, |
9538 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9539 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9540 | | false, /* isInfallible. False in setters. */ |
9541 | | false, /* isMovable. Not relevant for setters. */ |
9542 | | false, /* isEliminatable. Not relevant for setters. */ |
9543 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9544 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9545 | | false, /* isTypedMethod. Only relevant for methods. */ |
9546 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9547 | | }; |
9548 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9549 | | static_assert(0 < 1, "There is no slot for us"); |
9550 | | |
9551 | | MOZ_CAN_RUN_SCRIPT static bool |
9552 | | blendFunc(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9553 | 0 | { |
9554 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.blendFunc", DOM, cx); |
9555 | 0 |
|
9556 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
9557 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.blendFunc"); |
9558 | 0 | } |
9559 | 0 | uint32_t arg0; |
9560 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9561 | 0 | return false; |
9562 | 0 | } |
9563 | 0 | uint32_t arg1; |
9564 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
9565 | 0 | return false; |
9566 | 0 | } |
9567 | 0 | self->BlendFunc(arg0, arg1); |
9568 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9569 | 0 | args.rval().setUndefined(); |
9570 | 0 | return true; |
9571 | 0 | } |
9572 | | |
9573 | | static const JSJitInfo blendFunc_methodinfo = { |
9574 | | { (JSJitGetterOp)blendFunc }, |
9575 | | { prototypes::id::WebGL2RenderingContext }, |
9576 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9577 | | JSJitInfo::Method, |
9578 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9579 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9580 | | false, /* isInfallible. False in setters. */ |
9581 | | false, /* isMovable. Not relevant for setters. */ |
9582 | | false, /* isEliminatable. Not relevant for setters. */ |
9583 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9584 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9585 | | false, /* isTypedMethod. Only relevant for methods. */ |
9586 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9587 | | }; |
9588 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9589 | | static_assert(0 < 1, "There is no slot for us"); |
9590 | | |
9591 | | MOZ_CAN_RUN_SCRIPT static bool |
9592 | | blendFuncSeparate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9593 | 0 | { |
9594 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.blendFuncSeparate", DOM, cx); |
9595 | 0 |
|
9596 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
9597 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.blendFuncSeparate"); |
9598 | 0 | } |
9599 | 0 | uint32_t arg0; |
9600 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9601 | 0 | return false; |
9602 | 0 | } |
9603 | 0 | uint32_t arg1; |
9604 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
9605 | 0 | return false; |
9606 | 0 | } |
9607 | 0 | uint32_t arg2; |
9608 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
9609 | 0 | return false; |
9610 | 0 | } |
9611 | 0 | uint32_t arg3; |
9612 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
9613 | 0 | return false; |
9614 | 0 | } |
9615 | 0 | self->BlendFuncSeparate(arg0, arg1, arg2, arg3); |
9616 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9617 | 0 | args.rval().setUndefined(); |
9618 | 0 | return true; |
9619 | 0 | } |
9620 | | |
9621 | | static const JSJitInfo blendFuncSeparate_methodinfo = { |
9622 | | { (JSJitGetterOp)blendFuncSeparate }, |
9623 | | { prototypes::id::WebGL2RenderingContext }, |
9624 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9625 | | JSJitInfo::Method, |
9626 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9627 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9628 | | false, /* isInfallible. False in setters. */ |
9629 | | false, /* isMovable. Not relevant for setters. */ |
9630 | | false, /* isEliminatable. Not relevant for setters. */ |
9631 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9632 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9633 | | false, /* isTypedMethod. Only relevant for methods. */ |
9634 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9635 | | }; |
9636 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9637 | | static_assert(0 < 1, "There is no slot for us"); |
9638 | | |
9639 | | MOZ_CAN_RUN_SCRIPT static bool |
9640 | | checkFramebufferStatus(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9641 | 0 | { |
9642 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.checkFramebufferStatus", DOM, cx); |
9643 | 0 |
|
9644 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9645 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.checkFramebufferStatus"); |
9646 | 0 | } |
9647 | 0 | uint32_t arg0; |
9648 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9649 | 0 | return false; |
9650 | 0 | } |
9651 | 0 | uint32_t result(self->CheckFramebufferStatus(arg0)); |
9652 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9653 | 0 | args.rval().setNumber(result); |
9654 | 0 | return true; |
9655 | 0 | } |
9656 | | |
9657 | | static const JSJitInfo checkFramebufferStatus_methodinfo = { |
9658 | | { (JSJitGetterOp)checkFramebufferStatus }, |
9659 | | { prototypes::id::WebGL2RenderingContext }, |
9660 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9661 | | JSJitInfo::Method, |
9662 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9663 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
9664 | | false, /* isInfallible. False in setters. */ |
9665 | | false, /* isMovable. Not relevant for setters. */ |
9666 | | false, /* isEliminatable. Not relevant for setters. */ |
9667 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9668 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9669 | | false, /* isTypedMethod. Only relevant for methods. */ |
9670 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9671 | | }; |
9672 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9673 | | static_assert(0 < 1, "There is no slot for us"); |
9674 | | |
9675 | | MOZ_CAN_RUN_SCRIPT static bool |
9676 | | clear(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9677 | 0 | { |
9678 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clear", DOM, cx); |
9679 | 0 |
|
9680 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9681 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clear"); |
9682 | 0 | } |
9683 | 0 | uint32_t arg0; |
9684 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9685 | 0 | return false; |
9686 | 0 | } |
9687 | 0 | self->Clear(arg0); |
9688 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9689 | 0 | args.rval().setUndefined(); |
9690 | 0 | return true; |
9691 | 0 | } |
9692 | | |
9693 | | static const JSJitInfo clear_methodinfo = { |
9694 | | { (JSJitGetterOp)clear }, |
9695 | | { prototypes::id::WebGL2RenderingContext }, |
9696 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9697 | | JSJitInfo::Method, |
9698 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9699 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9700 | | false, /* isInfallible. False in setters. */ |
9701 | | false, /* isMovable. Not relevant for setters. */ |
9702 | | false, /* isEliminatable. Not relevant for setters. */ |
9703 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9704 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9705 | | false, /* isTypedMethod. Only relevant for methods. */ |
9706 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9707 | | }; |
9708 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9709 | | static_assert(0 < 1, "There is no slot for us"); |
9710 | | |
9711 | | MOZ_CAN_RUN_SCRIPT static bool |
9712 | | clearColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9713 | 0 | { |
9714 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clearColor", DOM, cx); |
9715 | 0 |
|
9716 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
9717 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clearColor"); |
9718 | 0 | } |
9719 | 0 | float arg0; |
9720 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
9721 | 0 | return false; |
9722 | 0 | } |
9723 | 0 | float arg1; |
9724 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
9725 | 0 | return false; |
9726 | 0 | } |
9727 | 0 | float arg2; |
9728 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
9729 | 0 | return false; |
9730 | 0 | } |
9731 | 0 | float arg3; |
9732 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[3], &arg3)) { |
9733 | 0 | return false; |
9734 | 0 | } |
9735 | 0 | self->ClearColor(arg0, arg1, arg2, arg3); |
9736 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9737 | 0 | args.rval().setUndefined(); |
9738 | 0 | return true; |
9739 | 0 | } |
9740 | | |
9741 | | static const JSJitInfo clearColor_methodinfo = { |
9742 | | { (JSJitGetterOp)clearColor }, |
9743 | | { prototypes::id::WebGL2RenderingContext }, |
9744 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9745 | | JSJitInfo::Method, |
9746 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9747 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9748 | | false, /* isInfallible. False in setters. */ |
9749 | | false, /* isMovable. Not relevant for setters. */ |
9750 | | false, /* isEliminatable. Not relevant for setters. */ |
9751 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9752 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9753 | | false, /* isTypedMethod. Only relevant for methods. */ |
9754 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9755 | | }; |
9756 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9757 | | static_assert(0 < 1, "There is no slot for us"); |
9758 | | |
9759 | | MOZ_CAN_RUN_SCRIPT static bool |
9760 | | clearDepth(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9761 | 0 | { |
9762 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clearDepth", DOM, cx); |
9763 | 0 |
|
9764 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9765 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clearDepth"); |
9766 | 0 | } |
9767 | 0 | float arg0; |
9768 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
9769 | 0 | return false; |
9770 | 0 | } |
9771 | 0 | self->ClearDepth(arg0); |
9772 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9773 | 0 | args.rval().setUndefined(); |
9774 | 0 | return true; |
9775 | 0 | } |
9776 | | |
9777 | | static const JSJitInfo clearDepth_methodinfo = { |
9778 | | { (JSJitGetterOp)clearDepth }, |
9779 | | { prototypes::id::WebGL2RenderingContext }, |
9780 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9781 | | JSJitInfo::Method, |
9782 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9783 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9784 | | false, /* isInfallible. False in setters. */ |
9785 | | false, /* isMovable. Not relevant for setters. */ |
9786 | | false, /* isEliminatable. Not relevant for setters. */ |
9787 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9788 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9789 | | false, /* isTypedMethod. Only relevant for methods. */ |
9790 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9791 | | }; |
9792 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9793 | | static_assert(0 < 1, "There is no slot for us"); |
9794 | | |
9795 | | MOZ_CAN_RUN_SCRIPT static bool |
9796 | | clearStencil(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9797 | 0 | { |
9798 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.clearStencil", DOM, cx); |
9799 | 0 |
|
9800 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9801 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.clearStencil"); |
9802 | 0 | } |
9803 | 0 | int32_t arg0; |
9804 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) { |
9805 | 0 | return false; |
9806 | 0 | } |
9807 | 0 | self->ClearStencil(arg0); |
9808 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9809 | 0 | args.rval().setUndefined(); |
9810 | 0 | return true; |
9811 | 0 | } |
9812 | | |
9813 | | static const JSJitInfo clearStencil_methodinfo = { |
9814 | | { (JSJitGetterOp)clearStencil }, |
9815 | | { prototypes::id::WebGL2RenderingContext }, |
9816 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9817 | | JSJitInfo::Method, |
9818 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9819 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9820 | | false, /* isInfallible. False in setters. */ |
9821 | | false, /* isMovable. Not relevant for setters. */ |
9822 | | false, /* isEliminatable. Not relevant for setters. */ |
9823 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9824 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9825 | | false, /* isTypedMethod. Only relevant for methods. */ |
9826 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9827 | | }; |
9828 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9829 | | static_assert(0 < 1, "There is no slot for us"); |
9830 | | |
9831 | | MOZ_CAN_RUN_SCRIPT static bool |
9832 | | colorMask(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9833 | 0 | { |
9834 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.colorMask", DOM, cx); |
9835 | 0 |
|
9836 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
9837 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.colorMask"); |
9838 | 0 | } |
9839 | 0 | bool arg0; |
9840 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) { |
9841 | 0 | return false; |
9842 | 0 | } |
9843 | 0 | bool arg1; |
9844 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
9845 | 0 | return false; |
9846 | 0 | } |
9847 | 0 | bool arg2; |
9848 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[2], &arg2)) { |
9849 | 0 | return false; |
9850 | 0 | } |
9851 | 0 | bool arg3; |
9852 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[3], &arg3)) { |
9853 | 0 | return false; |
9854 | 0 | } |
9855 | 0 | self->ColorMask(arg0, arg1, arg2, arg3); |
9856 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9857 | 0 | args.rval().setUndefined(); |
9858 | 0 | return true; |
9859 | 0 | } |
9860 | | |
9861 | | static const JSJitInfo colorMask_methodinfo = { |
9862 | | { (JSJitGetterOp)colorMask }, |
9863 | | { prototypes::id::WebGL2RenderingContext }, |
9864 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9865 | | JSJitInfo::Method, |
9866 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9867 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9868 | | false, /* isInfallible. False in setters. */ |
9869 | | false, /* isMovable. Not relevant for setters. */ |
9870 | | false, /* isEliminatable. Not relevant for setters. */ |
9871 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9872 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9873 | | false, /* isTypedMethod. Only relevant for methods. */ |
9874 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9875 | | }; |
9876 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9877 | | static_assert(0 < 1, "There is no slot for us"); |
9878 | | |
9879 | | MOZ_CAN_RUN_SCRIPT static bool |
9880 | | compileShader(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9881 | 0 | { |
9882 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.compileShader", DOM, cx); |
9883 | 0 |
|
9884 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
9885 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.compileShader"); |
9886 | 0 | } |
9887 | 0 | NonNull<mozilla::WebGLShader> arg0; |
9888 | 0 | if (args[0].isObject()) { |
9889 | 0 | { |
9890 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[0], arg0); |
9891 | 0 | if (NS_FAILED(rv)) { |
9892 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.compileShader", "WebGLShader"); |
9893 | 0 | return false; |
9894 | 0 | } |
9895 | 0 | } |
9896 | 0 | } else { |
9897 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.compileShader"); |
9898 | 0 | return false; |
9899 | 0 | } |
9900 | 0 | self->CompileShader(MOZ_KnownLive(NonNullHelper(arg0))); |
9901 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9902 | 0 | args.rval().setUndefined(); |
9903 | 0 | return true; |
9904 | 0 | } |
9905 | | |
9906 | | static const JSJitInfo compileShader_methodinfo = { |
9907 | | { (JSJitGetterOp)compileShader }, |
9908 | | { prototypes::id::WebGL2RenderingContext }, |
9909 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9910 | | JSJitInfo::Method, |
9911 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9912 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9913 | | false, /* isInfallible. False in setters. */ |
9914 | | false, /* isMovable. Not relevant for setters. */ |
9915 | | false, /* isEliminatable. Not relevant for setters. */ |
9916 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9917 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9918 | | false, /* isTypedMethod. Only relevant for methods. */ |
9919 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9920 | | }; |
9921 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9922 | | static_assert(0 < 1, "There is no slot for us"); |
9923 | | |
9924 | | MOZ_CAN_RUN_SCRIPT static bool |
9925 | | copyTexImage2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9926 | 0 | { |
9927 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.copyTexImage2D", DOM, cx); |
9928 | 0 |
|
9929 | 0 | if (MOZ_UNLIKELY(args.length() < 8)) { |
9930 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.copyTexImage2D"); |
9931 | 0 | } |
9932 | 0 | uint32_t arg0; |
9933 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9934 | 0 | return false; |
9935 | 0 | } |
9936 | 0 | int32_t arg1; |
9937 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
9938 | 0 | return false; |
9939 | 0 | } |
9940 | 0 | uint32_t arg2; |
9941 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
9942 | 0 | return false; |
9943 | 0 | } |
9944 | 0 | int32_t arg3; |
9945 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
9946 | 0 | return false; |
9947 | 0 | } |
9948 | 0 | int32_t arg4; |
9949 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
9950 | 0 | return false; |
9951 | 0 | } |
9952 | 0 | int32_t arg5; |
9953 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
9954 | 0 | return false; |
9955 | 0 | } |
9956 | 0 | int32_t arg6; |
9957 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
9958 | 0 | return false; |
9959 | 0 | } |
9960 | 0 | int32_t arg7; |
9961 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
9962 | 0 | return false; |
9963 | 0 | } |
9964 | 0 | self->CopyTexImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); |
9965 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
9966 | 0 | args.rval().setUndefined(); |
9967 | 0 | return true; |
9968 | 0 | } |
9969 | | |
9970 | | static const JSJitInfo copyTexImage2D_methodinfo = { |
9971 | | { (JSJitGetterOp)copyTexImage2D }, |
9972 | | { prototypes::id::WebGL2RenderingContext }, |
9973 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
9974 | | JSJitInfo::Method, |
9975 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
9976 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
9977 | | false, /* isInfallible. False in setters. */ |
9978 | | false, /* isMovable. Not relevant for setters. */ |
9979 | | false, /* isEliminatable. Not relevant for setters. */ |
9980 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
9981 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
9982 | | false, /* isTypedMethod. Only relevant for methods. */ |
9983 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
9984 | | }; |
9985 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
9986 | | static_assert(0 < 1, "There is no slot for us"); |
9987 | | |
9988 | | MOZ_CAN_RUN_SCRIPT static bool |
9989 | | copyTexSubImage2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
9990 | 0 | { |
9991 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.copyTexSubImage2D", DOM, cx); |
9992 | 0 |
|
9993 | 0 | if (MOZ_UNLIKELY(args.length() < 8)) { |
9994 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.copyTexSubImage2D"); |
9995 | 0 | } |
9996 | 0 | uint32_t arg0; |
9997 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
9998 | 0 | return false; |
9999 | 0 | } |
10000 | 0 | int32_t arg1; |
10001 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
10002 | 0 | return false; |
10003 | 0 | } |
10004 | 0 | int32_t arg2; |
10005 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
10006 | 0 | return false; |
10007 | 0 | } |
10008 | 0 | int32_t arg3; |
10009 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
10010 | 0 | return false; |
10011 | 0 | } |
10012 | 0 | int32_t arg4; |
10013 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
10014 | 0 | return false; |
10015 | 0 | } |
10016 | 0 | int32_t arg5; |
10017 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) { |
10018 | 0 | return false; |
10019 | 0 | } |
10020 | 0 | int32_t arg6; |
10021 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) { |
10022 | 0 | return false; |
10023 | 0 | } |
10024 | 0 | int32_t arg7; |
10025 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) { |
10026 | 0 | return false; |
10027 | 0 | } |
10028 | 0 | self->CopyTexSubImage2D(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); |
10029 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10030 | 0 | args.rval().setUndefined(); |
10031 | 0 | return true; |
10032 | 0 | } |
10033 | | |
10034 | | static const JSJitInfo copyTexSubImage2D_methodinfo = { |
10035 | | { (JSJitGetterOp)copyTexSubImage2D }, |
10036 | | { prototypes::id::WebGL2RenderingContext }, |
10037 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10038 | | JSJitInfo::Method, |
10039 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10040 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10041 | | false, /* isInfallible. False in setters. */ |
10042 | | false, /* isMovable. Not relevant for setters. */ |
10043 | | false, /* isEliminatable. Not relevant for setters. */ |
10044 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10045 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10046 | | false, /* isTypedMethod. Only relevant for methods. */ |
10047 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10048 | | }; |
10049 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10050 | | static_assert(0 < 1, "There is no slot for us"); |
10051 | | |
10052 | | MOZ_CAN_RUN_SCRIPT static bool |
10053 | | createBuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10054 | 0 | { |
10055 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createBuffer", DOM, cx); |
10056 | 0 |
|
10057 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLBuffer>(self->CreateBuffer())); |
10058 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10059 | 0 | if (!result) { |
10060 | 0 | args.rval().setNull(); |
10061 | 0 | return true; |
10062 | 0 | } |
10063 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
10064 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
10065 | 0 | return false; |
10066 | 0 | } |
10067 | 0 | return true; |
10068 | 0 | } |
10069 | | |
10070 | | static const JSJitInfo createBuffer_methodinfo = { |
10071 | | { (JSJitGetterOp)createBuffer }, |
10072 | | { prototypes::id::WebGL2RenderingContext }, |
10073 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10074 | | JSJitInfo::Method, |
10075 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10076 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
10077 | | false, /* isInfallible. False in setters. */ |
10078 | | false, /* isMovable. Not relevant for setters. */ |
10079 | | false, /* isEliminatable. Not relevant for setters. */ |
10080 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10081 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10082 | | false, /* isTypedMethod. Only relevant for methods. */ |
10083 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10084 | | }; |
10085 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10086 | | static_assert(0 < 1, "There is no slot for us"); |
10087 | | |
10088 | | MOZ_CAN_RUN_SCRIPT static bool |
10089 | | createFramebuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10090 | 0 | { |
10091 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createFramebuffer", DOM, cx); |
10092 | 0 |
|
10093 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLFramebuffer>(self->CreateFramebuffer())); |
10094 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10095 | 0 | if (!result) { |
10096 | 0 | args.rval().setNull(); |
10097 | 0 | return true; |
10098 | 0 | } |
10099 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
10100 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
10101 | 0 | return false; |
10102 | 0 | } |
10103 | 0 | return true; |
10104 | 0 | } |
10105 | | |
10106 | | static const JSJitInfo createFramebuffer_methodinfo = { |
10107 | | { (JSJitGetterOp)createFramebuffer }, |
10108 | | { prototypes::id::WebGL2RenderingContext }, |
10109 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10110 | | JSJitInfo::Method, |
10111 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10112 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
10113 | | false, /* isInfallible. False in setters. */ |
10114 | | false, /* isMovable. Not relevant for setters. */ |
10115 | | false, /* isEliminatable. Not relevant for setters. */ |
10116 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10117 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10118 | | false, /* isTypedMethod. Only relevant for methods. */ |
10119 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10120 | | }; |
10121 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10122 | | static_assert(0 < 1, "There is no slot for us"); |
10123 | | |
10124 | | MOZ_CAN_RUN_SCRIPT static bool |
10125 | | createProgram(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10126 | 0 | { |
10127 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createProgram", DOM, cx); |
10128 | 0 |
|
10129 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLProgram>(self->CreateProgram())); |
10130 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10131 | 0 | if (!result) { |
10132 | 0 | args.rval().setNull(); |
10133 | 0 | return true; |
10134 | 0 | } |
10135 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
10136 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
10137 | 0 | return false; |
10138 | 0 | } |
10139 | 0 | return true; |
10140 | 0 | } |
10141 | | |
10142 | | static const JSJitInfo createProgram_methodinfo = { |
10143 | | { (JSJitGetterOp)createProgram }, |
10144 | | { prototypes::id::WebGL2RenderingContext }, |
10145 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10146 | | JSJitInfo::Method, |
10147 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10148 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
10149 | | false, /* isInfallible. False in setters. */ |
10150 | | false, /* isMovable. Not relevant for setters. */ |
10151 | | false, /* isEliminatable. Not relevant for setters. */ |
10152 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10153 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10154 | | false, /* isTypedMethod. Only relevant for methods. */ |
10155 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10156 | | }; |
10157 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10158 | | static_assert(0 < 1, "There is no slot for us"); |
10159 | | |
10160 | | MOZ_CAN_RUN_SCRIPT static bool |
10161 | | createRenderbuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10162 | 0 | { |
10163 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createRenderbuffer", DOM, cx); |
10164 | 0 |
|
10165 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLRenderbuffer>(self->CreateRenderbuffer())); |
10166 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10167 | 0 | if (!result) { |
10168 | 0 | args.rval().setNull(); |
10169 | 0 | return true; |
10170 | 0 | } |
10171 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
10172 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
10173 | 0 | return false; |
10174 | 0 | } |
10175 | 0 | return true; |
10176 | 0 | } |
10177 | | |
10178 | | static const JSJitInfo createRenderbuffer_methodinfo = { |
10179 | | { (JSJitGetterOp)createRenderbuffer }, |
10180 | | { prototypes::id::WebGL2RenderingContext }, |
10181 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10182 | | JSJitInfo::Method, |
10183 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10184 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
10185 | | false, /* isInfallible. False in setters. */ |
10186 | | false, /* isMovable. Not relevant for setters. */ |
10187 | | false, /* isEliminatable. Not relevant for setters. */ |
10188 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10189 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10190 | | false, /* isTypedMethod. Only relevant for methods. */ |
10191 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10192 | | }; |
10193 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10194 | | static_assert(0 < 1, "There is no slot for us"); |
10195 | | |
10196 | | MOZ_CAN_RUN_SCRIPT static bool |
10197 | | createShader(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10198 | 0 | { |
10199 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createShader", DOM, cx); |
10200 | 0 |
|
10201 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10202 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.createShader"); |
10203 | 0 | } |
10204 | 0 | uint32_t arg0; |
10205 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10206 | 0 | return false; |
10207 | 0 | } |
10208 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLShader>(self->CreateShader(arg0))); |
10209 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10210 | 0 | if (!result) { |
10211 | 0 | args.rval().setNull(); |
10212 | 0 | return true; |
10213 | 0 | } |
10214 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
10215 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
10216 | 0 | return false; |
10217 | 0 | } |
10218 | 0 | return true; |
10219 | 0 | } |
10220 | | |
10221 | | static const JSJitInfo createShader_methodinfo = { |
10222 | | { (JSJitGetterOp)createShader }, |
10223 | | { prototypes::id::WebGL2RenderingContext }, |
10224 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10225 | | JSJitInfo::Method, |
10226 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10227 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
10228 | | false, /* isInfallible. False in setters. */ |
10229 | | false, /* isMovable. Not relevant for setters. */ |
10230 | | false, /* isEliminatable. Not relevant for setters. */ |
10231 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10232 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10233 | | false, /* isTypedMethod. Only relevant for methods. */ |
10234 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10235 | | }; |
10236 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10237 | | static_assert(0 < 1, "There is no slot for us"); |
10238 | | |
10239 | | MOZ_CAN_RUN_SCRIPT static bool |
10240 | | createTexture(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10241 | 0 | { |
10242 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.createTexture", DOM, cx); |
10243 | 0 |
|
10244 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLTexture>(self->CreateTexture())); |
10245 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10246 | 0 | if (!result) { |
10247 | 0 | args.rval().setNull(); |
10248 | 0 | return true; |
10249 | 0 | } |
10250 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
10251 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
10252 | 0 | return false; |
10253 | 0 | } |
10254 | 0 | return true; |
10255 | 0 | } |
10256 | | |
10257 | | static const JSJitInfo createTexture_methodinfo = { |
10258 | | { (JSJitGetterOp)createTexture }, |
10259 | | { prototypes::id::WebGL2RenderingContext }, |
10260 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10261 | | JSJitInfo::Method, |
10262 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10263 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
10264 | | false, /* isInfallible. False in setters. */ |
10265 | | false, /* isMovable. Not relevant for setters. */ |
10266 | | false, /* isEliminatable. Not relevant for setters. */ |
10267 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10268 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10269 | | false, /* isTypedMethod. Only relevant for methods. */ |
10270 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10271 | | }; |
10272 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10273 | | static_assert(0 < 1, "There is no slot for us"); |
10274 | | |
10275 | | MOZ_CAN_RUN_SCRIPT static bool |
10276 | | cullFace(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10277 | 0 | { |
10278 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.cullFace", DOM, cx); |
10279 | 0 |
|
10280 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10281 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.cullFace"); |
10282 | 0 | } |
10283 | 0 | uint32_t arg0; |
10284 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10285 | 0 | return false; |
10286 | 0 | } |
10287 | 0 | self->CullFace(arg0); |
10288 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10289 | 0 | args.rval().setUndefined(); |
10290 | 0 | return true; |
10291 | 0 | } |
10292 | | |
10293 | | static const JSJitInfo cullFace_methodinfo = { |
10294 | | { (JSJitGetterOp)cullFace }, |
10295 | | { prototypes::id::WebGL2RenderingContext }, |
10296 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10297 | | JSJitInfo::Method, |
10298 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10299 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10300 | | false, /* isInfallible. False in setters. */ |
10301 | | false, /* isMovable. Not relevant for setters. */ |
10302 | | false, /* isEliminatable. Not relevant for setters. */ |
10303 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10304 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10305 | | false, /* isTypedMethod. Only relevant for methods. */ |
10306 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10307 | | }; |
10308 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10309 | | static_assert(0 < 1, "There is no slot for us"); |
10310 | | |
10311 | | MOZ_CAN_RUN_SCRIPT static bool |
10312 | | deleteBuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10313 | 0 | { |
10314 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteBuffer", DOM, cx); |
10315 | 0 |
|
10316 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10317 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteBuffer"); |
10318 | 0 | } |
10319 | 0 | mozilla::WebGLBuffer* arg0; |
10320 | 0 | if (args[0].isObject()) { |
10321 | 0 | { |
10322 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLBuffer, mozilla::WebGLBuffer>(args[0], arg0); |
10323 | 0 | if (NS_FAILED(rv)) { |
10324 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteBuffer", "WebGLBuffer"); |
10325 | 0 | return false; |
10326 | 0 | } |
10327 | 0 | } |
10328 | 0 | } else if (args[0].isNullOrUndefined()) { |
10329 | 0 | arg0 = nullptr; |
10330 | 0 | } else { |
10331 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteBuffer"); |
10332 | 0 | return false; |
10333 | 0 | } |
10334 | 0 | self->DeleteBuffer(MOZ_KnownLive(Constify(arg0))); |
10335 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10336 | 0 | args.rval().setUndefined(); |
10337 | 0 | return true; |
10338 | 0 | } |
10339 | | |
10340 | | static const JSJitInfo deleteBuffer_methodinfo = { |
10341 | | { (JSJitGetterOp)deleteBuffer }, |
10342 | | { prototypes::id::WebGL2RenderingContext }, |
10343 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10344 | | JSJitInfo::Method, |
10345 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10346 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10347 | | false, /* isInfallible. False in setters. */ |
10348 | | false, /* isMovable. Not relevant for setters. */ |
10349 | | false, /* isEliminatable. Not relevant for setters. */ |
10350 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10351 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10352 | | false, /* isTypedMethod. Only relevant for methods. */ |
10353 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10354 | | }; |
10355 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10356 | | static_assert(0 < 1, "There is no slot for us"); |
10357 | | |
10358 | | MOZ_CAN_RUN_SCRIPT static bool |
10359 | | deleteFramebuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10360 | 0 | { |
10361 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteFramebuffer", DOM, cx); |
10362 | 0 |
|
10363 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10364 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteFramebuffer"); |
10365 | 0 | } |
10366 | 0 | mozilla::WebGLFramebuffer* arg0; |
10367 | 0 | if (args[0].isObject()) { |
10368 | 0 | { |
10369 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLFramebuffer, mozilla::WebGLFramebuffer>(args[0], arg0); |
10370 | 0 | if (NS_FAILED(rv)) { |
10371 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteFramebuffer", "WebGLFramebuffer"); |
10372 | 0 | return false; |
10373 | 0 | } |
10374 | 0 | } |
10375 | 0 | } else if (args[0].isNullOrUndefined()) { |
10376 | 0 | arg0 = nullptr; |
10377 | 0 | } else { |
10378 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteFramebuffer"); |
10379 | 0 | return false; |
10380 | 0 | } |
10381 | 0 | self->DeleteFramebuffer(MOZ_KnownLive(Constify(arg0))); |
10382 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10383 | 0 | args.rval().setUndefined(); |
10384 | 0 | return true; |
10385 | 0 | } |
10386 | | |
10387 | | static const JSJitInfo deleteFramebuffer_methodinfo = { |
10388 | | { (JSJitGetterOp)deleteFramebuffer }, |
10389 | | { prototypes::id::WebGL2RenderingContext }, |
10390 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10391 | | JSJitInfo::Method, |
10392 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10393 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10394 | | false, /* isInfallible. False in setters. */ |
10395 | | false, /* isMovable. Not relevant for setters. */ |
10396 | | false, /* isEliminatable. Not relevant for setters. */ |
10397 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10398 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10399 | | false, /* isTypedMethod. Only relevant for methods. */ |
10400 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10401 | | }; |
10402 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10403 | | static_assert(0 < 1, "There is no slot for us"); |
10404 | | |
10405 | | MOZ_CAN_RUN_SCRIPT static bool |
10406 | | deleteProgram(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10407 | 0 | { |
10408 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteProgram", DOM, cx); |
10409 | 0 |
|
10410 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10411 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteProgram"); |
10412 | 0 | } |
10413 | 0 | mozilla::WebGLProgram* arg0; |
10414 | 0 | if (args[0].isObject()) { |
10415 | 0 | { |
10416 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
10417 | 0 | if (NS_FAILED(rv)) { |
10418 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteProgram", "WebGLProgram"); |
10419 | 0 | return false; |
10420 | 0 | } |
10421 | 0 | } |
10422 | 0 | } else if (args[0].isNullOrUndefined()) { |
10423 | 0 | arg0 = nullptr; |
10424 | 0 | } else { |
10425 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteProgram"); |
10426 | 0 | return false; |
10427 | 0 | } |
10428 | 0 | self->DeleteProgram(MOZ_KnownLive(Constify(arg0))); |
10429 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10430 | 0 | args.rval().setUndefined(); |
10431 | 0 | return true; |
10432 | 0 | } |
10433 | | |
10434 | | static const JSJitInfo deleteProgram_methodinfo = { |
10435 | | { (JSJitGetterOp)deleteProgram }, |
10436 | | { prototypes::id::WebGL2RenderingContext }, |
10437 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10438 | | JSJitInfo::Method, |
10439 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10440 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10441 | | false, /* isInfallible. False in setters. */ |
10442 | | false, /* isMovable. Not relevant for setters. */ |
10443 | | false, /* isEliminatable. Not relevant for setters. */ |
10444 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10445 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10446 | | false, /* isTypedMethod. Only relevant for methods. */ |
10447 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10448 | | }; |
10449 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10450 | | static_assert(0 < 1, "There is no slot for us"); |
10451 | | |
10452 | | MOZ_CAN_RUN_SCRIPT static bool |
10453 | | deleteRenderbuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10454 | 0 | { |
10455 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteRenderbuffer", DOM, cx); |
10456 | 0 |
|
10457 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10458 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteRenderbuffer"); |
10459 | 0 | } |
10460 | 0 | mozilla::WebGLRenderbuffer* arg0; |
10461 | 0 | if (args[0].isObject()) { |
10462 | 0 | { |
10463 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLRenderbuffer, mozilla::WebGLRenderbuffer>(args[0], arg0); |
10464 | 0 | if (NS_FAILED(rv)) { |
10465 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteRenderbuffer", "WebGLRenderbuffer"); |
10466 | 0 | return false; |
10467 | 0 | } |
10468 | 0 | } |
10469 | 0 | } else if (args[0].isNullOrUndefined()) { |
10470 | 0 | arg0 = nullptr; |
10471 | 0 | } else { |
10472 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteRenderbuffer"); |
10473 | 0 | return false; |
10474 | 0 | } |
10475 | 0 | self->DeleteRenderbuffer(MOZ_KnownLive(Constify(arg0))); |
10476 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10477 | 0 | args.rval().setUndefined(); |
10478 | 0 | return true; |
10479 | 0 | } |
10480 | | |
10481 | | static const JSJitInfo deleteRenderbuffer_methodinfo = { |
10482 | | { (JSJitGetterOp)deleteRenderbuffer }, |
10483 | | { prototypes::id::WebGL2RenderingContext }, |
10484 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10485 | | JSJitInfo::Method, |
10486 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10487 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10488 | | false, /* isInfallible. False in setters. */ |
10489 | | false, /* isMovable. Not relevant for setters. */ |
10490 | | false, /* isEliminatable. Not relevant for setters. */ |
10491 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10492 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10493 | | false, /* isTypedMethod. Only relevant for methods. */ |
10494 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10495 | | }; |
10496 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10497 | | static_assert(0 < 1, "There is no slot for us"); |
10498 | | |
10499 | | MOZ_CAN_RUN_SCRIPT static bool |
10500 | | deleteShader(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10501 | 0 | { |
10502 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteShader", DOM, cx); |
10503 | 0 |
|
10504 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10505 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteShader"); |
10506 | 0 | } |
10507 | 0 | mozilla::WebGLShader* arg0; |
10508 | 0 | if (args[0].isObject()) { |
10509 | 0 | { |
10510 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[0], arg0); |
10511 | 0 | if (NS_FAILED(rv)) { |
10512 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteShader", "WebGLShader"); |
10513 | 0 | return false; |
10514 | 0 | } |
10515 | 0 | } |
10516 | 0 | } else if (args[0].isNullOrUndefined()) { |
10517 | 0 | arg0 = nullptr; |
10518 | 0 | } else { |
10519 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteShader"); |
10520 | 0 | return false; |
10521 | 0 | } |
10522 | 0 | self->DeleteShader(MOZ_KnownLive(Constify(arg0))); |
10523 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10524 | 0 | args.rval().setUndefined(); |
10525 | 0 | return true; |
10526 | 0 | } |
10527 | | |
10528 | | static const JSJitInfo deleteShader_methodinfo = { |
10529 | | { (JSJitGetterOp)deleteShader }, |
10530 | | { prototypes::id::WebGL2RenderingContext }, |
10531 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10532 | | JSJitInfo::Method, |
10533 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10534 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10535 | | false, /* isInfallible. False in setters. */ |
10536 | | false, /* isMovable. Not relevant for setters. */ |
10537 | | false, /* isEliminatable. Not relevant for setters. */ |
10538 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10539 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10540 | | false, /* isTypedMethod. Only relevant for methods. */ |
10541 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10542 | | }; |
10543 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10544 | | static_assert(0 < 1, "There is no slot for us"); |
10545 | | |
10546 | | MOZ_CAN_RUN_SCRIPT static bool |
10547 | | deleteTexture(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10548 | 0 | { |
10549 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.deleteTexture", DOM, cx); |
10550 | 0 |
|
10551 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10552 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.deleteTexture"); |
10553 | 0 | } |
10554 | 0 | mozilla::WebGLTexture* arg0; |
10555 | 0 | if (args[0].isObject()) { |
10556 | 0 | { |
10557 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTexture, mozilla::WebGLTexture>(args[0], arg0); |
10558 | 0 | if (NS_FAILED(rv)) { |
10559 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.deleteTexture", "WebGLTexture"); |
10560 | 0 | return false; |
10561 | 0 | } |
10562 | 0 | } |
10563 | 0 | } else if (args[0].isNullOrUndefined()) { |
10564 | 0 | arg0 = nullptr; |
10565 | 0 | } else { |
10566 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.deleteTexture"); |
10567 | 0 | return false; |
10568 | 0 | } |
10569 | 0 | self->DeleteTexture(MOZ_KnownLive(Constify(arg0))); |
10570 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10571 | 0 | args.rval().setUndefined(); |
10572 | 0 | return true; |
10573 | 0 | } |
10574 | | |
10575 | | static const JSJitInfo deleteTexture_methodinfo = { |
10576 | | { (JSJitGetterOp)deleteTexture }, |
10577 | | { prototypes::id::WebGL2RenderingContext }, |
10578 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10579 | | JSJitInfo::Method, |
10580 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10581 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10582 | | false, /* isInfallible. False in setters. */ |
10583 | | false, /* isMovable. Not relevant for setters. */ |
10584 | | false, /* isEliminatable. Not relevant for setters. */ |
10585 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10586 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10587 | | false, /* isTypedMethod. Only relevant for methods. */ |
10588 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10589 | | }; |
10590 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10591 | | static_assert(0 < 1, "There is no slot for us"); |
10592 | | |
10593 | | MOZ_CAN_RUN_SCRIPT static bool |
10594 | | depthFunc(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10595 | 0 | { |
10596 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.depthFunc", DOM, cx); |
10597 | 0 |
|
10598 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10599 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.depthFunc"); |
10600 | 0 | } |
10601 | 0 | uint32_t arg0; |
10602 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10603 | 0 | return false; |
10604 | 0 | } |
10605 | 0 | self->DepthFunc(arg0); |
10606 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10607 | 0 | args.rval().setUndefined(); |
10608 | 0 | return true; |
10609 | 0 | } |
10610 | | |
10611 | | static const JSJitInfo depthFunc_methodinfo = { |
10612 | | { (JSJitGetterOp)depthFunc }, |
10613 | | { prototypes::id::WebGL2RenderingContext }, |
10614 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10615 | | JSJitInfo::Method, |
10616 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10617 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10618 | | false, /* isInfallible. False in setters. */ |
10619 | | false, /* isMovable. Not relevant for setters. */ |
10620 | | false, /* isEliminatable. Not relevant for setters. */ |
10621 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10622 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10623 | | false, /* isTypedMethod. Only relevant for methods. */ |
10624 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10625 | | }; |
10626 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10627 | | static_assert(0 < 1, "There is no slot for us"); |
10628 | | |
10629 | | MOZ_CAN_RUN_SCRIPT static bool |
10630 | | depthMask(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10631 | 0 | { |
10632 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.depthMask", DOM, cx); |
10633 | 0 |
|
10634 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10635 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.depthMask"); |
10636 | 0 | } |
10637 | 0 | bool arg0; |
10638 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) { |
10639 | 0 | return false; |
10640 | 0 | } |
10641 | 0 | self->DepthMask(arg0); |
10642 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10643 | 0 | args.rval().setUndefined(); |
10644 | 0 | return true; |
10645 | 0 | } |
10646 | | |
10647 | | static const JSJitInfo depthMask_methodinfo = { |
10648 | | { (JSJitGetterOp)depthMask }, |
10649 | | { prototypes::id::WebGL2RenderingContext }, |
10650 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10651 | | JSJitInfo::Method, |
10652 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10653 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10654 | | false, /* isInfallible. False in setters. */ |
10655 | | false, /* isMovable. Not relevant for setters. */ |
10656 | | false, /* isEliminatable. Not relevant for setters. */ |
10657 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10658 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10659 | | false, /* isTypedMethod. Only relevant for methods. */ |
10660 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10661 | | }; |
10662 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10663 | | static_assert(0 < 1, "There is no slot for us"); |
10664 | | |
10665 | | MOZ_CAN_RUN_SCRIPT static bool |
10666 | | depthRange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10667 | 0 | { |
10668 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.depthRange", DOM, cx); |
10669 | 0 |
|
10670 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
10671 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.depthRange"); |
10672 | 0 | } |
10673 | 0 | float arg0; |
10674 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
10675 | 0 | return false; |
10676 | 0 | } |
10677 | 0 | float arg1; |
10678 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
10679 | 0 | return false; |
10680 | 0 | } |
10681 | 0 | self->DepthRange(arg0, arg1); |
10682 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10683 | 0 | args.rval().setUndefined(); |
10684 | 0 | return true; |
10685 | 0 | } |
10686 | | |
10687 | | static const JSJitInfo depthRange_methodinfo = { |
10688 | | { (JSJitGetterOp)depthRange }, |
10689 | | { prototypes::id::WebGL2RenderingContext }, |
10690 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10691 | | JSJitInfo::Method, |
10692 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10693 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10694 | | false, /* isInfallible. False in setters. */ |
10695 | | false, /* isMovable. Not relevant for setters. */ |
10696 | | false, /* isEliminatable. Not relevant for setters. */ |
10697 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10698 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10699 | | false, /* isTypedMethod. Only relevant for methods. */ |
10700 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10701 | | }; |
10702 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10703 | | static_assert(0 < 1, "There is no slot for us"); |
10704 | | |
10705 | | MOZ_CAN_RUN_SCRIPT static bool |
10706 | | detachShader(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10707 | 0 | { |
10708 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.detachShader", DOM, cx); |
10709 | 0 |
|
10710 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
10711 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.detachShader"); |
10712 | 0 | } |
10713 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
10714 | 0 | if (args[0].isObject()) { |
10715 | 0 | { |
10716 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
10717 | 0 | if (NS_FAILED(rv)) { |
10718 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.detachShader", "WebGLProgram"); |
10719 | 0 | return false; |
10720 | 0 | } |
10721 | 0 | } |
10722 | 0 | } else { |
10723 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.detachShader"); |
10724 | 0 | return false; |
10725 | 0 | } |
10726 | 0 | NonNull<mozilla::WebGLShader> arg1; |
10727 | 0 | if (args[1].isObject()) { |
10728 | 0 | { |
10729 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[1], arg1); |
10730 | 0 | if (NS_FAILED(rv)) { |
10731 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.detachShader", "WebGLShader"); |
10732 | 0 | return false; |
10733 | 0 | } |
10734 | 0 | } |
10735 | 0 | } else { |
10736 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.detachShader"); |
10737 | 0 | return false; |
10738 | 0 | } |
10739 | 0 | self->DetachShader(MOZ_KnownLive(NonNullHelper(arg0)), MOZ_KnownLive(NonNullHelper(arg1))); |
10740 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10741 | 0 | args.rval().setUndefined(); |
10742 | 0 | return true; |
10743 | 0 | } |
10744 | | |
10745 | | static const JSJitInfo detachShader_methodinfo = { |
10746 | | { (JSJitGetterOp)detachShader }, |
10747 | | { prototypes::id::WebGL2RenderingContext }, |
10748 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10749 | | JSJitInfo::Method, |
10750 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10751 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10752 | | false, /* isInfallible. False in setters. */ |
10753 | | false, /* isMovable. Not relevant for setters. */ |
10754 | | false, /* isEliminatable. Not relevant for setters. */ |
10755 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10756 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10757 | | false, /* isTypedMethod. Only relevant for methods. */ |
10758 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10759 | | }; |
10760 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10761 | | static_assert(0 < 1, "There is no slot for us"); |
10762 | | |
10763 | | MOZ_CAN_RUN_SCRIPT static bool |
10764 | | disable(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10765 | 0 | { |
10766 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.disable", DOM, cx); |
10767 | 0 |
|
10768 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10769 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.disable"); |
10770 | 0 | } |
10771 | 0 | uint32_t arg0; |
10772 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10773 | 0 | return false; |
10774 | 0 | } |
10775 | 0 | self->Disable(arg0); |
10776 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10777 | 0 | args.rval().setUndefined(); |
10778 | 0 | return true; |
10779 | 0 | } |
10780 | | |
10781 | | static const JSJitInfo disable_methodinfo = { |
10782 | | { (JSJitGetterOp)disable }, |
10783 | | { prototypes::id::WebGL2RenderingContext }, |
10784 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10785 | | JSJitInfo::Method, |
10786 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10787 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10788 | | false, /* isInfallible. False in setters. */ |
10789 | | false, /* isMovable. Not relevant for setters. */ |
10790 | | false, /* isEliminatable. Not relevant for setters. */ |
10791 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10792 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10793 | | false, /* isTypedMethod. Only relevant for methods. */ |
10794 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10795 | | }; |
10796 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10797 | | static_assert(0 < 1, "There is no slot for us"); |
10798 | | |
10799 | | MOZ_CAN_RUN_SCRIPT static bool |
10800 | | disableVertexAttribArray(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10801 | 0 | { |
10802 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.disableVertexAttribArray", DOM, cx); |
10803 | 0 |
|
10804 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10805 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.disableVertexAttribArray"); |
10806 | 0 | } |
10807 | 0 | uint32_t arg0; |
10808 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10809 | 0 | return false; |
10810 | 0 | } |
10811 | 0 | self->DisableVertexAttribArray(arg0); |
10812 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10813 | 0 | args.rval().setUndefined(); |
10814 | 0 | return true; |
10815 | 0 | } |
10816 | | |
10817 | | static const JSJitInfo disableVertexAttribArray_methodinfo = { |
10818 | | { (JSJitGetterOp)disableVertexAttribArray }, |
10819 | | { prototypes::id::WebGL2RenderingContext }, |
10820 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10821 | | JSJitInfo::Method, |
10822 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10823 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10824 | | false, /* isInfallible. False in setters. */ |
10825 | | false, /* isMovable. Not relevant for setters. */ |
10826 | | false, /* isEliminatable. Not relevant for setters. */ |
10827 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10828 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10829 | | false, /* isTypedMethod. Only relevant for methods. */ |
10830 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10831 | | }; |
10832 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10833 | | static_assert(0 < 1, "There is no slot for us"); |
10834 | | |
10835 | | MOZ_CAN_RUN_SCRIPT static bool |
10836 | | drawArrays(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10837 | 0 | { |
10838 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.drawArrays", DOM, cx); |
10839 | 0 |
|
10840 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
10841 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.drawArrays"); |
10842 | 0 | } |
10843 | 0 | uint32_t arg0; |
10844 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10845 | 0 | return false; |
10846 | 0 | } |
10847 | 0 | int32_t arg1; |
10848 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
10849 | 0 | return false; |
10850 | 0 | } |
10851 | 0 | int32_t arg2; |
10852 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
10853 | 0 | return false; |
10854 | 0 | } |
10855 | 0 | self->DrawArrays(arg0, arg1, arg2); |
10856 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10857 | 0 | args.rval().setUndefined(); |
10858 | 0 | return true; |
10859 | 0 | } |
10860 | | |
10861 | | static const JSJitInfo drawArrays_methodinfo = { |
10862 | | { (JSJitGetterOp)drawArrays }, |
10863 | | { prototypes::id::WebGL2RenderingContext }, |
10864 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10865 | | JSJitInfo::Method, |
10866 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10867 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10868 | | false, /* isInfallible. False in setters. */ |
10869 | | false, /* isMovable. Not relevant for setters. */ |
10870 | | false, /* isEliminatable. Not relevant for setters. */ |
10871 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10872 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10873 | | false, /* isTypedMethod. Only relevant for methods. */ |
10874 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10875 | | }; |
10876 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10877 | | static_assert(0 < 1, "There is no slot for us"); |
10878 | | |
10879 | | MOZ_CAN_RUN_SCRIPT static bool |
10880 | | drawElements(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10881 | 0 | { |
10882 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.drawElements", DOM, cx); |
10883 | 0 |
|
10884 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
10885 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.drawElements"); |
10886 | 0 | } |
10887 | 0 | uint32_t arg0; |
10888 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10889 | 0 | return false; |
10890 | 0 | } |
10891 | 0 | int32_t arg1; |
10892 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
10893 | 0 | return false; |
10894 | 0 | } |
10895 | 0 | uint32_t arg2; |
10896 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
10897 | 0 | return false; |
10898 | 0 | } |
10899 | 0 | int64_t arg3; |
10900 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[3], &arg3)) { |
10901 | 0 | return false; |
10902 | 0 | } |
10903 | 0 | self->DrawElements(arg0, arg1, arg2, arg3); |
10904 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10905 | 0 | args.rval().setUndefined(); |
10906 | 0 | return true; |
10907 | 0 | } |
10908 | | |
10909 | | static const JSJitInfo drawElements_methodinfo = { |
10910 | | { (JSJitGetterOp)drawElements }, |
10911 | | { prototypes::id::WebGL2RenderingContext }, |
10912 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10913 | | JSJitInfo::Method, |
10914 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10915 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10916 | | false, /* isInfallible. False in setters. */ |
10917 | | false, /* isMovable. Not relevant for setters. */ |
10918 | | false, /* isEliminatable. Not relevant for setters. */ |
10919 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10920 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10921 | | false, /* isTypedMethod. Only relevant for methods. */ |
10922 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10923 | | }; |
10924 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10925 | | static_assert(0 < 1, "There is no slot for us"); |
10926 | | |
10927 | | MOZ_CAN_RUN_SCRIPT static bool |
10928 | | enable(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10929 | 0 | { |
10930 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.enable", DOM, cx); |
10931 | 0 |
|
10932 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10933 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.enable"); |
10934 | 0 | } |
10935 | 0 | uint32_t arg0; |
10936 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10937 | 0 | return false; |
10938 | 0 | } |
10939 | 0 | self->Enable(arg0); |
10940 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10941 | 0 | args.rval().setUndefined(); |
10942 | 0 | return true; |
10943 | 0 | } |
10944 | | |
10945 | | static const JSJitInfo enable_methodinfo = { |
10946 | | { (JSJitGetterOp)enable }, |
10947 | | { prototypes::id::WebGL2RenderingContext }, |
10948 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10949 | | JSJitInfo::Method, |
10950 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10951 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10952 | | false, /* isInfallible. False in setters. */ |
10953 | | false, /* isMovable. Not relevant for setters. */ |
10954 | | false, /* isEliminatable. Not relevant for setters. */ |
10955 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10956 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10957 | | false, /* isTypedMethod. Only relevant for methods. */ |
10958 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10959 | | }; |
10960 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10961 | | static_assert(0 < 1, "There is no slot for us"); |
10962 | | |
10963 | | MOZ_CAN_RUN_SCRIPT static bool |
10964 | | enableVertexAttribArray(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
10965 | 0 | { |
10966 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.enableVertexAttribArray", DOM, cx); |
10967 | 0 |
|
10968 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
10969 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.enableVertexAttribArray"); |
10970 | 0 | } |
10971 | 0 | uint32_t arg0; |
10972 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
10973 | 0 | return false; |
10974 | 0 | } |
10975 | 0 | self->EnableVertexAttribArray(arg0); |
10976 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
10977 | 0 | args.rval().setUndefined(); |
10978 | 0 | return true; |
10979 | 0 | } |
10980 | | |
10981 | | static const JSJitInfo enableVertexAttribArray_methodinfo = { |
10982 | | { (JSJitGetterOp)enableVertexAttribArray }, |
10983 | | { prototypes::id::WebGL2RenderingContext }, |
10984 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
10985 | | JSJitInfo::Method, |
10986 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
10987 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
10988 | | false, /* isInfallible. False in setters. */ |
10989 | | false, /* isMovable. Not relevant for setters. */ |
10990 | | false, /* isEliminatable. Not relevant for setters. */ |
10991 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
10992 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
10993 | | false, /* isTypedMethod. Only relevant for methods. */ |
10994 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
10995 | | }; |
10996 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
10997 | | static_assert(0 < 1, "There is no slot for us"); |
10998 | | |
10999 | | MOZ_CAN_RUN_SCRIPT static bool |
11000 | | finish(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11001 | 0 | { |
11002 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.finish", DOM, cx); |
11003 | 0 |
|
11004 | 0 | self->Finish(); |
11005 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11006 | 0 | args.rval().setUndefined(); |
11007 | 0 | return true; |
11008 | 0 | } |
11009 | | |
11010 | | static const JSJitInfo finish_methodinfo = { |
11011 | | { (JSJitGetterOp)finish }, |
11012 | | { prototypes::id::WebGL2RenderingContext }, |
11013 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11014 | | JSJitInfo::Method, |
11015 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11016 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
11017 | | true, /* isInfallible. False in setters. */ |
11018 | | false, /* isMovable. Not relevant for setters. */ |
11019 | | false, /* isEliminatable. Not relevant for setters. */ |
11020 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11021 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11022 | | false, /* isTypedMethod. Only relevant for methods. */ |
11023 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11024 | | }; |
11025 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11026 | | static_assert(0 < 1, "There is no slot for us"); |
11027 | | |
11028 | | MOZ_CAN_RUN_SCRIPT static bool |
11029 | | flush(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11030 | 0 | { |
11031 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.flush", DOM, cx); |
11032 | 0 |
|
11033 | 0 | self->Flush(); |
11034 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11035 | 0 | args.rval().setUndefined(); |
11036 | 0 | return true; |
11037 | 0 | } |
11038 | | |
11039 | | static const JSJitInfo flush_methodinfo = { |
11040 | | { (JSJitGetterOp)flush }, |
11041 | | { prototypes::id::WebGL2RenderingContext }, |
11042 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11043 | | JSJitInfo::Method, |
11044 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11045 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
11046 | | true, /* isInfallible. False in setters. */ |
11047 | | false, /* isMovable. Not relevant for setters. */ |
11048 | | false, /* isEliminatable. Not relevant for setters. */ |
11049 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11050 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11051 | | false, /* isTypedMethod. Only relevant for methods. */ |
11052 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11053 | | }; |
11054 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11055 | | static_assert(0 < 1, "There is no slot for us"); |
11056 | | |
11057 | | MOZ_CAN_RUN_SCRIPT static bool |
11058 | | framebufferRenderbuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11059 | 0 | { |
11060 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.framebufferRenderbuffer", DOM, cx); |
11061 | 0 |
|
11062 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
11063 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.framebufferRenderbuffer"); |
11064 | 0 | } |
11065 | 0 | uint32_t arg0; |
11066 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11067 | 0 | return false; |
11068 | 0 | } |
11069 | 0 | uint32_t arg1; |
11070 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11071 | 0 | return false; |
11072 | 0 | } |
11073 | 0 | uint32_t arg2; |
11074 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
11075 | 0 | return false; |
11076 | 0 | } |
11077 | 0 | mozilla::WebGLRenderbuffer* arg3; |
11078 | 0 | if (args[3].isObject()) { |
11079 | 0 | { |
11080 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLRenderbuffer, mozilla::WebGLRenderbuffer>(args[3], arg3); |
11081 | 0 | if (NS_FAILED(rv)) { |
11082 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 4 of WebGL2RenderingContext.framebufferRenderbuffer", "WebGLRenderbuffer"); |
11083 | 0 | return false; |
11084 | 0 | } |
11085 | 0 | } |
11086 | 0 | } else if (args[3].isNullOrUndefined()) { |
11087 | 0 | arg3 = nullptr; |
11088 | 0 | } else { |
11089 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 4 of WebGL2RenderingContext.framebufferRenderbuffer"); |
11090 | 0 | return false; |
11091 | 0 | } |
11092 | 0 | self->FramebufferRenderbuffer(arg0, arg1, arg2, MOZ_KnownLive(Constify(arg3))); |
11093 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11094 | 0 | args.rval().setUndefined(); |
11095 | 0 | return true; |
11096 | 0 | } |
11097 | | |
11098 | | static const JSJitInfo framebufferRenderbuffer_methodinfo = { |
11099 | | { (JSJitGetterOp)framebufferRenderbuffer }, |
11100 | | { prototypes::id::WebGL2RenderingContext }, |
11101 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11102 | | JSJitInfo::Method, |
11103 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11104 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
11105 | | false, /* isInfallible. False in setters. */ |
11106 | | false, /* isMovable. Not relevant for setters. */ |
11107 | | false, /* isEliminatable. Not relevant for setters. */ |
11108 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11109 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11110 | | false, /* isTypedMethod. Only relevant for methods. */ |
11111 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11112 | | }; |
11113 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11114 | | static_assert(0 < 1, "There is no slot for us"); |
11115 | | |
11116 | | MOZ_CAN_RUN_SCRIPT static bool |
11117 | | framebufferTexture2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11118 | 0 | { |
11119 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.framebufferTexture2D", DOM, cx); |
11120 | 0 |
|
11121 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
11122 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.framebufferTexture2D"); |
11123 | 0 | } |
11124 | 0 | uint32_t arg0; |
11125 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11126 | 0 | return false; |
11127 | 0 | } |
11128 | 0 | uint32_t arg1; |
11129 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11130 | 0 | return false; |
11131 | 0 | } |
11132 | 0 | uint32_t arg2; |
11133 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
11134 | 0 | return false; |
11135 | 0 | } |
11136 | 0 | mozilla::WebGLTexture* arg3; |
11137 | 0 | if (args[3].isObject()) { |
11138 | 0 | { |
11139 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTexture, mozilla::WebGLTexture>(args[3], arg3); |
11140 | 0 | if (NS_FAILED(rv)) { |
11141 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 4 of WebGL2RenderingContext.framebufferTexture2D", "WebGLTexture"); |
11142 | 0 | return false; |
11143 | 0 | } |
11144 | 0 | } |
11145 | 0 | } else if (args[3].isNullOrUndefined()) { |
11146 | 0 | arg3 = nullptr; |
11147 | 0 | } else { |
11148 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 4 of WebGL2RenderingContext.framebufferTexture2D"); |
11149 | 0 | return false; |
11150 | 0 | } |
11151 | 0 | int32_t arg4; |
11152 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
11153 | 0 | return false; |
11154 | 0 | } |
11155 | 0 | self->FramebufferTexture2D(arg0, arg1, arg2, MOZ_KnownLive(Constify(arg3)), arg4); |
11156 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11157 | 0 | args.rval().setUndefined(); |
11158 | 0 | return true; |
11159 | 0 | } |
11160 | | |
11161 | | static const JSJitInfo framebufferTexture2D_methodinfo = { |
11162 | | { (JSJitGetterOp)framebufferTexture2D }, |
11163 | | { prototypes::id::WebGL2RenderingContext }, |
11164 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11165 | | JSJitInfo::Method, |
11166 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11167 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
11168 | | false, /* isInfallible. False in setters. */ |
11169 | | false, /* isMovable. Not relevant for setters. */ |
11170 | | false, /* isEliminatable. Not relevant for setters. */ |
11171 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11172 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11173 | | false, /* isTypedMethod. Only relevant for methods. */ |
11174 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11175 | | }; |
11176 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11177 | | static_assert(0 < 1, "There is no slot for us"); |
11178 | | |
11179 | | MOZ_CAN_RUN_SCRIPT static bool |
11180 | | frontFace(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11181 | 0 | { |
11182 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.frontFace", DOM, cx); |
11183 | 0 |
|
11184 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
11185 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.frontFace"); |
11186 | 0 | } |
11187 | 0 | uint32_t arg0; |
11188 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11189 | 0 | return false; |
11190 | 0 | } |
11191 | 0 | self->FrontFace(arg0); |
11192 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11193 | 0 | args.rval().setUndefined(); |
11194 | 0 | return true; |
11195 | 0 | } |
11196 | | |
11197 | | static const JSJitInfo frontFace_methodinfo = { |
11198 | | { (JSJitGetterOp)frontFace }, |
11199 | | { prototypes::id::WebGL2RenderingContext }, |
11200 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11201 | | JSJitInfo::Method, |
11202 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11203 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
11204 | | false, /* isInfallible. False in setters. */ |
11205 | | false, /* isMovable. Not relevant for setters. */ |
11206 | | false, /* isEliminatable. Not relevant for setters. */ |
11207 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11208 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11209 | | false, /* isTypedMethod. Only relevant for methods. */ |
11210 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11211 | | }; |
11212 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11213 | | static_assert(0 < 1, "There is no slot for us"); |
11214 | | |
11215 | | MOZ_CAN_RUN_SCRIPT static bool |
11216 | | generateMipmap(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11217 | 0 | { |
11218 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.generateMipmap", DOM, cx); |
11219 | 0 |
|
11220 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
11221 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.generateMipmap"); |
11222 | 0 | } |
11223 | 0 | uint32_t arg0; |
11224 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11225 | 0 | return false; |
11226 | 0 | } |
11227 | 0 | self->GenerateMipmap(arg0); |
11228 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11229 | 0 | args.rval().setUndefined(); |
11230 | 0 | return true; |
11231 | 0 | } |
11232 | | |
11233 | | static const JSJitInfo generateMipmap_methodinfo = { |
11234 | | { (JSJitGetterOp)generateMipmap }, |
11235 | | { prototypes::id::WebGL2RenderingContext }, |
11236 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11237 | | JSJitInfo::Method, |
11238 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11239 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
11240 | | false, /* isInfallible. False in setters. */ |
11241 | | false, /* isMovable. Not relevant for setters. */ |
11242 | | false, /* isEliminatable. Not relevant for setters. */ |
11243 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11244 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11245 | | false, /* isTypedMethod. Only relevant for methods. */ |
11246 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11247 | | }; |
11248 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11249 | | static_assert(0 < 1, "There is no slot for us"); |
11250 | | |
11251 | | MOZ_CAN_RUN_SCRIPT static bool |
11252 | | getActiveAttrib(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11253 | 0 | { |
11254 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getActiveAttrib", DOM, cx); |
11255 | 0 |
|
11256 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11257 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getActiveAttrib"); |
11258 | 0 | } |
11259 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
11260 | 0 | if (args[0].isObject()) { |
11261 | 0 | { |
11262 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
11263 | 0 | if (NS_FAILED(rv)) { |
11264 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getActiveAttrib", "WebGLProgram"); |
11265 | 0 | return false; |
11266 | 0 | } |
11267 | 0 | } |
11268 | 0 | } else { |
11269 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getActiveAttrib"); |
11270 | 0 | return false; |
11271 | 0 | } |
11272 | 0 | uint32_t arg1; |
11273 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11274 | 0 | return false; |
11275 | 0 | } |
11276 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLActiveInfo>(self->GetActiveAttrib(MOZ_KnownLive(NonNullHelper(arg0)), arg1))); |
11277 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11278 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
11279 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
11280 | 0 | if (!result) { |
11281 | 0 | args.rval().setNull(); |
11282 | 0 | return true; |
11283 | 0 | } |
11284 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
11285 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
11286 | 0 | return false; |
11287 | 0 | } |
11288 | 0 | return true; |
11289 | 0 | } |
11290 | | |
11291 | | static const JSJitInfo getActiveAttrib_methodinfo = { |
11292 | | { (JSJitGetterOp)getActiveAttrib }, |
11293 | | { prototypes::id::WebGL2RenderingContext }, |
11294 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11295 | | JSJitInfo::Method, |
11296 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11297 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11298 | | false, /* isInfallible. False in setters. */ |
11299 | | false, /* isMovable. Not relevant for setters. */ |
11300 | | false, /* isEliminatable. Not relevant for setters. */ |
11301 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11302 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11303 | | false, /* isTypedMethod. Only relevant for methods. */ |
11304 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11305 | | }; |
11306 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11307 | | static_assert(0 < 1, "There is no slot for us"); |
11308 | | |
11309 | | MOZ_CAN_RUN_SCRIPT static bool |
11310 | | getActiveUniform(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11311 | 0 | { |
11312 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getActiveUniform", DOM, cx); |
11313 | 0 |
|
11314 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11315 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getActiveUniform"); |
11316 | 0 | } |
11317 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
11318 | 0 | if (args[0].isObject()) { |
11319 | 0 | { |
11320 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
11321 | 0 | if (NS_FAILED(rv)) { |
11322 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getActiveUniform", "WebGLProgram"); |
11323 | 0 | return false; |
11324 | 0 | } |
11325 | 0 | } |
11326 | 0 | } else { |
11327 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getActiveUniform"); |
11328 | 0 | return false; |
11329 | 0 | } |
11330 | 0 | uint32_t arg1; |
11331 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11332 | 0 | return false; |
11333 | 0 | } |
11334 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLActiveInfo>(self->GetActiveUniform(MOZ_KnownLive(NonNullHelper(arg0)), arg1))); |
11335 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11336 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
11337 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
11338 | 0 | if (!result) { |
11339 | 0 | args.rval().setNull(); |
11340 | 0 | return true; |
11341 | 0 | } |
11342 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
11343 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
11344 | 0 | return false; |
11345 | 0 | } |
11346 | 0 | return true; |
11347 | 0 | } |
11348 | | |
11349 | | static const JSJitInfo getActiveUniform_methodinfo = { |
11350 | | { (JSJitGetterOp)getActiveUniform }, |
11351 | | { prototypes::id::WebGL2RenderingContext }, |
11352 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11353 | | JSJitInfo::Method, |
11354 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11355 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11356 | | false, /* isInfallible. False in setters. */ |
11357 | | false, /* isMovable. Not relevant for setters. */ |
11358 | | false, /* isEliminatable. Not relevant for setters. */ |
11359 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11360 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11361 | | false, /* isTypedMethod. Only relevant for methods. */ |
11362 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11363 | | }; |
11364 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11365 | | static_assert(0 < 1, "There is no slot for us"); |
11366 | | |
11367 | | MOZ_CAN_RUN_SCRIPT static bool |
11368 | | getAttachedShaders(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11369 | 0 | { |
11370 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getAttachedShaders", DOM, cx); |
11371 | 0 |
|
11372 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
11373 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getAttachedShaders"); |
11374 | 0 | } |
11375 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
11376 | 0 | if (args[0].isObject()) { |
11377 | 0 | { |
11378 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
11379 | 0 | if (NS_FAILED(rv)) { |
11380 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getAttachedShaders", "WebGLProgram"); |
11381 | 0 | return false; |
11382 | 0 | } |
11383 | 0 | } |
11384 | 0 | } else { |
11385 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getAttachedShaders"); |
11386 | 0 | return false; |
11387 | 0 | } |
11388 | 0 | Nullable<nsTArray<StrongPtrForMember<mozilla::WebGLShader>::Type>> result; |
11389 | 0 | self->GetAttachedShaders(MOZ_KnownLive(NonNullHelper(arg0)), result); |
11390 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11391 | 0 |
|
11392 | 0 | if (result.IsNull()) { |
11393 | 0 | args.rval().setNull(); |
11394 | 0 | return true; |
11395 | 0 | } |
11396 | 0 | |
11397 | 0 | uint32_t length = result.Value().Length(); |
11398 | 0 | JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length)); |
11399 | 0 | if (!returnArray) { |
11400 | 0 | return false; |
11401 | 0 | } |
11402 | 0 | // Scope for 'tmp' |
11403 | 0 | { |
11404 | 0 | JS::Rooted<JS::Value> tmp(cx); |
11405 | 0 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { |
11406 | 0 | // Control block to let us common up the JS_DefineElement calls when there |
11407 | 0 | // are different ways to succeed at wrapping the object. |
11408 | 0 | do { |
11409 | 0 | if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) { |
11410 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
11411 | 0 | return false; |
11412 | 0 | } |
11413 | 0 | break; |
11414 | 0 | } while (false); |
11415 | 0 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, |
11416 | 0 | JSPROP_ENUMERATE)) { |
11417 | 0 | return false; |
11418 | 0 | } |
11419 | 0 | } |
11420 | 0 | } |
11421 | 0 | args.rval().setObject(*returnArray); |
11422 | 0 | return true; |
11423 | 0 | } |
11424 | | |
11425 | | static const JSJitInfo getAttachedShaders_methodinfo = { |
11426 | | { (JSJitGetterOp)getAttachedShaders }, |
11427 | | { prototypes::id::WebGL2RenderingContext }, |
11428 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11429 | | JSJitInfo::Method, |
11430 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11431 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11432 | | false, /* isInfallible. False in setters. */ |
11433 | | false, /* isMovable. Not relevant for setters. */ |
11434 | | false, /* isEliminatable. Not relevant for setters. */ |
11435 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11436 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11437 | | false, /* isTypedMethod. Only relevant for methods. */ |
11438 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11439 | | }; |
11440 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11441 | | static_assert(0 < 1, "There is no slot for us"); |
11442 | | |
11443 | | MOZ_CAN_RUN_SCRIPT static bool |
11444 | | getAttribLocation(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11445 | 0 | { |
11446 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getAttribLocation", DOM, cx); |
11447 | 0 |
|
11448 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11449 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getAttribLocation"); |
11450 | 0 | } |
11451 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
11452 | 0 | if (args[0].isObject()) { |
11453 | 0 | { |
11454 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
11455 | 0 | if (NS_FAILED(rv)) { |
11456 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getAttribLocation", "WebGLProgram"); |
11457 | 0 | return false; |
11458 | 0 | } |
11459 | 0 | } |
11460 | 0 | } else { |
11461 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getAttribLocation"); |
11462 | 0 | return false; |
11463 | 0 | } |
11464 | 0 | binding_detail::FakeString arg1; |
11465 | 0 | if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) { |
11466 | 0 | return false; |
11467 | 0 | } |
11468 | 0 | int32_t result(self->GetAttribLocation(MOZ_KnownLive(NonNullHelper(arg0)), NonNullHelper(Constify(arg1)))); |
11469 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11470 | 0 | args.rval().setInt32(int32_t(result)); |
11471 | 0 | return true; |
11472 | 0 | } |
11473 | | |
11474 | | static const JSJitInfo getAttribLocation_methodinfo = { |
11475 | | { (JSJitGetterOp)getAttribLocation }, |
11476 | | { prototypes::id::WebGL2RenderingContext }, |
11477 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11478 | | JSJitInfo::Method, |
11479 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11480 | | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ |
11481 | | false, /* isInfallible. False in setters. */ |
11482 | | false, /* isMovable. Not relevant for setters. */ |
11483 | | false, /* isEliminatable. Not relevant for setters. */ |
11484 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11485 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11486 | | false, /* isTypedMethod. Only relevant for methods. */ |
11487 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11488 | | }; |
11489 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11490 | | static_assert(0 < 1, "There is no slot for us"); |
11491 | | |
11492 | | MOZ_CAN_RUN_SCRIPT static bool |
11493 | | getBufferParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11494 | 0 | { |
11495 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getBufferParameter", DOM, cx); |
11496 | 0 |
|
11497 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11498 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getBufferParameter"); |
11499 | 0 | } |
11500 | 0 | uint32_t arg0; |
11501 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11502 | 0 | return false; |
11503 | 0 | } |
11504 | 0 | uint32_t arg1; |
11505 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11506 | 0 | return false; |
11507 | 0 | } |
11508 | 0 | JS::Rooted<JS::Value> result(cx); |
11509 | 0 | self->GetBufferParameter(cx, arg0, arg1, &result); |
11510 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11511 | 0 | JS::ExposeValueToActiveJS(result); |
11512 | 0 | args.rval().set(result); |
11513 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
11514 | 0 | return false; |
11515 | 0 | } |
11516 | 0 | return true; |
11517 | 0 | } |
11518 | | |
11519 | | static const JSJitInfo getBufferParameter_methodinfo = { |
11520 | | { (JSJitGetterOp)getBufferParameter }, |
11521 | | { prototypes::id::WebGL2RenderingContext }, |
11522 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11523 | | JSJitInfo::Method, |
11524 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11525 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11526 | | false, /* isInfallible. False in setters. */ |
11527 | | false, /* isMovable. Not relevant for setters. */ |
11528 | | false, /* isEliminatable. Not relevant for setters. */ |
11529 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11530 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11531 | | false, /* isTypedMethod. Only relevant for methods. */ |
11532 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11533 | | }; |
11534 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11535 | | static_assert(0 < 1, "There is no slot for us"); |
11536 | | |
11537 | | MOZ_CAN_RUN_SCRIPT static bool |
11538 | | getParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11539 | 0 | { |
11540 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getParameter", DOM, cx); |
11541 | 0 |
|
11542 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
11543 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getParameter"); |
11544 | 0 | } |
11545 | 0 | uint32_t arg0; |
11546 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11547 | 0 | return false; |
11548 | 0 | } |
11549 | 0 | FastErrorResult rv; |
11550 | 0 | JS::Rooted<JS::Value> result(cx); |
11551 | 0 | self->GetParameter(cx, arg0, &result, rv); |
11552 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
11553 | 0 | return false; |
11554 | 0 | } |
11555 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11556 | 0 | JS::ExposeValueToActiveJS(result); |
11557 | 0 | args.rval().set(result); |
11558 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
11559 | 0 | return false; |
11560 | 0 | } |
11561 | 0 | return true; |
11562 | 0 | } |
11563 | | |
11564 | | static const JSJitInfo getParameter_methodinfo = { |
11565 | | { (JSJitGetterOp)getParameter }, |
11566 | | { prototypes::id::WebGL2RenderingContext }, |
11567 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11568 | | JSJitInfo::Method, |
11569 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11570 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11571 | | false, /* isInfallible. False in setters. */ |
11572 | | false, /* isMovable. Not relevant for setters. */ |
11573 | | false, /* isEliminatable. Not relevant for setters. */ |
11574 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11575 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11576 | | false, /* isTypedMethod. Only relevant for methods. */ |
11577 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11578 | | }; |
11579 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11580 | | static_assert(0 < 1, "There is no slot for us"); |
11581 | | |
11582 | | MOZ_CAN_RUN_SCRIPT static bool |
11583 | | getError(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11584 | 0 | { |
11585 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getError", DOM, cx); |
11586 | 0 |
|
11587 | 0 | uint32_t result(self->GetError()); |
11588 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11589 | 0 | args.rval().setNumber(result); |
11590 | 0 | return true; |
11591 | 0 | } |
11592 | | |
11593 | | static const JSJitInfo getError_methodinfo = { |
11594 | | { (JSJitGetterOp)getError }, |
11595 | | { prototypes::id::WebGL2RenderingContext }, |
11596 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11597 | | JSJitInfo::Method, |
11598 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11599 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
11600 | | true, /* isInfallible. False in setters. */ |
11601 | | false, /* isMovable. Not relevant for setters. */ |
11602 | | false, /* isEliminatable. Not relevant for setters. */ |
11603 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11604 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11605 | | false, /* isTypedMethod. Only relevant for methods. */ |
11606 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11607 | | }; |
11608 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11609 | | static_assert(0 < 1, "There is no slot for us"); |
11610 | | |
11611 | | MOZ_CAN_RUN_SCRIPT static bool |
11612 | | getFramebufferAttachmentParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11613 | 0 | { |
11614 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getFramebufferAttachmentParameter", DOM, cx); |
11615 | 0 |
|
11616 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
11617 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getFramebufferAttachmentParameter"); |
11618 | 0 | } |
11619 | 0 | uint32_t arg0; |
11620 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11621 | 0 | return false; |
11622 | 0 | } |
11623 | 0 | uint32_t arg1; |
11624 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11625 | 0 | return false; |
11626 | 0 | } |
11627 | 0 | uint32_t arg2; |
11628 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
11629 | 0 | return false; |
11630 | 0 | } |
11631 | 0 | FastErrorResult rv; |
11632 | 0 | JS::Rooted<JS::Value> result(cx); |
11633 | 0 | self->GetFramebufferAttachmentParameter(cx, arg0, arg1, arg2, &result, rv); |
11634 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
11635 | 0 | return false; |
11636 | 0 | } |
11637 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11638 | 0 | JS::ExposeValueToActiveJS(result); |
11639 | 0 | args.rval().set(result); |
11640 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
11641 | 0 | return false; |
11642 | 0 | } |
11643 | 0 | return true; |
11644 | 0 | } |
11645 | | |
11646 | | static const JSJitInfo getFramebufferAttachmentParameter_methodinfo = { |
11647 | | { (JSJitGetterOp)getFramebufferAttachmentParameter }, |
11648 | | { prototypes::id::WebGL2RenderingContext }, |
11649 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11650 | | JSJitInfo::Method, |
11651 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11652 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11653 | | false, /* isInfallible. False in setters. */ |
11654 | | false, /* isMovable. Not relevant for setters. */ |
11655 | | false, /* isEliminatable. Not relevant for setters. */ |
11656 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11657 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11658 | | false, /* isTypedMethod. Only relevant for methods. */ |
11659 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11660 | | }; |
11661 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11662 | | static_assert(0 < 1, "There is no slot for us"); |
11663 | | |
11664 | | MOZ_CAN_RUN_SCRIPT static bool |
11665 | | getProgramParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11666 | 0 | { |
11667 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getProgramParameter", DOM, cx); |
11668 | 0 |
|
11669 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11670 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getProgramParameter"); |
11671 | 0 | } |
11672 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
11673 | 0 | if (args[0].isObject()) { |
11674 | 0 | { |
11675 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
11676 | 0 | if (NS_FAILED(rv)) { |
11677 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getProgramParameter", "WebGLProgram"); |
11678 | 0 | return false; |
11679 | 0 | } |
11680 | 0 | } |
11681 | 0 | } else { |
11682 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getProgramParameter"); |
11683 | 0 | return false; |
11684 | 0 | } |
11685 | 0 | uint32_t arg1; |
11686 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11687 | 0 | return false; |
11688 | 0 | } |
11689 | 0 | JS::Rooted<JS::Value> result(cx); |
11690 | 0 | self->GetProgramParameter(cx, MOZ_KnownLive(NonNullHelper(arg0)), arg1, &result); |
11691 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11692 | 0 | JS::ExposeValueToActiveJS(result); |
11693 | 0 | args.rval().set(result); |
11694 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
11695 | 0 | return false; |
11696 | 0 | } |
11697 | 0 | return true; |
11698 | 0 | } |
11699 | | |
11700 | | static const JSJitInfo getProgramParameter_methodinfo = { |
11701 | | { (JSJitGetterOp)getProgramParameter }, |
11702 | | { prototypes::id::WebGL2RenderingContext }, |
11703 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11704 | | JSJitInfo::Method, |
11705 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11706 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11707 | | false, /* isInfallible. False in setters. */ |
11708 | | false, /* isMovable. Not relevant for setters. */ |
11709 | | false, /* isEliminatable. Not relevant for setters. */ |
11710 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11711 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11712 | | false, /* isTypedMethod. Only relevant for methods. */ |
11713 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11714 | | }; |
11715 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11716 | | static_assert(0 < 1, "There is no slot for us"); |
11717 | | |
11718 | | MOZ_CAN_RUN_SCRIPT static bool |
11719 | | getProgramInfoLog(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11720 | 0 | { |
11721 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getProgramInfoLog", DOM, cx); |
11722 | 0 |
|
11723 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
11724 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getProgramInfoLog"); |
11725 | 0 | } |
11726 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
11727 | 0 | if (args[0].isObject()) { |
11728 | 0 | { |
11729 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
11730 | 0 | if (NS_FAILED(rv)) { |
11731 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getProgramInfoLog", "WebGLProgram"); |
11732 | 0 | return false; |
11733 | 0 | } |
11734 | 0 | } |
11735 | 0 | } else { |
11736 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getProgramInfoLog"); |
11737 | 0 | return false; |
11738 | 0 | } |
11739 | 0 | DOMString result; |
11740 | 0 | self->GetProgramInfoLog(MOZ_KnownLive(NonNullHelper(arg0)), result); |
11741 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11742 | 0 | if (!xpc::StringToJsval(cx, result, args.rval())) { |
11743 | 0 | return false; |
11744 | 0 | } |
11745 | 0 | return true; |
11746 | 0 | } |
11747 | | |
11748 | | static const JSJitInfo getProgramInfoLog_methodinfo = { |
11749 | | { (JSJitGetterOp)getProgramInfoLog }, |
11750 | | { prototypes::id::WebGL2RenderingContext }, |
11751 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11752 | | JSJitInfo::Method, |
11753 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11754 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11755 | | false, /* isInfallible. False in setters. */ |
11756 | | false, /* isMovable. Not relevant for setters. */ |
11757 | | false, /* isEliminatable. Not relevant for setters. */ |
11758 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11759 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11760 | | false, /* isTypedMethod. Only relevant for methods. */ |
11761 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11762 | | }; |
11763 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11764 | | static_assert(0 < 1, "There is no slot for us"); |
11765 | | |
11766 | | MOZ_CAN_RUN_SCRIPT static bool |
11767 | | getRenderbufferParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11768 | 0 | { |
11769 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getRenderbufferParameter", DOM, cx); |
11770 | 0 |
|
11771 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11772 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getRenderbufferParameter"); |
11773 | 0 | } |
11774 | 0 | uint32_t arg0; |
11775 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11776 | 0 | return false; |
11777 | 0 | } |
11778 | 0 | uint32_t arg1; |
11779 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11780 | 0 | return false; |
11781 | 0 | } |
11782 | 0 | JS::Rooted<JS::Value> result(cx); |
11783 | 0 | self->GetRenderbufferParameter(cx, arg0, arg1, &result); |
11784 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11785 | 0 | JS::ExposeValueToActiveJS(result); |
11786 | 0 | args.rval().set(result); |
11787 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
11788 | 0 | return false; |
11789 | 0 | } |
11790 | 0 | return true; |
11791 | 0 | } |
11792 | | |
11793 | | static const JSJitInfo getRenderbufferParameter_methodinfo = { |
11794 | | { (JSJitGetterOp)getRenderbufferParameter }, |
11795 | | { prototypes::id::WebGL2RenderingContext }, |
11796 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11797 | | JSJitInfo::Method, |
11798 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11799 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11800 | | false, /* isInfallible. False in setters. */ |
11801 | | false, /* isMovable. Not relevant for setters. */ |
11802 | | false, /* isEliminatable. Not relevant for setters. */ |
11803 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11804 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11805 | | false, /* isTypedMethod. Only relevant for methods. */ |
11806 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11807 | | }; |
11808 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11809 | | static_assert(0 < 1, "There is no slot for us"); |
11810 | | |
11811 | | MOZ_CAN_RUN_SCRIPT static bool |
11812 | | getShaderParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11813 | 0 | { |
11814 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getShaderParameter", DOM, cx); |
11815 | 0 |
|
11816 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11817 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getShaderParameter"); |
11818 | 0 | } |
11819 | 0 | NonNull<mozilla::WebGLShader> arg0; |
11820 | 0 | if (args[0].isObject()) { |
11821 | 0 | { |
11822 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[0], arg0); |
11823 | 0 | if (NS_FAILED(rv)) { |
11824 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getShaderParameter", "WebGLShader"); |
11825 | 0 | return false; |
11826 | 0 | } |
11827 | 0 | } |
11828 | 0 | } else { |
11829 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getShaderParameter"); |
11830 | 0 | return false; |
11831 | 0 | } |
11832 | 0 | uint32_t arg1; |
11833 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11834 | 0 | return false; |
11835 | 0 | } |
11836 | 0 | JS::Rooted<JS::Value> result(cx); |
11837 | 0 | self->GetShaderParameter(cx, MOZ_KnownLive(NonNullHelper(arg0)), arg1, &result); |
11838 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11839 | 0 | JS::ExposeValueToActiveJS(result); |
11840 | 0 | args.rval().set(result); |
11841 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
11842 | 0 | return false; |
11843 | 0 | } |
11844 | 0 | return true; |
11845 | 0 | } |
11846 | | |
11847 | | static const JSJitInfo getShaderParameter_methodinfo = { |
11848 | | { (JSJitGetterOp)getShaderParameter }, |
11849 | | { prototypes::id::WebGL2RenderingContext }, |
11850 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11851 | | JSJitInfo::Method, |
11852 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11853 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11854 | | false, /* isInfallible. False in setters. */ |
11855 | | false, /* isMovable. Not relevant for setters. */ |
11856 | | false, /* isEliminatable. Not relevant for setters. */ |
11857 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11858 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11859 | | false, /* isTypedMethod. Only relevant for methods. */ |
11860 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11861 | | }; |
11862 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11863 | | static_assert(0 < 1, "There is no slot for us"); |
11864 | | |
11865 | | MOZ_CAN_RUN_SCRIPT static bool |
11866 | | getShaderPrecisionFormat(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11867 | 0 | { |
11868 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getShaderPrecisionFormat", DOM, cx); |
11869 | 0 |
|
11870 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
11871 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getShaderPrecisionFormat"); |
11872 | 0 | } |
11873 | 0 | uint32_t arg0; |
11874 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
11875 | 0 | return false; |
11876 | 0 | } |
11877 | 0 | uint32_t arg1; |
11878 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
11879 | 0 | return false; |
11880 | 0 | } |
11881 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLShaderPrecisionFormat>(self->GetShaderPrecisionFormat(arg0, arg1))); |
11882 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11883 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
11884 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
11885 | 0 | if (!result) { |
11886 | 0 | args.rval().setNull(); |
11887 | 0 | return true; |
11888 | 0 | } |
11889 | 0 | if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) { |
11890 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
11891 | 0 | return false; |
11892 | 0 | } |
11893 | 0 | return true; |
11894 | 0 | } |
11895 | | |
11896 | | static const JSJitInfo getShaderPrecisionFormat_methodinfo = { |
11897 | | { (JSJitGetterOp)getShaderPrecisionFormat }, |
11898 | | { prototypes::id::WebGL2RenderingContext }, |
11899 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11900 | | JSJitInfo::Method, |
11901 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11902 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11903 | | false, /* isInfallible. False in setters. */ |
11904 | | false, /* isMovable. Not relevant for setters. */ |
11905 | | false, /* isEliminatable. Not relevant for setters. */ |
11906 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11907 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11908 | | false, /* isTypedMethod. Only relevant for methods. */ |
11909 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11910 | | }; |
11911 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11912 | | static_assert(0 < 1, "There is no slot for us"); |
11913 | | |
11914 | | MOZ_CAN_RUN_SCRIPT static bool |
11915 | | getShaderInfoLog(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11916 | 0 | { |
11917 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getShaderInfoLog", DOM, cx); |
11918 | 0 |
|
11919 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
11920 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getShaderInfoLog"); |
11921 | 0 | } |
11922 | 0 | NonNull<mozilla::WebGLShader> arg0; |
11923 | 0 | if (args[0].isObject()) { |
11924 | 0 | { |
11925 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[0], arg0); |
11926 | 0 | if (NS_FAILED(rv)) { |
11927 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getShaderInfoLog", "WebGLShader"); |
11928 | 0 | return false; |
11929 | 0 | } |
11930 | 0 | } |
11931 | 0 | } else { |
11932 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getShaderInfoLog"); |
11933 | 0 | return false; |
11934 | 0 | } |
11935 | 0 | DOMString result; |
11936 | 0 | self->GetShaderInfoLog(MOZ_KnownLive(NonNullHelper(arg0)), result); |
11937 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11938 | 0 | if (!xpc::StringToJsval(cx, result, args.rval())) { |
11939 | 0 | return false; |
11940 | 0 | } |
11941 | 0 | return true; |
11942 | 0 | } |
11943 | | |
11944 | | static const JSJitInfo getShaderInfoLog_methodinfo = { |
11945 | | { (JSJitGetterOp)getShaderInfoLog }, |
11946 | | { prototypes::id::WebGL2RenderingContext }, |
11947 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11948 | | JSJitInfo::Method, |
11949 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11950 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11951 | | false, /* isInfallible. False in setters. */ |
11952 | | false, /* isMovable. Not relevant for setters. */ |
11953 | | false, /* isEliminatable. Not relevant for setters. */ |
11954 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
11955 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
11956 | | false, /* isTypedMethod. Only relevant for methods. */ |
11957 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
11958 | | }; |
11959 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
11960 | | static_assert(0 < 1, "There is no slot for us"); |
11961 | | |
11962 | | MOZ_CAN_RUN_SCRIPT static bool |
11963 | | getShaderSource(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
11964 | 0 | { |
11965 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getShaderSource", DOM, cx); |
11966 | 0 |
|
11967 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
11968 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getShaderSource"); |
11969 | 0 | } |
11970 | 0 | NonNull<mozilla::WebGLShader> arg0; |
11971 | 0 | if (args[0].isObject()) { |
11972 | 0 | { |
11973 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[0], arg0); |
11974 | 0 | if (NS_FAILED(rv)) { |
11975 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getShaderSource", "WebGLShader"); |
11976 | 0 | return false; |
11977 | 0 | } |
11978 | 0 | } |
11979 | 0 | } else { |
11980 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getShaderSource"); |
11981 | 0 | return false; |
11982 | 0 | } |
11983 | 0 | DOMString result; |
11984 | 0 | self->GetShaderSource(MOZ_KnownLive(NonNullHelper(arg0)), result); |
11985 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
11986 | 0 | if (!xpc::StringToJsval(cx, result, args.rval())) { |
11987 | 0 | return false; |
11988 | 0 | } |
11989 | 0 | return true; |
11990 | 0 | } |
11991 | | |
11992 | | static const JSJitInfo getShaderSource_methodinfo = { |
11993 | | { (JSJitGetterOp)getShaderSource }, |
11994 | | { prototypes::id::WebGL2RenderingContext }, |
11995 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
11996 | | JSJitInfo::Method, |
11997 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
11998 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
11999 | | false, /* isInfallible. False in setters. */ |
12000 | | false, /* isMovable. Not relevant for setters. */ |
12001 | | false, /* isEliminatable. Not relevant for setters. */ |
12002 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12003 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12004 | | false, /* isTypedMethod. Only relevant for methods. */ |
12005 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12006 | | }; |
12007 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12008 | | static_assert(0 < 1, "There is no slot for us"); |
12009 | | |
12010 | | MOZ_CAN_RUN_SCRIPT static bool |
12011 | | getTexParameter(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12012 | 0 | { |
12013 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getTexParameter", DOM, cx); |
12014 | 0 |
|
12015 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12016 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getTexParameter"); |
12017 | 0 | } |
12018 | 0 | uint32_t arg0; |
12019 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12020 | 0 | return false; |
12021 | 0 | } |
12022 | 0 | uint32_t arg1; |
12023 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
12024 | 0 | return false; |
12025 | 0 | } |
12026 | 0 | JS::Rooted<JS::Value> result(cx); |
12027 | 0 | self->GetTexParameter(cx, arg0, arg1, &result); |
12028 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12029 | 0 | JS::ExposeValueToActiveJS(result); |
12030 | 0 | args.rval().set(result); |
12031 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
12032 | 0 | return false; |
12033 | 0 | } |
12034 | 0 | return true; |
12035 | 0 | } |
12036 | | |
12037 | | static const JSJitInfo getTexParameter_methodinfo = { |
12038 | | { (JSJitGetterOp)getTexParameter }, |
12039 | | { prototypes::id::WebGL2RenderingContext }, |
12040 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12041 | | JSJitInfo::Method, |
12042 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12043 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
12044 | | false, /* isInfallible. False in setters. */ |
12045 | | false, /* isMovable. Not relevant for setters. */ |
12046 | | false, /* isEliminatable. Not relevant for setters. */ |
12047 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12048 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12049 | | false, /* isTypedMethod. Only relevant for methods. */ |
12050 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12051 | | }; |
12052 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12053 | | static_assert(0 < 1, "There is no slot for us"); |
12054 | | |
12055 | | MOZ_CAN_RUN_SCRIPT static bool |
12056 | | getUniform(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12057 | 0 | { |
12058 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getUniform", DOM, cx); |
12059 | 0 |
|
12060 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12061 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getUniform"); |
12062 | 0 | } |
12063 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
12064 | 0 | if (args[0].isObject()) { |
12065 | 0 | { |
12066 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
12067 | 0 | if (NS_FAILED(rv)) { |
12068 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getUniform", "WebGLProgram"); |
12069 | 0 | return false; |
12070 | 0 | } |
12071 | 0 | } |
12072 | 0 | } else { |
12073 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getUniform"); |
12074 | 0 | return false; |
12075 | 0 | } |
12076 | 0 | NonNull<mozilla::WebGLUniformLocation> arg1; |
12077 | 0 | if (args[1].isObject()) { |
12078 | 0 | { |
12079 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[1], arg1); |
12080 | 0 | if (NS_FAILED(rv)) { |
12081 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of WebGL2RenderingContext.getUniform", "WebGLUniformLocation"); |
12082 | 0 | return false; |
12083 | 0 | } |
12084 | 0 | } |
12085 | 0 | } else { |
12086 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of WebGL2RenderingContext.getUniform"); |
12087 | 0 | return false; |
12088 | 0 | } |
12089 | 0 | JS::Rooted<JS::Value> result(cx); |
12090 | 0 | self->GetUniform(cx, MOZ_KnownLive(NonNullHelper(arg0)), MOZ_KnownLive(NonNullHelper(arg1)), &result); |
12091 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12092 | 0 | JS::ExposeValueToActiveJS(result); |
12093 | 0 | args.rval().set(result); |
12094 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
12095 | 0 | return false; |
12096 | 0 | } |
12097 | 0 | return true; |
12098 | 0 | } |
12099 | | |
12100 | | static const JSJitInfo getUniform_methodinfo = { |
12101 | | { (JSJitGetterOp)getUniform }, |
12102 | | { prototypes::id::WebGL2RenderingContext }, |
12103 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12104 | | JSJitInfo::Method, |
12105 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12106 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
12107 | | false, /* isInfallible. False in setters. */ |
12108 | | false, /* isMovable. Not relevant for setters. */ |
12109 | | false, /* isEliminatable. Not relevant for setters. */ |
12110 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12111 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12112 | | false, /* isTypedMethod. Only relevant for methods. */ |
12113 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12114 | | }; |
12115 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12116 | | static_assert(0 < 1, "There is no slot for us"); |
12117 | | |
12118 | | MOZ_CAN_RUN_SCRIPT static bool |
12119 | | getUniformLocation(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12120 | 0 | { |
12121 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getUniformLocation", DOM, cx); |
12122 | 0 |
|
12123 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12124 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getUniformLocation"); |
12125 | 0 | } |
12126 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
12127 | 0 | if (args[0].isObject()) { |
12128 | 0 | { |
12129 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
12130 | 0 | if (NS_FAILED(rv)) { |
12131 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.getUniformLocation", "WebGLProgram"); |
12132 | 0 | return false; |
12133 | 0 | } |
12134 | 0 | } |
12135 | 0 | } else { |
12136 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.getUniformLocation"); |
12137 | 0 | return false; |
12138 | 0 | } |
12139 | 0 | binding_detail::FakeString arg1; |
12140 | 0 | if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) { |
12141 | 0 | return false; |
12142 | 0 | } |
12143 | 0 | auto result(StrongOrRawPtr<mozilla::WebGLUniformLocation>(self->GetUniformLocation(MOZ_KnownLive(NonNullHelper(arg0)), NonNullHelper(Constify(arg1))))); |
12144 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12145 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
12146 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
12147 | 0 | if (!result) { |
12148 | 0 | args.rval().setNull(); |
12149 | 0 | return true; |
12150 | 0 | } |
12151 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
12152 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
12153 | 0 | return false; |
12154 | 0 | } |
12155 | 0 | return true; |
12156 | 0 | } |
12157 | | |
12158 | | static const JSJitInfo getUniformLocation_methodinfo = { |
12159 | | { (JSJitGetterOp)getUniformLocation }, |
12160 | | { prototypes::id::WebGL2RenderingContext }, |
12161 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12162 | | JSJitInfo::Method, |
12163 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12164 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
12165 | | false, /* isInfallible. False in setters. */ |
12166 | | false, /* isMovable. Not relevant for setters. */ |
12167 | | false, /* isEliminatable. Not relevant for setters. */ |
12168 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12169 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12170 | | false, /* isTypedMethod. Only relevant for methods. */ |
12171 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12172 | | }; |
12173 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12174 | | static_assert(0 < 1, "There is no slot for us"); |
12175 | | |
12176 | | MOZ_CAN_RUN_SCRIPT static bool |
12177 | | getVertexAttrib(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12178 | 0 | { |
12179 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getVertexAttrib", DOM, cx); |
12180 | 0 |
|
12181 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12182 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getVertexAttrib"); |
12183 | 0 | } |
12184 | 0 | uint32_t arg0; |
12185 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12186 | 0 | return false; |
12187 | 0 | } |
12188 | 0 | uint32_t arg1; |
12189 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
12190 | 0 | return false; |
12191 | 0 | } |
12192 | 0 | FastErrorResult rv; |
12193 | 0 | JS::Rooted<JS::Value> result(cx); |
12194 | 0 | self->GetVertexAttrib(cx, arg0, arg1, &result, rv); |
12195 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
12196 | 0 | return false; |
12197 | 0 | } |
12198 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12199 | 0 | JS::ExposeValueToActiveJS(result); |
12200 | 0 | args.rval().set(result); |
12201 | 0 | if (!MaybeWrapValue(cx, args.rval())) { |
12202 | 0 | return false; |
12203 | 0 | } |
12204 | 0 | return true; |
12205 | 0 | } |
12206 | | |
12207 | | static const JSJitInfo getVertexAttrib_methodinfo = { |
12208 | | { (JSJitGetterOp)getVertexAttrib }, |
12209 | | { prototypes::id::WebGL2RenderingContext }, |
12210 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12211 | | JSJitInfo::Method, |
12212 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12213 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
12214 | | false, /* isInfallible. False in setters. */ |
12215 | | false, /* isMovable. Not relevant for setters. */ |
12216 | | false, /* isEliminatable. Not relevant for setters. */ |
12217 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12218 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12219 | | false, /* isTypedMethod. Only relevant for methods. */ |
12220 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12221 | | }; |
12222 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12223 | | static_assert(0 < 1, "There is no slot for us"); |
12224 | | |
12225 | | MOZ_CAN_RUN_SCRIPT static bool |
12226 | | getVertexAttribOffset(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12227 | 0 | { |
12228 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.getVertexAttribOffset", DOM, cx); |
12229 | 0 |
|
12230 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12231 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.getVertexAttribOffset"); |
12232 | 0 | } |
12233 | 0 | uint32_t arg0; |
12234 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12235 | 0 | return false; |
12236 | 0 | } |
12237 | 0 | uint32_t arg1; |
12238 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
12239 | 0 | return false; |
12240 | 0 | } |
12241 | 0 | int64_t result(self->GetVertexAttribOffset(arg0, arg1)); |
12242 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12243 | 0 | args.rval().set(JS_NumberValue(double(result))); |
12244 | 0 | return true; |
12245 | 0 | } |
12246 | | |
12247 | | static const JSJitInfo getVertexAttribOffset_methodinfo = { |
12248 | | { (JSJitGetterOp)getVertexAttribOffset }, |
12249 | | { prototypes::id::WebGL2RenderingContext }, |
12250 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12251 | | JSJitInfo::Method, |
12252 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12253 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
12254 | | false, /* isInfallible. False in setters. */ |
12255 | | false, /* isMovable. Not relevant for setters. */ |
12256 | | false, /* isEliminatable. Not relevant for setters. */ |
12257 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12258 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12259 | | false, /* isTypedMethod. Only relevant for methods. */ |
12260 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12261 | | }; |
12262 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12263 | | static_assert(0 < 1, "There is no slot for us"); |
12264 | | |
12265 | | MOZ_CAN_RUN_SCRIPT static bool |
12266 | | hint(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12267 | 0 | { |
12268 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.hint", DOM, cx); |
12269 | 0 |
|
12270 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12271 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.hint"); |
12272 | 0 | } |
12273 | 0 | uint32_t arg0; |
12274 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12275 | 0 | return false; |
12276 | 0 | } |
12277 | 0 | uint32_t arg1; |
12278 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
12279 | 0 | return false; |
12280 | 0 | } |
12281 | 0 | self->Hint(arg0, arg1); |
12282 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12283 | 0 | args.rval().setUndefined(); |
12284 | 0 | return true; |
12285 | 0 | } |
12286 | | |
12287 | | static const JSJitInfo hint_methodinfo = { |
12288 | | { (JSJitGetterOp)hint }, |
12289 | | { prototypes::id::WebGL2RenderingContext }, |
12290 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12291 | | JSJitInfo::Method, |
12292 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12293 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12294 | | false, /* isInfallible. False in setters. */ |
12295 | | false, /* isMovable. Not relevant for setters. */ |
12296 | | false, /* isEliminatable. Not relevant for setters. */ |
12297 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12298 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12299 | | false, /* isTypedMethod. Only relevant for methods. */ |
12300 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12301 | | }; |
12302 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12303 | | static_assert(0 < 1, "There is no slot for us"); |
12304 | | |
12305 | | MOZ_CAN_RUN_SCRIPT static bool |
12306 | | isBuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12307 | 0 | { |
12308 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isBuffer", DOM, cx); |
12309 | 0 |
|
12310 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12311 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isBuffer"); |
12312 | 0 | } |
12313 | 0 | mozilla::WebGLBuffer* arg0; |
12314 | 0 | if (args[0].isObject()) { |
12315 | 0 | { |
12316 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLBuffer, mozilla::WebGLBuffer>(args[0], arg0); |
12317 | 0 | if (NS_FAILED(rv)) { |
12318 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isBuffer", "WebGLBuffer"); |
12319 | 0 | return false; |
12320 | 0 | } |
12321 | 0 | } |
12322 | 0 | } else if (args[0].isNullOrUndefined()) { |
12323 | 0 | arg0 = nullptr; |
12324 | 0 | } else { |
12325 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isBuffer"); |
12326 | 0 | return false; |
12327 | 0 | } |
12328 | 0 | bool result(self->IsBuffer(MOZ_KnownLive(Constify(arg0)))); |
12329 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12330 | 0 | args.rval().setBoolean(result); |
12331 | 0 | return true; |
12332 | 0 | } |
12333 | | |
12334 | | static const JSJitInfo isBuffer_methodinfo = { |
12335 | | { (JSJitGetterOp)isBuffer }, |
12336 | | { prototypes::id::WebGL2RenderingContext }, |
12337 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12338 | | JSJitInfo::Method, |
12339 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12340 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
12341 | | false, /* isInfallible. False in setters. */ |
12342 | | false, /* isMovable. Not relevant for setters. */ |
12343 | | false, /* isEliminatable. Not relevant for setters. */ |
12344 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12345 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12346 | | false, /* isTypedMethod. Only relevant for methods. */ |
12347 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12348 | | }; |
12349 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12350 | | static_assert(0 < 1, "There is no slot for us"); |
12351 | | |
12352 | | MOZ_CAN_RUN_SCRIPT static bool |
12353 | | isEnabled(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12354 | 0 | { |
12355 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isEnabled", DOM, cx); |
12356 | 0 |
|
12357 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12358 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isEnabled"); |
12359 | 0 | } |
12360 | 0 | uint32_t arg0; |
12361 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12362 | 0 | return false; |
12363 | 0 | } |
12364 | 0 | bool result(self->IsEnabled(arg0)); |
12365 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12366 | 0 | args.rval().setBoolean(result); |
12367 | 0 | return true; |
12368 | 0 | } |
12369 | | |
12370 | | static const JSJitInfo isEnabled_methodinfo = { |
12371 | | { (JSJitGetterOp)isEnabled }, |
12372 | | { prototypes::id::WebGL2RenderingContext }, |
12373 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12374 | | JSJitInfo::Method, |
12375 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12376 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
12377 | | false, /* isInfallible. False in setters. */ |
12378 | | false, /* isMovable. Not relevant for setters. */ |
12379 | | false, /* isEliminatable. Not relevant for setters. */ |
12380 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12381 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12382 | | false, /* isTypedMethod. Only relevant for methods. */ |
12383 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12384 | | }; |
12385 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12386 | | static_assert(0 < 1, "There is no slot for us"); |
12387 | | |
12388 | | MOZ_CAN_RUN_SCRIPT static bool |
12389 | | isFramebuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12390 | 0 | { |
12391 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isFramebuffer", DOM, cx); |
12392 | 0 |
|
12393 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12394 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isFramebuffer"); |
12395 | 0 | } |
12396 | 0 | mozilla::WebGLFramebuffer* arg0; |
12397 | 0 | if (args[0].isObject()) { |
12398 | 0 | { |
12399 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLFramebuffer, mozilla::WebGLFramebuffer>(args[0], arg0); |
12400 | 0 | if (NS_FAILED(rv)) { |
12401 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isFramebuffer", "WebGLFramebuffer"); |
12402 | 0 | return false; |
12403 | 0 | } |
12404 | 0 | } |
12405 | 0 | } else if (args[0].isNullOrUndefined()) { |
12406 | 0 | arg0 = nullptr; |
12407 | 0 | } else { |
12408 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isFramebuffer"); |
12409 | 0 | return false; |
12410 | 0 | } |
12411 | 0 | bool result(self->IsFramebuffer(MOZ_KnownLive(Constify(arg0)))); |
12412 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12413 | 0 | args.rval().setBoolean(result); |
12414 | 0 | return true; |
12415 | 0 | } |
12416 | | |
12417 | | static const JSJitInfo isFramebuffer_methodinfo = { |
12418 | | { (JSJitGetterOp)isFramebuffer }, |
12419 | | { prototypes::id::WebGL2RenderingContext }, |
12420 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12421 | | JSJitInfo::Method, |
12422 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12423 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
12424 | | false, /* isInfallible. False in setters. */ |
12425 | | false, /* isMovable. Not relevant for setters. */ |
12426 | | false, /* isEliminatable. Not relevant for setters. */ |
12427 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12428 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12429 | | false, /* isTypedMethod. Only relevant for methods. */ |
12430 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12431 | | }; |
12432 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12433 | | static_assert(0 < 1, "There is no slot for us"); |
12434 | | |
12435 | | MOZ_CAN_RUN_SCRIPT static bool |
12436 | | isProgram(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12437 | 0 | { |
12438 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isProgram", DOM, cx); |
12439 | 0 |
|
12440 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12441 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isProgram"); |
12442 | 0 | } |
12443 | 0 | mozilla::WebGLProgram* arg0; |
12444 | 0 | if (args[0].isObject()) { |
12445 | 0 | { |
12446 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
12447 | 0 | if (NS_FAILED(rv)) { |
12448 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isProgram", "WebGLProgram"); |
12449 | 0 | return false; |
12450 | 0 | } |
12451 | 0 | } |
12452 | 0 | } else if (args[0].isNullOrUndefined()) { |
12453 | 0 | arg0 = nullptr; |
12454 | 0 | } else { |
12455 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isProgram"); |
12456 | 0 | return false; |
12457 | 0 | } |
12458 | 0 | bool result(self->IsProgram(MOZ_KnownLive(Constify(arg0)))); |
12459 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12460 | 0 | args.rval().setBoolean(result); |
12461 | 0 | return true; |
12462 | 0 | } |
12463 | | |
12464 | | static const JSJitInfo isProgram_methodinfo = { |
12465 | | { (JSJitGetterOp)isProgram }, |
12466 | | { prototypes::id::WebGL2RenderingContext }, |
12467 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12468 | | JSJitInfo::Method, |
12469 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12470 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
12471 | | false, /* isInfallible. False in setters. */ |
12472 | | false, /* isMovable. Not relevant for setters. */ |
12473 | | false, /* isEliminatable. Not relevant for setters. */ |
12474 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12475 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12476 | | false, /* isTypedMethod. Only relevant for methods. */ |
12477 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12478 | | }; |
12479 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12480 | | static_assert(0 < 1, "There is no slot for us"); |
12481 | | |
12482 | | MOZ_CAN_RUN_SCRIPT static bool |
12483 | | isRenderbuffer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12484 | 0 | { |
12485 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isRenderbuffer", DOM, cx); |
12486 | 0 |
|
12487 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12488 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isRenderbuffer"); |
12489 | 0 | } |
12490 | 0 | mozilla::WebGLRenderbuffer* arg0; |
12491 | 0 | if (args[0].isObject()) { |
12492 | 0 | { |
12493 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLRenderbuffer, mozilla::WebGLRenderbuffer>(args[0], arg0); |
12494 | 0 | if (NS_FAILED(rv)) { |
12495 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isRenderbuffer", "WebGLRenderbuffer"); |
12496 | 0 | return false; |
12497 | 0 | } |
12498 | 0 | } |
12499 | 0 | } else if (args[0].isNullOrUndefined()) { |
12500 | 0 | arg0 = nullptr; |
12501 | 0 | } else { |
12502 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isRenderbuffer"); |
12503 | 0 | return false; |
12504 | 0 | } |
12505 | 0 | bool result(self->IsRenderbuffer(MOZ_KnownLive(Constify(arg0)))); |
12506 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12507 | 0 | args.rval().setBoolean(result); |
12508 | 0 | return true; |
12509 | 0 | } |
12510 | | |
12511 | | static const JSJitInfo isRenderbuffer_methodinfo = { |
12512 | | { (JSJitGetterOp)isRenderbuffer }, |
12513 | | { prototypes::id::WebGL2RenderingContext }, |
12514 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12515 | | JSJitInfo::Method, |
12516 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12517 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
12518 | | false, /* isInfallible. False in setters. */ |
12519 | | false, /* isMovable. Not relevant for setters. */ |
12520 | | false, /* isEliminatable. Not relevant for setters. */ |
12521 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12522 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12523 | | false, /* isTypedMethod. Only relevant for methods. */ |
12524 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12525 | | }; |
12526 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12527 | | static_assert(0 < 1, "There is no slot for us"); |
12528 | | |
12529 | | MOZ_CAN_RUN_SCRIPT static bool |
12530 | | isShader(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12531 | 0 | { |
12532 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isShader", DOM, cx); |
12533 | 0 |
|
12534 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12535 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isShader"); |
12536 | 0 | } |
12537 | 0 | mozilla::WebGLShader* arg0; |
12538 | 0 | if (args[0].isObject()) { |
12539 | 0 | { |
12540 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[0], arg0); |
12541 | 0 | if (NS_FAILED(rv)) { |
12542 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isShader", "WebGLShader"); |
12543 | 0 | return false; |
12544 | 0 | } |
12545 | 0 | } |
12546 | 0 | } else if (args[0].isNullOrUndefined()) { |
12547 | 0 | arg0 = nullptr; |
12548 | 0 | } else { |
12549 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isShader"); |
12550 | 0 | return false; |
12551 | 0 | } |
12552 | 0 | bool result(self->IsShader(MOZ_KnownLive(Constify(arg0)))); |
12553 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12554 | 0 | args.rval().setBoolean(result); |
12555 | 0 | return true; |
12556 | 0 | } |
12557 | | |
12558 | | static const JSJitInfo isShader_methodinfo = { |
12559 | | { (JSJitGetterOp)isShader }, |
12560 | | { prototypes::id::WebGL2RenderingContext }, |
12561 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12562 | | JSJitInfo::Method, |
12563 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12564 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
12565 | | false, /* isInfallible. False in setters. */ |
12566 | | false, /* isMovable. Not relevant for setters. */ |
12567 | | false, /* isEliminatable. Not relevant for setters. */ |
12568 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12569 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12570 | | false, /* isTypedMethod. Only relevant for methods. */ |
12571 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12572 | | }; |
12573 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12574 | | static_assert(0 < 1, "There is no slot for us"); |
12575 | | |
12576 | | MOZ_CAN_RUN_SCRIPT static bool |
12577 | | isTexture(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12578 | 0 | { |
12579 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.isTexture", DOM, cx); |
12580 | 0 |
|
12581 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12582 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.isTexture"); |
12583 | 0 | } |
12584 | 0 | mozilla::WebGLTexture* arg0; |
12585 | 0 | if (args[0].isObject()) { |
12586 | 0 | { |
12587 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLTexture, mozilla::WebGLTexture>(args[0], arg0); |
12588 | 0 | if (NS_FAILED(rv)) { |
12589 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.isTexture", "WebGLTexture"); |
12590 | 0 | return false; |
12591 | 0 | } |
12592 | 0 | } |
12593 | 0 | } else if (args[0].isNullOrUndefined()) { |
12594 | 0 | arg0 = nullptr; |
12595 | 0 | } else { |
12596 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.isTexture"); |
12597 | 0 | return false; |
12598 | 0 | } |
12599 | 0 | bool result(self->IsTexture(MOZ_KnownLive(Constify(arg0)))); |
12600 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12601 | 0 | args.rval().setBoolean(result); |
12602 | 0 | return true; |
12603 | 0 | } |
12604 | | |
12605 | | static const JSJitInfo isTexture_methodinfo = { |
12606 | | { (JSJitGetterOp)isTexture }, |
12607 | | { prototypes::id::WebGL2RenderingContext }, |
12608 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12609 | | JSJitInfo::Method, |
12610 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12611 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
12612 | | false, /* isInfallible. False in setters. */ |
12613 | | false, /* isMovable. Not relevant for setters. */ |
12614 | | false, /* isEliminatable. Not relevant for setters. */ |
12615 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12616 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12617 | | false, /* isTypedMethod. Only relevant for methods. */ |
12618 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12619 | | }; |
12620 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12621 | | static_assert(0 < 1, "There is no slot for us"); |
12622 | | |
12623 | | MOZ_CAN_RUN_SCRIPT static bool |
12624 | | lineWidth(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12625 | 0 | { |
12626 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.lineWidth", DOM, cx); |
12627 | 0 |
|
12628 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12629 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.lineWidth"); |
12630 | 0 | } |
12631 | 0 | float arg0; |
12632 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
12633 | 0 | return false; |
12634 | 0 | } |
12635 | 0 | self->LineWidth(arg0); |
12636 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12637 | 0 | args.rval().setUndefined(); |
12638 | 0 | return true; |
12639 | 0 | } |
12640 | | |
12641 | | static const JSJitInfo lineWidth_methodinfo = { |
12642 | | { (JSJitGetterOp)lineWidth }, |
12643 | | { prototypes::id::WebGL2RenderingContext }, |
12644 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12645 | | JSJitInfo::Method, |
12646 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12647 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12648 | | false, /* isInfallible. False in setters. */ |
12649 | | false, /* isMovable. Not relevant for setters. */ |
12650 | | false, /* isEliminatable. Not relevant for setters. */ |
12651 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12652 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12653 | | false, /* isTypedMethod. Only relevant for methods. */ |
12654 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12655 | | }; |
12656 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12657 | | static_assert(0 < 1, "There is no slot for us"); |
12658 | | |
12659 | | MOZ_CAN_RUN_SCRIPT static bool |
12660 | | linkProgram(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12661 | 0 | { |
12662 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.linkProgram", DOM, cx); |
12663 | 0 |
|
12664 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
12665 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.linkProgram"); |
12666 | 0 | } |
12667 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
12668 | 0 | if (args[0].isObject()) { |
12669 | 0 | { |
12670 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
12671 | 0 | if (NS_FAILED(rv)) { |
12672 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.linkProgram", "WebGLProgram"); |
12673 | 0 | return false; |
12674 | 0 | } |
12675 | 0 | } |
12676 | 0 | } else { |
12677 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.linkProgram"); |
12678 | 0 | return false; |
12679 | 0 | } |
12680 | 0 | self->LinkProgram(MOZ_KnownLive(NonNullHelper(arg0))); |
12681 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12682 | 0 | args.rval().setUndefined(); |
12683 | 0 | return true; |
12684 | 0 | } |
12685 | | |
12686 | | static const JSJitInfo linkProgram_methodinfo = { |
12687 | | { (JSJitGetterOp)linkProgram }, |
12688 | | { prototypes::id::WebGL2RenderingContext }, |
12689 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12690 | | JSJitInfo::Method, |
12691 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12692 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12693 | | false, /* isInfallible. False in setters. */ |
12694 | | false, /* isMovable. Not relevant for setters. */ |
12695 | | false, /* isEliminatable. Not relevant for setters. */ |
12696 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12697 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12698 | | false, /* isTypedMethod. Only relevant for methods. */ |
12699 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12700 | | }; |
12701 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12702 | | static_assert(0 < 1, "There is no slot for us"); |
12703 | | |
12704 | | MOZ_CAN_RUN_SCRIPT static bool |
12705 | | pixelStorei(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12706 | 0 | { |
12707 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.pixelStorei", DOM, cx); |
12708 | 0 |
|
12709 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12710 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.pixelStorei"); |
12711 | 0 | } |
12712 | 0 | uint32_t arg0; |
12713 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12714 | 0 | return false; |
12715 | 0 | } |
12716 | 0 | int32_t arg1; |
12717 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
12718 | 0 | return false; |
12719 | 0 | } |
12720 | 0 | self->PixelStorei(arg0, arg1); |
12721 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12722 | 0 | args.rval().setUndefined(); |
12723 | 0 | return true; |
12724 | 0 | } |
12725 | | |
12726 | | static const JSJitInfo pixelStorei_methodinfo = { |
12727 | | { (JSJitGetterOp)pixelStorei }, |
12728 | | { prototypes::id::WebGL2RenderingContext }, |
12729 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12730 | | JSJitInfo::Method, |
12731 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12732 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12733 | | false, /* isInfallible. False in setters. */ |
12734 | | false, /* isMovable. Not relevant for setters. */ |
12735 | | false, /* isEliminatable. Not relevant for setters. */ |
12736 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12737 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12738 | | false, /* isTypedMethod. Only relevant for methods. */ |
12739 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12740 | | }; |
12741 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12742 | | static_assert(0 < 1, "There is no slot for us"); |
12743 | | |
12744 | | MOZ_CAN_RUN_SCRIPT static bool |
12745 | | polygonOffset(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12746 | 0 | { |
12747 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.polygonOffset", DOM, cx); |
12748 | 0 |
|
12749 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12750 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.polygonOffset"); |
12751 | 0 | } |
12752 | 0 | float arg0; |
12753 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
12754 | 0 | return false; |
12755 | 0 | } |
12756 | 0 | float arg1; |
12757 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
12758 | 0 | return false; |
12759 | 0 | } |
12760 | 0 | self->PolygonOffset(arg0, arg1); |
12761 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12762 | 0 | args.rval().setUndefined(); |
12763 | 0 | return true; |
12764 | 0 | } |
12765 | | |
12766 | | static const JSJitInfo polygonOffset_methodinfo = { |
12767 | | { (JSJitGetterOp)polygonOffset }, |
12768 | | { prototypes::id::WebGL2RenderingContext }, |
12769 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12770 | | JSJitInfo::Method, |
12771 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12772 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12773 | | false, /* isInfallible. False in setters. */ |
12774 | | false, /* isMovable. Not relevant for setters. */ |
12775 | | false, /* isEliminatable. Not relevant for setters. */ |
12776 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12777 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12778 | | false, /* isTypedMethod. Only relevant for methods. */ |
12779 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12780 | | }; |
12781 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12782 | | static_assert(0 < 1, "There is no slot for us"); |
12783 | | |
12784 | | MOZ_CAN_RUN_SCRIPT static bool |
12785 | | renderbufferStorage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12786 | 0 | { |
12787 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.renderbufferStorage", DOM, cx); |
12788 | 0 |
|
12789 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
12790 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.renderbufferStorage"); |
12791 | 0 | } |
12792 | 0 | uint32_t arg0; |
12793 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12794 | 0 | return false; |
12795 | 0 | } |
12796 | 0 | uint32_t arg1; |
12797 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
12798 | 0 | return false; |
12799 | 0 | } |
12800 | 0 | int32_t arg2; |
12801 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
12802 | 0 | return false; |
12803 | 0 | } |
12804 | 0 | int32_t arg3; |
12805 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
12806 | 0 | return false; |
12807 | 0 | } |
12808 | 0 | self->RenderbufferStorage(arg0, arg1, arg2, arg3); |
12809 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12810 | 0 | args.rval().setUndefined(); |
12811 | 0 | return true; |
12812 | 0 | } |
12813 | | |
12814 | | static const JSJitInfo renderbufferStorage_methodinfo = { |
12815 | | { (JSJitGetterOp)renderbufferStorage }, |
12816 | | { prototypes::id::WebGL2RenderingContext }, |
12817 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12818 | | JSJitInfo::Method, |
12819 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12820 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12821 | | false, /* isInfallible. False in setters. */ |
12822 | | false, /* isMovable. Not relevant for setters. */ |
12823 | | false, /* isEliminatable. Not relevant for setters. */ |
12824 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12825 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12826 | | false, /* isTypedMethod. Only relevant for methods. */ |
12827 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12828 | | }; |
12829 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12830 | | static_assert(0 < 1, "There is no slot for us"); |
12831 | | |
12832 | | MOZ_CAN_RUN_SCRIPT static bool |
12833 | | sampleCoverage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12834 | 0 | { |
12835 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.sampleCoverage", DOM, cx); |
12836 | 0 |
|
12837 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12838 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.sampleCoverage"); |
12839 | 0 | } |
12840 | 0 | float arg0; |
12841 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
12842 | 0 | return false; |
12843 | 0 | } |
12844 | 0 | bool arg1; |
12845 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) { |
12846 | 0 | return false; |
12847 | 0 | } |
12848 | 0 | self->SampleCoverage(arg0, arg1); |
12849 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12850 | 0 | args.rval().setUndefined(); |
12851 | 0 | return true; |
12852 | 0 | } |
12853 | | |
12854 | | static const JSJitInfo sampleCoverage_methodinfo = { |
12855 | | { (JSJitGetterOp)sampleCoverage }, |
12856 | | { prototypes::id::WebGL2RenderingContext }, |
12857 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12858 | | JSJitInfo::Method, |
12859 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12860 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12861 | | false, /* isInfallible. False in setters. */ |
12862 | | false, /* isMovable. Not relevant for setters. */ |
12863 | | false, /* isEliminatable. Not relevant for setters. */ |
12864 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12865 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12866 | | false, /* isTypedMethod. Only relevant for methods. */ |
12867 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12868 | | }; |
12869 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12870 | | static_assert(0 < 1, "There is no slot for us"); |
12871 | | |
12872 | | MOZ_CAN_RUN_SCRIPT static bool |
12873 | | scissor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12874 | 0 | { |
12875 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.scissor", DOM, cx); |
12876 | 0 |
|
12877 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
12878 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.scissor"); |
12879 | 0 | } |
12880 | 0 | int32_t arg0; |
12881 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) { |
12882 | 0 | return false; |
12883 | 0 | } |
12884 | 0 | int32_t arg1; |
12885 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
12886 | 0 | return false; |
12887 | 0 | } |
12888 | 0 | int32_t arg2; |
12889 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
12890 | 0 | return false; |
12891 | 0 | } |
12892 | 0 | int32_t arg3; |
12893 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
12894 | 0 | return false; |
12895 | 0 | } |
12896 | 0 | self->Scissor(arg0, arg1, arg2, arg3); |
12897 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12898 | 0 | args.rval().setUndefined(); |
12899 | 0 | return true; |
12900 | 0 | } |
12901 | | |
12902 | | static const JSJitInfo scissor_methodinfo = { |
12903 | | { (JSJitGetterOp)scissor }, |
12904 | | { prototypes::id::WebGL2RenderingContext }, |
12905 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12906 | | JSJitInfo::Method, |
12907 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12908 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12909 | | false, /* isInfallible. False in setters. */ |
12910 | | false, /* isMovable. Not relevant for setters. */ |
12911 | | false, /* isEliminatable. Not relevant for setters. */ |
12912 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12913 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12914 | | false, /* isTypedMethod. Only relevant for methods. */ |
12915 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12916 | | }; |
12917 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12918 | | static_assert(0 < 1, "There is no slot for us"); |
12919 | | |
12920 | | MOZ_CAN_RUN_SCRIPT static bool |
12921 | | shaderSource(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12922 | 0 | { |
12923 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.shaderSource", DOM, cx); |
12924 | 0 |
|
12925 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
12926 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.shaderSource"); |
12927 | 0 | } |
12928 | 0 | NonNull<mozilla::WebGLShader> arg0; |
12929 | 0 | if (args[0].isObject()) { |
12930 | 0 | { |
12931 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLShader, mozilla::WebGLShader>(args[0], arg0); |
12932 | 0 | if (NS_FAILED(rv)) { |
12933 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.shaderSource", "WebGLShader"); |
12934 | 0 | return false; |
12935 | 0 | } |
12936 | 0 | } |
12937 | 0 | } else { |
12938 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.shaderSource"); |
12939 | 0 | return false; |
12940 | 0 | } |
12941 | 0 | binding_detail::FakeString arg1; |
12942 | 0 | if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) { |
12943 | 0 | return false; |
12944 | 0 | } |
12945 | 0 | self->ShaderSource(MOZ_KnownLive(NonNullHelper(arg0)), NonNullHelper(Constify(arg1))); |
12946 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12947 | 0 | args.rval().setUndefined(); |
12948 | 0 | return true; |
12949 | 0 | } |
12950 | | |
12951 | | static const JSJitInfo shaderSource_methodinfo = { |
12952 | | { (JSJitGetterOp)shaderSource }, |
12953 | | { prototypes::id::WebGL2RenderingContext }, |
12954 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12955 | | JSJitInfo::Method, |
12956 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
12957 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
12958 | | false, /* isInfallible. False in setters. */ |
12959 | | false, /* isMovable. Not relevant for setters. */ |
12960 | | false, /* isEliminatable. Not relevant for setters. */ |
12961 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
12962 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
12963 | | false, /* isTypedMethod. Only relevant for methods. */ |
12964 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
12965 | | }; |
12966 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
12967 | | static_assert(0 < 1, "There is no slot for us"); |
12968 | | |
12969 | | MOZ_CAN_RUN_SCRIPT static bool |
12970 | | stencilFunc(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
12971 | 0 | { |
12972 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.stencilFunc", DOM, cx); |
12973 | 0 |
|
12974 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
12975 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.stencilFunc"); |
12976 | 0 | } |
12977 | 0 | uint32_t arg0; |
12978 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
12979 | 0 | return false; |
12980 | 0 | } |
12981 | 0 | int32_t arg1; |
12982 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
12983 | 0 | return false; |
12984 | 0 | } |
12985 | 0 | uint32_t arg2; |
12986 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
12987 | 0 | return false; |
12988 | 0 | } |
12989 | 0 | self->StencilFunc(arg0, arg1, arg2); |
12990 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
12991 | 0 | args.rval().setUndefined(); |
12992 | 0 | return true; |
12993 | 0 | } |
12994 | | |
12995 | | static const JSJitInfo stencilFunc_methodinfo = { |
12996 | | { (JSJitGetterOp)stencilFunc }, |
12997 | | { prototypes::id::WebGL2RenderingContext }, |
12998 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
12999 | | JSJitInfo::Method, |
13000 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13001 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13002 | | false, /* isInfallible. False in setters. */ |
13003 | | false, /* isMovable. Not relevant for setters. */ |
13004 | | false, /* isEliminatable. Not relevant for setters. */ |
13005 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13006 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13007 | | false, /* isTypedMethod. Only relevant for methods. */ |
13008 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13009 | | }; |
13010 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13011 | | static_assert(0 < 1, "There is no slot for us"); |
13012 | | |
13013 | | MOZ_CAN_RUN_SCRIPT static bool |
13014 | | stencilFuncSeparate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13015 | 0 | { |
13016 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.stencilFuncSeparate", DOM, cx); |
13017 | 0 |
|
13018 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
13019 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.stencilFuncSeparate"); |
13020 | 0 | } |
13021 | 0 | uint32_t arg0; |
13022 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13023 | 0 | return false; |
13024 | 0 | } |
13025 | 0 | uint32_t arg1; |
13026 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
13027 | 0 | return false; |
13028 | 0 | } |
13029 | 0 | int32_t arg2; |
13030 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
13031 | 0 | return false; |
13032 | 0 | } |
13033 | 0 | uint32_t arg3; |
13034 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
13035 | 0 | return false; |
13036 | 0 | } |
13037 | 0 | self->StencilFuncSeparate(arg0, arg1, arg2, arg3); |
13038 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13039 | 0 | args.rval().setUndefined(); |
13040 | 0 | return true; |
13041 | 0 | } |
13042 | | |
13043 | | static const JSJitInfo stencilFuncSeparate_methodinfo = { |
13044 | | { (JSJitGetterOp)stencilFuncSeparate }, |
13045 | | { prototypes::id::WebGL2RenderingContext }, |
13046 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13047 | | JSJitInfo::Method, |
13048 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13049 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13050 | | false, /* isInfallible. False in setters. */ |
13051 | | false, /* isMovable. Not relevant for setters. */ |
13052 | | false, /* isEliminatable. Not relevant for setters. */ |
13053 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13054 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13055 | | false, /* isTypedMethod. Only relevant for methods. */ |
13056 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13057 | | }; |
13058 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13059 | | static_assert(0 < 1, "There is no slot for us"); |
13060 | | |
13061 | | MOZ_CAN_RUN_SCRIPT static bool |
13062 | | stencilMask(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13063 | 0 | { |
13064 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.stencilMask", DOM, cx); |
13065 | 0 |
|
13066 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
13067 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.stencilMask"); |
13068 | 0 | } |
13069 | 0 | uint32_t arg0; |
13070 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13071 | 0 | return false; |
13072 | 0 | } |
13073 | 0 | self->StencilMask(arg0); |
13074 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13075 | 0 | args.rval().setUndefined(); |
13076 | 0 | return true; |
13077 | 0 | } |
13078 | | |
13079 | | static const JSJitInfo stencilMask_methodinfo = { |
13080 | | { (JSJitGetterOp)stencilMask }, |
13081 | | { prototypes::id::WebGL2RenderingContext }, |
13082 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13083 | | JSJitInfo::Method, |
13084 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13085 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13086 | | false, /* isInfallible. False in setters. */ |
13087 | | false, /* isMovable. Not relevant for setters. */ |
13088 | | false, /* isEliminatable. Not relevant for setters. */ |
13089 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13090 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13091 | | false, /* isTypedMethod. Only relevant for methods. */ |
13092 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13093 | | }; |
13094 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13095 | | static_assert(0 < 1, "There is no slot for us"); |
13096 | | |
13097 | | MOZ_CAN_RUN_SCRIPT static bool |
13098 | | stencilMaskSeparate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13099 | 0 | { |
13100 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.stencilMaskSeparate", DOM, cx); |
13101 | 0 |
|
13102 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
13103 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.stencilMaskSeparate"); |
13104 | 0 | } |
13105 | 0 | uint32_t arg0; |
13106 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13107 | 0 | return false; |
13108 | 0 | } |
13109 | 0 | uint32_t arg1; |
13110 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
13111 | 0 | return false; |
13112 | 0 | } |
13113 | 0 | self->StencilMaskSeparate(arg0, arg1); |
13114 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13115 | 0 | args.rval().setUndefined(); |
13116 | 0 | return true; |
13117 | 0 | } |
13118 | | |
13119 | | static const JSJitInfo stencilMaskSeparate_methodinfo = { |
13120 | | { (JSJitGetterOp)stencilMaskSeparate }, |
13121 | | { prototypes::id::WebGL2RenderingContext }, |
13122 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13123 | | JSJitInfo::Method, |
13124 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13125 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13126 | | false, /* isInfallible. False in setters. */ |
13127 | | false, /* isMovable. Not relevant for setters. */ |
13128 | | false, /* isEliminatable. Not relevant for setters. */ |
13129 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13130 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13131 | | false, /* isTypedMethod. Only relevant for methods. */ |
13132 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13133 | | }; |
13134 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13135 | | static_assert(0 < 1, "There is no slot for us"); |
13136 | | |
13137 | | MOZ_CAN_RUN_SCRIPT static bool |
13138 | | stencilOp(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13139 | 0 | { |
13140 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.stencilOp", DOM, cx); |
13141 | 0 |
|
13142 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
13143 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.stencilOp"); |
13144 | 0 | } |
13145 | 0 | uint32_t arg0; |
13146 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13147 | 0 | return false; |
13148 | 0 | } |
13149 | 0 | uint32_t arg1; |
13150 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
13151 | 0 | return false; |
13152 | 0 | } |
13153 | 0 | uint32_t arg2; |
13154 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
13155 | 0 | return false; |
13156 | 0 | } |
13157 | 0 | self->StencilOp(arg0, arg1, arg2); |
13158 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13159 | 0 | args.rval().setUndefined(); |
13160 | 0 | return true; |
13161 | 0 | } |
13162 | | |
13163 | | static const JSJitInfo stencilOp_methodinfo = { |
13164 | | { (JSJitGetterOp)stencilOp }, |
13165 | | { prototypes::id::WebGL2RenderingContext }, |
13166 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13167 | | JSJitInfo::Method, |
13168 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13169 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13170 | | false, /* isInfallible. False in setters. */ |
13171 | | false, /* isMovable. Not relevant for setters. */ |
13172 | | false, /* isEliminatable. Not relevant for setters. */ |
13173 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13174 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13175 | | false, /* isTypedMethod. Only relevant for methods. */ |
13176 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13177 | | }; |
13178 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13179 | | static_assert(0 < 1, "There is no slot for us"); |
13180 | | |
13181 | | MOZ_CAN_RUN_SCRIPT static bool |
13182 | | stencilOpSeparate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13183 | 0 | { |
13184 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.stencilOpSeparate", DOM, cx); |
13185 | 0 |
|
13186 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
13187 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.stencilOpSeparate"); |
13188 | 0 | } |
13189 | 0 | uint32_t arg0; |
13190 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13191 | 0 | return false; |
13192 | 0 | } |
13193 | 0 | uint32_t arg1; |
13194 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
13195 | 0 | return false; |
13196 | 0 | } |
13197 | 0 | uint32_t arg2; |
13198 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
13199 | 0 | return false; |
13200 | 0 | } |
13201 | 0 | uint32_t arg3; |
13202 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) { |
13203 | 0 | return false; |
13204 | 0 | } |
13205 | 0 | self->StencilOpSeparate(arg0, arg1, arg2, arg3); |
13206 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13207 | 0 | args.rval().setUndefined(); |
13208 | 0 | return true; |
13209 | 0 | } |
13210 | | |
13211 | | static const JSJitInfo stencilOpSeparate_methodinfo = { |
13212 | | { (JSJitGetterOp)stencilOpSeparate }, |
13213 | | { prototypes::id::WebGL2RenderingContext }, |
13214 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13215 | | JSJitInfo::Method, |
13216 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13217 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13218 | | false, /* isInfallible. False in setters. */ |
13219 | | false, /* isMovable. Not relevant for setters. */ |
13220 | | false, /* isEliminatable. Not relevant for setters. */ |
13221 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13222 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13223 | | false, /* isTypedMethod. Only relevant for methods. */ |
13224 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13225 | | }; |
13226 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13227 | | static_assert(0 < 1, "There is no slot for us"); |
13228 | | |
13229 | | MOZ_CAN_RUN_SCRIPT static bool |
13230 | | texParameterf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13231 | 0 | { |
13232 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texParameterf", DOM, cx); |
13233 | 0 |
|
13234 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
13235 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texParameterf"); |
13236 | 0 | } |
13237 | 0 | uint32_t arg0; |
13238 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13239 | 0 | return false; |
13240 | 0 | } |
13241 | 0 | uint32_t arg1; |
13242 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
13243 | 0 | return false; |
13244 | 0 | } |
13245 | 0 | float arg2; |
13246 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
13247 | 0 | return false; |
13248 | 0 | } |
13249 | 0 | self->TexParameterf(arg0, arg1, arg2); |
13250 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13251 | 0 | args.rval().setUndefined(); |
13252 | 0 | return true; |
13253 | 0 | } |
13254 | | |
13255 | | static const JSJitInfo texParameterf_methodinfo = { |
13256 | | { (JSJitGetterOp)texParameterf }, |
13257 | | { prototypes::id::WebGL2RenderingContext }, |
13258 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13259 | | JSJitInfo::Method, |
13260 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13261 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13262 | | false, /* isInfallible. False in setters. */ |
13263 | | false, /* isMovable. Not relevant for setters. */ |
13264 | | false, /* isEliminatable. Not relevant for setters. */ |
13265 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13266 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13267 | | false, /* isTypedMethod. Only relevant for methods. */ |
13268 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13269 | | }; |
13270 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13271 | | static_assert(0 < 1, "There is no slot for us"); |
13272 | | |
13273 | | MOZ_CAN_RUN_SCRIPT static bool |
13274 | | texParameteri(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13275 | 0 | { |
13276 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.texParameteri", DOM, cx); |
13277 | 0 |
|
13278 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
13279 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.texParameteri"); |
13280 | 0 | } |
13281 | 0 | uint32_t arg0; |
13282 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13283 | 0 | return false; |
13284 | 0 | } |
13285 | 0 | uint32_t arg1; |
13286 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) { |
13287 | 0 | return false; |
13288 | 0 | } |
13289 | 0 | int32_t arg2; |
13290 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
13291 | 0 | return false; |
13292 | 0 | } |
13293 | 0 | self->TexParameteri(arg0, arg1, arg2); |
13294 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13295 | 0 | args.rval().setUndefined(); |
13296 | 0 | return true; |
13297 | 0 | } |
13298 | | |
13299 | | static const JSJitInfo texParameteri_methodinfo = { |
13300 | | { (JSJitGetterOp)texParameteri }, |
13301 | | { prototypes::id::WebGL2RenderingContext }, |
13302 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13303 | | JSJitInfo::Method, |
13304 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13305 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13306 | | false, /* isInfallible. False in setters. */ |
13307 | | false, /* isMovable. Not relevant for setters. */ |
13308 | | false, /* isEliminatable. Not relevant for setters. */ |
13309 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13310 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13311 | | false, /* isTypedMethod. Only relevant for methods. */ |
13312 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13313 | | }; |
13314 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13315 | | static_assert(0 < 1, "There is no slot for us"); |
13316 | | |
13317 | | MOZ_CAN_RUN_SCRIPT static bool |
13318 | | uniform1f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13319 | 0 | { |
13320 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform1f", DOM, cx); |
13321 | 0 |
|
13322 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
13323 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform1f"); |
13324 | 0 | } |
13325 | 0 | mozilla::WebGLUniformLocation* arg0; |
13326 | 0 | if (args[0].isObject()) { |
13327 | 0 | { |
13328 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13329 | 0 | if (NS_FAILED(rv)) { |
13330 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform1f", "WebGLUniformLocation"); |
13331 | 0 | return false; |
13332 | 0 | } |
13333 | 0 | } |
13334 | 0 | } else if (args[0].isNullOrUndefined()) { |
13335 | 0 | arg0 = nullptr; |
13336 | 0 | } else { |
13337 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform1f"); |
13338 | 0 | return false; |
13339 | 0 | } |
13340 | 0 | float arg1; |
13341 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
13342 | 0 | return false; |
13343 | 0 | } |
13344 | 0 | self->Uniform1f(MOZ_KnownLive(Constify(arg0)), arg1); |
13345 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13346 | 0 | args.rval().setUndefined(); |
13347 | 0 | return true; |
13348 | 0 | } |
13349 | | |
13350 | | static const JSJitInfo uniform1f_methodinfo = { |
13351 | | { (JSJitGetterOp)uniform1f }, |
13352 | | { prototypes::id::WebGL2RenderingContext }, |
13353 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13354 | | JSJitInfo::Method, |
13355 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13356 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13357 | | false, /* isInfallible. False in setters. */ |
13358 | | false, /* isMovable. Not relevant for setters. */ |
13359 | | false, /* isEliminatable. Not relevant for setters. */ |
13360 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13361 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13362 | | false, /* isTypedMethod. Only relevant for methods. */ |
13363 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13364 | | }; |
13365 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13366 | | static_assert(0 < 1, "There is no slot for us"); |
13367 | | |
13368 | | MOZ_CAN_RUN_SCRIPT static bool |
13369 | | uniform2f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13370 | 0 | { |
13371 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform2f", DOM, cx); |
13372 | 0 |
|
13373 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
13374 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform2f"); |
13375 | 0 | } |
13376 | 0 | mozilla::WebGLUniformLocation* arg0; |
13377 | 0 | if (args[0].isObject()) { |
13378 | 0 | { |
13379 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13380 | 0 | if (NS_FAILED(rv)) { |
13381 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform2f", "WebGLUniformLocation"); |
13382 | 0 | return false; |
13383 | 0 | } |
13384 | 0 | } |
13385 | 0 | } else if (args[0].isNullOrUndefined()) { |
13386 | 0 | arg0 = nullptr; |
13387 | 0 | } else { |
13388 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform2f"); |
13389 | 0 | return false; |
13390 | 0 | } |
13391 | 0 | float arg1; |
13392 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
13393 | 0 | return false; |
13394 | 0 | } |
13395 | 0 | float arg2; |
13396 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
13397 | 0 | return false; |
13398 | 0 | } |
13399 | 0 | self->Uniform2f(MOZ_KnownLive(Constify(arg0)), arg1, arg2); |
13400 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13401 | 0 | args.rval().setUndefined(); |
13402 | 0 | return true; |
13403 | 0 | } |
13404 | | |
13405 | | static const JSJitInfo uniform2f_methodinfo = { |
13406 | | { (JSJitGetterOp)uniform2f }, |
13407 | | { prototypes::id::WebGL2RenderingContext }, |
13408 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13409 | | JSJitInfo::Method, |
13410 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13411 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13412 | | false, /* isInfallible. False in setters. */ |
13413 | | false, /* isMovable. Not relevant for setters. */ |
13414 | | false, /* isEliminatable. Not relevant for setters. */ |
13415 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13416 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13417 | | false, /* isTypedMethod. Only relevant for methods. */ |
13418 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13419 | | }; |
13420 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13421 | | static_assert(0 < 1, "There is no slot for us"); |
13422 | | |
13423 | | MOZ_CAN_RUN_SCRIPT static bool |
13424 | | uniform3f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13425 | 0 | { |
13426 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform3f", DOM, cx); |
13427 | 0 |
|
13428 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
13429 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform3f"); |
13430 | 0 | } |
13431 | 0 | mozilla::WebGLUniformLocation* arg0; |
13432 | 0 | if (args[0].isObject()) { |
13433 | 0 | { |
13434 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13435 | 0 | if (NS_FAILED(rv)) { |
13436 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform3f", "WebGLUniformLocation"); |
13437 | 0 | return false; |
13438 | 0 | } |
13439 | 0 | } |
13440 | 0 | } else if (args[0].isNullOrUndefined()) { |
13441 | 0 | arg0 = nullptr; |
13442 | 0 | } else { |
13443 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform3f"); |
13444 | 0 | return false; |
13445 | 0 | } |
13446 | 0 | float arg1; |
13447 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
13448 | 0 | return false; |
13449 | 0 | } |
13450 | 0 | float arg2; |
13451 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
13452 | 0 | return false; |
13453 | 0 | } |
13454 | 0 | float arg3; |
13455 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[3], &arg3)) { |
13456 | 0 | return false; |
13457 | 0 | } |
13458 | 0 | self->Uniform3f(MOZ_KnownLive(Constify(arg0)), arg1, arg2, arg3); |
13459 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13460 | 0 | args.rval().setUndefined(); |
13461 | 0 | return true; |
13462 | 0 | } |
13463 | | |
13464 | | static const JSJitInfo uniform3f_methodinfo = { |
13465 | | { (JSJitGetterOp)uniform3f }, |
13466 | | { prototypes::id::WebGL2RenderingContext }, |
13467 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13468 | | JSJitInfo::Method, |
13469 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13470 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13471 | | false, /* isInfallible. False in setters. */ |
13472 | | false, /* isMovable. Not relevant for setters. */ |
13473 | | false, /* isEliminatable. Not relevant for setters. */ |
13474 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13475 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13476 | | false, /* isTypedMethod. Only relevant for methods. */ |
13477 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13478 | | }; |
13479 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13480 | | static_assert(0 < 1, "There is no slot for us"); |
13481 | | |
13482 | | MOZ_CAN_RUN_SCRIPT static bool |
13483 | | uniform4f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13484 | 0 | { |
13485 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform4f", DOM, cx); |
13486 | 0 |
|
13487 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
13488 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform4f"); |
13489 | 0 | } |
13490 | 0 | mozilla::WebGLUniformLocation* arg0; |
13491 | 0 | if (args[0].isObject()) { |
13492 | 0 | { |
13493 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13494 | 0 | if (NS_FAILED(rv)) { |
13495 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform4f", "WebGLUniformLocation"); |
13496 | 0 | return false; |
13497 | 0 | } |
13498 | 0 | } |
13499 | 0 | } else if (args[0].isNullOrUndefined()) { |
13500 | 0 | arg0 = nullptr; |
13501 | 0 | } else { |
13502 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform4f"); |
13503 | 0 | return false; |
13504 | 0 | } |
13505 | 0 | float arg1; |
13506 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
13507 | 0 | return false; |
13508 | 0 | } |
13509 | 0 | float arg2; |
13510 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
13511 | 0 | return false; |
13512 | 0 | } |
13513 | 0 | float arg3; |
13514 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[3], &arg3)) { |
13515 | 0 | return false; |
13516 | 0 | } |
13517 | 0 | float arg4; |
13518 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[4], &arg4)) { |
13519 | 0 | return false; |
13520 | 0 | } |
13521 | 0 | self->Uniform4f(MOZ_KnownLive(Constify(arg0)), arg1, arg2, arg3, arg4); |
13522 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13523 | 0 | args.rval().setUndefined(); |
13524 | 0 | return true; |
13525 | 0 | } |
13526 | | |
13527 | | static const JSJitInfo uniform4f_methodinfo = { |
13528 | | { (JSJitGetterOp)uniform4f }, |
13529 | | { prototypes::id::WebGL2RenderingContext }, |
13530 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13531 | | JSJitInfo::Method, |
13532 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13533 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13534 | | false, /* isInfallible. False in setters. */ |
13535 | | false, /* isMovable. Not relevant for setters. */ |
13536 | | false, /* isEliminatable. Not relevant for setters. */ |
13537 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13538 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13539 | | false, /* isTypedMethod. Only relevant for methods. */ |
13540 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13541 | | }; |
13542 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13543 | | static_assert(0 < 1, "There is no slot for us"); |
13544 | | |
13545 | | MOZ_CAN_RUN_SCRIPT static bool |
13546 | | uniform1i(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13547 | 0 | { |
13548 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform1i", DOM, cx); |
13549 | 0 |
|
13550 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
13551 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform1i"); |
13552 | 0 | } |
13553 | 0 | mozilla::WebGLUniformLocation* arg0; |
13554 | 0 | if (args[0].isObject()) { |
13555 | 0 | { |
13556 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13557 | 0 | if (NS_FAILED(rv)) { |
13558 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform1i", "WebGLUniformLocation"); |
13559 | 0 | return false; |
13560 | 0 | } |
13561 | 0 | } |
13562 | 0 | } else if (args[0].isNullOrUndefined()) { |
13563 | 0 | arg0 = nullptr; |
13564 | 0 | } else { |
13565 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform1i"); |
13566 | 0 | return false; |
13567 | 0 | } |
13568 | 0 | int32_t arg1; |
13569 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
13570 | 0 | return false; |
13571 | 0 | } |
13572 | 0 | self->Uniform1i(MOZ_KnownLive(Constify(arg0)), arg1); |
13573 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13574 | 0 | args.rval().setUndefined(); |
13575 | 0 | return true; |
13576 | 0 | } |
13577 | | |
13578 | | static const JSJitInfo uniform1i_methodinfo = { |
13579 | | { (JSJitGetterOp)uniform1i }, |
13580 | | { prototypes::id::WebGL2RenderingContext }, |
13581 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13582 | | JSJitInfo::Method, |
13583 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13584 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13585 | | false, /* isInfallible. False in setters. */ |
13586 | | false, /* isMovable. Not relevant for setters. */ |
13587 | | false, /* isEliminatable. Not relevant for setters. */ |
13588 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13589 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13590 | | false, /* isTypedMethod. Only relevant for methods. */ |
13591 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13592 | | }; |
13593 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13594 | | static_assert(0 < 1, "There is no slot for us"); |
13595 | | |
13596 | | MOZ_CAN_RUN_SCRIPT static bool |
13597 | | uniform2i(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13598 | 0 | { |
13599 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform2i", DOM, cx); |
13600 | 0 |
|
13601 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
13602 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform2i"); |
13603 | 0 | } |
13604 | 0 | mozilla::WebGLUniformLocation* arg0; |
13605 | 0 | if (args[0].isObject()) { |
13606 | 0 | { |
13607 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13608 | 0 | if (NS_FAILED(rv)) { |
13609 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform2i", "WebGLUniformLocation"); |
13610 | 0 | return false; |
13611 | 0 | } |
13612 | 0 | } |
13613 | 0 | } else if (args[0].isNullOrUndefined()) { |
13614 | 0 | arg0 = nullptr; |
13615 | 0 | } else { |
13616 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform2i"); |
13617 | 0 | return false; |
13618 | 0 | } |
13619 | 0 | int32_t arg1; |
13620 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
13621 | 0 | return false; |
13622 | 0 | } |
13623 | 0 | int32_t arg2; |
13624 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
13625 | 0 | return false; |
13626 | 0 | } |
13627 | 0 | self->Uniform2i(MOZ_KnownLive(Constify(arg0)), arg1, arg2); |
13628 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13629 | 0 | args.rval().setUndefined(); |
13630 | 0 | return true; |
13631 | 0 | } |
13632 | | |
13633 | | static const JSJitInfo uniform2i_methodinfo = { |
13634 | | { (JSJitGetterOp)uniform2i }, |
13635 | | { prototypes::id::WebGL2RenderingContext }, |
13636 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13637 | | JSJitInfo::Method, |
13638 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13639 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13640 | | false, /* isInfallible. False in setters. */ |
13641 | | false, /* isMovable. Not relevant for setters. */ |
13642 | | false, /* isEliminatable. Not relevant for setters. */ |
13643 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13644 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13645 | | false, /* isTypedMethod. Only relevant for methods. */ |
13646 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13647 | | }; |
13648 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13649 | | static_assert(0 < 1, "There is no slot for us"); |
13650 | | |
13651 | | MOZ_CAN_RUN_SCRIPT static bool |
13652 | | uniform3i(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13653 | 0 | { |
13654 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform3i", DOM, cx); |
13655 | 0 |
|
13656 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
13657 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform3i"); |
13658 | 0 | } |
13659 | 0 | mozilla::WebGLUniformLocation* arg0; |
13660 | 0 | if (args[0].isObject()) { |
13661 | 0 | { |
13662 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13663 | 0 | if (NS_FAILED(rv)) { |
13664 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform3i", "WebGLUniformLocation"); |
13665 | 0 | return false; |
13666 | 0 | } |
13667 | 0 | } |
13668 | 0 | } else if (args[0].isNullOrUndefined()) { |
13669 | 0 | arg0 = nullptr; |
13670 | 0 | } else { |
13671 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform3i"); |
13672 | 0 | return false; |
13673 | 0 | } |
13674 | 0 | int32_t arg1; |
13675 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
13676 | 0 | return false; |
13677 | 0 | } |
13678 | 0 | int32_t arg2; |
13679 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
13680 | 0 | return false; |
13681 | 0 | } |
13682 | 0 | int32_t arg3; |
13683 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
13684 | 0 | return false; |
13685 | 0 | } |
13686 | 0 | self->Uniform3i(MOZ_KnownLive(Constify(arg0)), arg1, arg2, arg3); |
13687 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13688 | 0 | args.rval().setUndefined(); |
13689 | 0 | return true; |
13690 | 0 | } |
13691 | | |
13692 | | static const JSJitInfo uniform3i_methodinfo = { |
13693 | | { (JSJitGetterOp)uniform3i }, |
13694 | | { prototypes::id::WebGL2RenderingContext }, |
13695 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13696 | | JSJitInfo::Method, |
13697 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13698 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13699 | | false, /* isInfallible. False in setters. */ |
13700 | | false, /* isMovable. Not relevant for setters. */ |
13701 | | false, /* isEliminatable. Not relevant for setters. */ |
13702 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13703 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13704 | | false, /* isTypedMethod. Only relevant for methods. */ |
13705 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13706 | | }; |
13707 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13708 | | static_assert(0 < 1, "There is no slot for us"); |
13709 | | |
13710 | | MOZ_CAN_RUN_SCRIPT static bool |
13711 | | uniform4i(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13712 | 0 | { |
13713 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.uniform4i", DOM, cx); |
13714 | 0 |
|
13715 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
13716 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.uniform4i"); |
13717 | 0 | } |
13718 | 0 | mozilla::WebGLUniformLocation* arg0; |
13719 | 0 | if (args[0].isObject()) { |
13720 | 0 | { |
13721 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLUniformLocation, mozilla::WebGLUniformLocation>(args[0], arg0); |
13722 | 0 | if (NS_FAILED(rv)) { |
13723 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.uniform4i", "WebGLUniformLocation"); |
13724 | 0 | return false; |
13725 | 0 | } |
13726 | 0 | } |
13727 | 0 | } else if (args[0].isNullOrUndefined()) { |
13728 | 0 | arg0 = nullptr; |
13729 | 0 | } else { |
13730 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.uniform4i"); |
13731 | 0 | return false; |
13732 | 0 | } |
13733 | 0 | int32_t arg1; |
13734 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
13735 | 0 | return false; |
13736 | 0 | } |
13737 | 0 | int32_t arg2; |
13738 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
13739 | 0 | return false; |
13740 | 0 | } |
13741 | 0 | int32_t arg3; |
13742 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
13743 | 0 | return false; |
13744 | 0 | } |
13745 | 0 | int32_t arg4; |
13746 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
13747 | 0 | return false; |
13748 | 0 | } |
13749 | 0 | self->Uniform4i(MOZ_KnownLive(Constify(arg0)), arg1, arg2, arg3, arg4); |
13750 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13751 | 0 | args.rval().setUndefined(); |
13752 | 0 | return true; |
13753 | 0 | } |
13754 | | |
13755 | | static const JSJitInfo uniform4i_methodinfo = { |
13756 | | { (JSJitGetterOp)uniform4i }, |
13757 | | { prototypes::id::WebGL2RenderingContext }, |
13758 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13759 | | JSJitInfo::Method, |
13760 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13761 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13762 | | false, /* isInfallible. False in setters. */ |
13763 | | false, /* isMovable. Not relevant for setters. */ |
13764 | | false, /* isEliminatable. Not relevant for setters. */ |
13765 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13766 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13767 | | false, /* isTypedMethod. Only relevant for methods. */ |
13768 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13769 | | }; |
13770 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13771 | | static_assert(0 < 1, "There is no slot for us"); |
13772 | | |
13773 | | MOZ_CAN_RUN_SCRIPT static bool |
13774 | | useProgram(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13775 | 0 | { |
13776 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.useProgram", DOM, cx); |
13777 | 0 |
|
13778 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
13779 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.useProgram"); |
13780 | 0 | } |
13781 | 0 | mozilla::WebGLProgram* arg0; |
13782 | 0 | if (args[0].isObject()) { |
13783 | 0 | { |
13784 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
13785 | 0 | if (NS_FAILED(rv)) { |
13786 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.useProgram", "WebGLProgram"); |
13787 | 0 | return false; |
13788 | 0 | } |
13789 | 0 | } |
13790 | 0 | } else if (args[0].isNullOrUndefined()) { |
13791 | 0 | arg0 = nullptr; |
13792 | 0 | } else { |
13793 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.useProgram"); |
13794 | 0 | return false; |
13795 | 0 | } |
13796 | 0 | self->UseProgram(MOZ_KnownLive(Constify(arg0))); |
13797 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13798 | 0 | args.rval().setUndefined(); |
13799 | 0 | return true; |
13800 | 0 | } |
13801 | | |
13802 | | static const JSJitInfo useProgram_methodinfo = { |
13803 | | { (JSJitGetterOp)useProgram }, |
13804 | | { prototypes::id::WebGL2RenderingContext }, |
13805 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13806 | | JSJitInfo::Method, |
13807 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13808 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13809 | | false, /* isInfallible. False in setters. */ |
13810 | | false, /* isMovable. Not relevant for setters. */ |
13811 | | false, /* isEliminatable. Not relevant for setters. */ |
13812 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13813 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13814 | | false, /* isTypedMethod. Only relevant for methods. */ |
13815 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13816 | | }; |
13817 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13818 | | static_assert(0 < 1, "There is no slot for us"); |
13819 | | |
13820 | | MOZ_CAN_RUN_SCRIPT static bool |
13821 | | validateProgram(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13822 | 0 | { |
13823 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.validateProgram", DOM, cx); |
13824 | 0 |
|
13825 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
13826 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.validateProgram"); |
13827 | 0 | } |
13828 | 0 | NonNull<mozilla::WebGLProgram> arg0; |
13829 | 0 | if (args[0].isObject()) { |
13830 | 0 | { |
13831 | 0 | nsresult rv = UnwrapObject<prototypes::id::WebGLProgram, mozilla::WebGLProgram>(args[0], arg0); |
13832 | 0 | if (NS_FAILED(rv)) { |
13833 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of WebGL2RenderingContext.validateProgram", "WebGLProgram"); |
13834 | 0 | return false; |
13835 | 0 | } |
13836 | 0 | } |
13837 | 0 | } else { |
13838 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of WebGL2RenderingContext.validateProgram"); |
13839 | 0 | return false; |
13840 | 0 | } |
13841 | 0 | self->ValidateProgram(MOZ_KnownLive(NonNullHelper(arg0))); |
13842 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13843 | 0 | args.rval().setUndefined(); |
13844 | 0 | return true; |
13845 | 0 | } |
13846 | | |
13847 | | static const JSJitInfo validateProgram_methodinfo = { |
13848 | | { (JSJitGetterOp)validateProgram }, |
13849 | | { prototypes::id::WebGL2RenderingContext }, |
13850 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13851 | | JSJitInfo::Method, |
13852 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13853 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13854 | | false, /* isInfallible. False in setters. */ |
13855 | | false, /* isMovable. Not relevant for setters. */ |
13856 | | false, /* isEliminatable. Not relevant for setters. */ |
13857 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13858 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13859 | | false, /* isTypedMethod. Only relevant for methods. */ |
13860 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13861 | | }; |
13862 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13863 | | static_assert(0 < 1, "There is no slot for us"); |
13864 | | |
13865 | | MOZ_CAN_RUN_SCRIPT static bool |
13866 | | vertexAttrib1f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13867 | 0 | { |
13868 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib1f", DOM, cx); |
13869 | 0 |
|
13870 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
13871 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib1f"); |
13872 | 0 | } |
13873 | 0 | uint32_t arg0; |
13874 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13875 | 0 | return false; |
13876 | 0 | } |
13877 | 0 | float arg1; |
13878 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
13879 | 0 | return false; |
13880 | 0 | } |
13881 | 0 | self->VertexAttrib1f(arg0, arg1); |
13882 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13883 | 0 | args.rval().setUndefined(); |
13884 | 0 | return true; |
13885 | 0 | } |
13886 | | |
13887 | | static const JSJitInfo vertexAttrib1f_methodinfo = { |
13888 | | { (JSJitGetterOp)vertexAttrib1f }, |
13889 | | { prototypes::id::WebGL2RenderingContext }, |
13890 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13891 | | JSJitInfo::Method, |
13892 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13893 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13894 | | false, /* isInfallible. False in setters. */ |
13895 | | false, /* isMovable. Not relevant for setters. */ |
13896 | | false, /* isEliminatable. Not relevant for setters. */ |
13897 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13898 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13899 | | false, /* isTypedMethod. Only relevant for methods. */ |
13900 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13901 | | }; |
13902 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13903 | | static_assert(0 < 1, "There is no slot for us"); |
13904 | | |
13905 | | MOZ_CAN_RUN_SCRIPT static bool |
13906 | | vertexAttrib1fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13907 | 0 | { |
13908 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib1fv", DOM, cx); |
13909 | 0 |
|
13910 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
13911 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib1fv"); |
13912 | 0 | } |
13913 | 0 | uint32_t arg0; |
13914 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13915 | 0 | return false; |
13916 | 0 | } |
13917 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
13918 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
13919 | 0 | { |
13920 | 0 | bool done = false, failed = false, tryNext; |
13921 | 0 | if (args[1].isObject()) { |
13922 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
13923 | 0 |
|
13924 | 0 | if (!done) { |
13925 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
13926 | 0 | } |
13927 | 0 | } |
13928 | 0 | if (failed) { |
13929 | 0 | return false; |
13930 | 0 | } |
13931 | 0 | if (!done) { |
13932 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.vertexAttrib1fv", "Float32Array, UnrestrictedFloatSequence"); |
13933 | 0 | return false; |
13934 | 0 | } |
13935 | 0 | } |
13936 | 0 | self->VertexAttrib1fv(arg0, Constify(arg1)); |
13937 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13938 | 0 | args.rval().setUndefined(); |
13939 | 0 | return true; |
13940 | 0 | } |
13941 | | |
13942 | | static const JSJitInfo vertexAttrib1fv_methodinfo = { |
13943 | | { (JSJitGetterOp)vertexAttrib1fv }, |
13944 | | { prototypes::id::WebGL2RenderingContext }, |
13945 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13946 | | JSJitInfo::Method, |
13947 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13948 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13949 | | false, /* isInfallible. False in setters. */ |
13950 | | false, /* isMovable. Not relevant for setters. */ |
13951 | | false, /* isEliminatable. Not relevant for setters. */ |
13952 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13953 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13954 | | false, /* isTypedMethod. Only relevant for methods. */ |
13955 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
13956 | | }; |
13957 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
13958 | | static_assert(0 < 1, "There is no slot for us"); |
13959 | | |
13960 | | MOZ_CAN_RUN_SCRIPT static bool |
13961 | | vertexAttrib2f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
13962 | 0 | { |
13963 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib2f", DOM, cx); |
13964 | 0 |
|
13965 | 0 | if (MOZ_UNLIKELY(args.length() < 3)) { |
13966 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib2f"); |
13967 | 0 | } |
13968 | 0 | uint32_t arg0; |
13969 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
13970 | 0 | return false; |
13971 | 0 | } |
13972 | 0 | float arg1; |
13973 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
13974 | 0 | return false; |
13975 | 0 | } |
13976 | 0 | float arg2; |
13977 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
13978 | 0 | return false; |
13979 | 0 | } |
13980 | 0 | self->VertexAttrib2f(arg0, arg1, arg2); |
13981 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
13982 | 0 | args.rval().setUndefined(); |
13983 | 0 | return true; |
13984 | 0 | } |
13985 | | |
13986 | | static const JSJitInfo vertexAttrib2f_methodinfo = { |
13987 | | { (JSJitGetterOp)vertexAttrib2f }, |
13988 | | { prototypes::id::WebGL2RenderingContext }, |
13989 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
13990 | | JSJitInfo::Method, |
13991 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
13992 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
13993 | | false, /* isInfallible. False in setters. */ |
13994 | | false, /* isMovable. Not relevant for setters. */ |
13995 | | false, /* isEliminatable. Not relevant for setters. */ |
13996 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
13997 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
13998 | | false, /* isTypedMethod. Only relevant for methods. */ |
13999 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14000 | | }; |
14001 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14002 | | static_assert(0 < 1, "There is no slot for us"); |
14003 | | |
14004 | | MOZ_CAN_RUN_SCRIPT static bool |
14005 | | vertexAttrib2fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
14006 | 0 | { |
14007 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib2fv", DOM, cx); |
14008 | 0 |
|
14009 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
14010 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib2fv"); |
14011 | 0 | } |
14012 | 0 | uint32_t arg0; |
14013 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
14014 | 0 | return false; |
14015 | 0 | } |
14016 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
14017 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
14018 | 0 | { |
14019 | 0 | bool done = false, failed = false, tryNext; |
14020 | 0 | if (args[1].isObject()) { |
14021 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
14022 | 0 |
|
14023 | 0 | if (!done) { |
14024 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
14025 | 0 | } |
14026 | 0 | } |
14027 | 0 | if (failed) { |
14028 | 0 | return false; |
14029 | 0 | } |
14030 | 0 | if (!done) { |
14031 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.vertexAttrib2fv", "Float32Array, UnrestrictedFloatSequence"); |
14032 | 0 | return false; |
14033 | 0 | } |
14034 | 0 | } |
14035 | 0 | self->VertexAttrib2fv(arg0, Constify(arg1)); |
14036 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
14037 | 0 | args.rval().setUndefined(); |
14038 | 0 | return true; |
14039 | 0 | } |
14040 | | |
14041 | | static const JSJitInfo vertexAttrib2fv_methodinfo = { |
14042 | | { (JSJitGetterOp)vertexAttrib2fv }, |
14043 | | { prototypes::id::WebGL2RenderingContext }, |
14044 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
14045 | | JSJitInfo::Method, |
14046 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
14047 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
14048 | | false, /* isInfallible. False in setters. */ |
14049 | | false, /* isMovable. Not relevant for setters. */ |
14050 | | false, /* isEliminatable. Not relevant for setters. */ |
14051 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
14052 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
14053 | | false, /* isTypedMethod. Only relevant for methods. */ |
14054 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14055 | | }; |
14056 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14057 | | static_assert(0 < 1, "There is no slot for us"); |
14058 | | |
14059 | | MOZ_CAN_RUN_SCRIPT static bool |
14060 | | vertexAttrib3f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
14061 | 0 | { |
14062 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib3f", DOM, cx); |
14063 | 0 |
|
14064 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
14065 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib3f"); |
14066 | 0 | } |
14067 | 0 | uint32_t arg0; |
14068 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
14069 | 0 | return false; |
14070 | 0 | } |
14071 | 0 | float arg1; |
14072 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
14073 | 0 | return false; |
14074 | 0 | } |
14075 | 0 | float arg2; |
14076 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
14077 | 0 | return false; |
14078 | 0 | } |
14079 | 0 | float arg3; |
14080 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[3], &arg3)) { |
14081 | 0 | return false; |
14082 | 0 | } |
14083 | 0 | self->VertexAttrib3f(arg0, arg1, arg2, arg3); |
14084 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
14085 | 0 | args.rval().setUndefined(); |
14086 | 0 | return true; |
14087 | 0 | } |
14088 | | |
14089 | | static const JSJitInfo vertexAttrib3f_methodinfo = { |
14090 | | { (JSJitGetterOp)vertexAttrib3f }, |
14091 | | { prototypes::id::WebGL2RenderingContext }, |
14092 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
14093 | | JSJitInfo::Method, |
14094 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
14095 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
14096 | | false, /* isInfallible. False in setters. */ |
14097 | | false, /* isMovable. Not relevant for setters. */ |
14098 | | false, /* isEliminatable. Not relevant for setters. */ |
14099 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
14100 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
14101 | | false, /* isTypedMethod. Only relevant for methods. */ |
14102 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14103 | | }; |
14104 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14105 | | static_assert(0 < 1, "There is no slot for us"); |
14106 | | |
14107 | | MOZ_CAN_RUN_SCRIPT static bool |
14108 | | vertexAttrib3fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
14109 | 0 | { |
14110 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib3fv", DOM, cx); |
14111 | 0 |
|
14112 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
14113 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib3fv"); |
14114 | 0 | } |
14115 | 0 | uint32_t arg0; |
14116 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
14117 | 0 | return false; |
14118 | 0 | } |
14119 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
14120 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
14121 | 0 | { |
14122 | 0 | bool done = false, failed = false, tryNext; |
14123 | 0 | if (args[1].isObject()) { |
14124 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
14125 | 0 |
|
14126 | 0 | if (!done) { |
14127 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
14128 | 0 | } |
14129 | 0 | } |
14130 | 0 | if (failed) { |
14131 | 0 | return false; |
14132 | 0 | } |
14133 | 0 | if (!done) { |
14134 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.vertexAttrib3fv", "Float32Array, UnrestrictedFloatSequence"); |
14135 | 0 | return false; |
14136 | 0 | } |
14137 | 0 | } |
14138 | 0 | self->VertexAttrib3fv(arg0, Constify(arg1)); |
14139 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
14140 | 0 | args.rval().setUndefined(); |
14141 | 0 | return true; |
14142 | 0 | } |
14143 | | |
14144 | | static const JSJitInfo vertexAttrib3fv_methodinfo = { |
14145 | | { (JSJitGetterOp)vertexAttrib3fv }, |
14146 | | { prototypes::id::WebGL2RenderingContext }, |
14147 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
14148 | | JSJitInfo::Method, |
14149 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
14150 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
14151 | | false, /* isInfallible. False in setters. */ |
14152 | | false, /* isMovable. Not relevant for setters. */ |
14153 | | false, /* isEliminatable. Not relevant for setters. */ |
14154 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
14155 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
14156 | | false, /* isTypedMethod. Only relevant for methods. */ |
14157 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14158 | | }; |
14159 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14160 | | static_assert(0 < 1, "There is no slot for us"); |
14161 | | |
14162 | | MOZ_CAN_RUN_SCRIPT static bool |
14163 | | vertexAttrib4f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
14164 | 0 | { |
14165 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib4f", DOM, cx); |
14166 | 0 |
|
14167 | 0 | if (MOZ_UNLIKELY(args.length() < 5)) { |
14168 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib4f"); |
14169 | 0 | } |
14170 | 0 | uint32_t arg0; |
14171 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
14172 | 0 | return false; |
14173 | 0 | } |
14174 | 0 | float arg1; |
14175 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) { |
14176 | 0 | return false; |
14177 | 0 | } |
14178 | 0 | float arg2; |
14179 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[2], &arg2)) { |
14180 | 0 | return false; |
14181 | 0 | } |
14182 | 0 | float arg3; |
14183 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[3], &arg3)) { |
14184 | 0 | return false; |
14185 | 0 | } |
14186 | 0 | float arg4; |
14187 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[4], &arg4)) { |
14188 | 0 | return false; |
14189 | 0 | } |
14190 | 0 | self->VertexAttrib4f(arg0, arg1, arg2, arg3, arg4); |
14191 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
14192 | 0 | args.rval().setUndefined(); |
14193 | 0 | return true; |
14194 | 0 | } |
14195 | | |
14196 | | static const JSJitInfo vertexAttrib4f_methodinfo = { |
14197 | | { (JSJitGetterOp)vertexAttrib4f }, |
14198 | | { prototypes::id::WebGL2RenderingContext }, |
14199 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
14200 | | JSJitInfo::Method, |
14201 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
14202 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
14203 | | false, /* isInfallible. False in setters. */ |
14204 | | false, /* isMovable. Not relevant for setters. */ |
14205 | | false, /* isEliminatable. Not relevant for setters. */ |
14206 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
14207 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
14208 | | false, /* isTypedMethod. Only relevant for methods. */ |
14209 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14210 | | }; |
14211 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14212 | | static_assert(0 < 1, "There is no slot for us"); |
14213 | | |
14214 | | MOZ_CAN_RUN_SCRIPT static bool |
14215 | | vertexAttrib4fv(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
14216 | 0 | { |
14217 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttrib4fv", DOM, cx); |
14218 | 0 |
|
14219 | 0 | if (MOZ_UNLIKELY(args.length() < 2)) { |
14220 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttrib4fv"); |
14221 | 0 | } |
14222 | 0 | uint32_t arg0; |
14223 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
14224 | 0 | return false; |
14225 | 0 | } |
14226 | 0 | Float32ArrayOrUnrestrictedFloatSequence arg1; |
14227 | 0 | Float32ArrayOrUnrestrictedFloatSequenceArgument arg1_holder(arg1); |
14228 | 0 | { |
14229 | 0 | bool done = false, failed = false, tryNext; |
14230 | 0 | if (args[1].isObject()) { |
14231 | 0 | done = (failed = !arg1_holder.TrySetToFloat32Array(cx, args[1], tryNext, false)) || !tryNext; |
14232 | 0 |
|
14233 | 0 | if (!done) { |
14234 | 0 | done = (failed = !arg1_holder.TrySetToUnrestrictedFloatSequence(cx, args[1], tryNext, false)) || !tryNext; |
14235 | 0 | } |
14236 | 0 | } |
14237 | 0 | if (failed) { |
14238 | 0 | return false; |
14239 | 0 | } |
14240 | 0 | if (!done) { |
14241 | 0 | ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of WebGL2RenderingContext.vertexAttrib4fv", "Float32Array, UnrestrictedFloatSequence"); |
14242 | 0 | return false; |
14243 | 0 | } |
14244 | 0 | } |
14245 | 0 | self->VertexAttrib4fv(arg0, Constify(arg1)); |
14246 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
14247 | 0 | args.rval().setUndefined(); |
14248 | 0 | return true; |
14249 | 0 | } |
14250 | | |
14251 | | static const JSJitInfo vertexAttrib4fv_methodinfo = { |
14252 | | { (JSJitGetterOp)vertexAttrib4fv }, |
14253 | | { prototypes::id::WebGL2RenderingContext }, |
14254 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
14255 | | JSJitInfo::Method, |
14256 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
14257 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
14258 | | false, /* isInfallible. False in setters. */ |
14259 | | false, /* isMovable. Not relevant for setters. */ |
14260 | | false, /* isEliminatable. Not relevant for setters. */ |
14261 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
14262 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
14263 | | false, /* isTypedMethod. Only relevant for methods. */ |
14264 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14265 | | }; |
14266 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14267 | | static_assert(0 < 1, "There is no slot for us"); |
14268 | | |
14269 | | MOZ_CAN_RUN_SCRIPT static bool |
14270 | | vertexAttribPointer(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
14271 | 0 | { |
14272 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.vertexAttribPointer", DOM, cx); |
14273 | 0 |
|
14274 | 0 | if (MOZ_UNLIKELY(args.length() < 6)) { |
14275 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.vertexAttribPointer"); |
14276 | 0 | } |
14277 | 0 | uint32_t arg0; |
14278 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
14279 | 0 | return false; |
14280 | 0 | } |
14281 | 0 | int32_t arg1; |
14282 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
14283 | 0 | return false; |
14284 | 0 | } |
14285 | 0 | uint32_t arg2; |
14286 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) { |
14287 | 0 | return false; |
14288 | 0 | } |
14289 | 0 | bool arg3; |
14290 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[3], &arg3)) { |
14291 | 0 | return false; |
14292 | 0 | } |
14293 | 0 | int32_t arg4; |
14294 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) { |
14295 | 0 | return false; |
14296 | 0 | } |
14297 | 0 | int64_t arg5; |
14298 | 0 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[5], &arg5)) { |
14299 | 0 | return false; |
14300 | 0 | } |
14301 | 0 | self->VertexAttribPointer(arg0, arg1, arg2, arg3, arg4, arg5); |
14302 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
14303 | 0 | args.rval().setUndefined(); |
14304 | 0 | return true; |
14305 | 0 | } |
14306 | | |
14307 | | static const JSJitInfo vertexAttribPointer_methodinfo = { |
14308 | | { (JSJitGetterOp)vertexAttribPointer }, |
14309 | | { prototypes::id::WebGL2RenderingContext }, |
14310 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
14311 | | JSJitInfo::Method, |
14312 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
14313 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
14314 | | false, /* isInfallible. False in setters. */ |
14315 | | false, /* isMovable. Not relevant for setters. */ |
14316 | | false, /* isEliminatable. Not relevant for setters. */ |
14317 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
14318 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
14319 | | false, /* isTypedMethod. Only relevant for methods. */ |
14320 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14321 | | }; |
14322 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14323 | | static_assert(0 < 1, "There is no slot for us"); |
14324 | | |
14325 | | MOZ_CAN_RUN_SCRIPT static bool |
14326 | | viewport(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::WebGL2Context* self, const JSJitMethodCallArgs& args) |
14327 | 0 | { |
14328 | 0 | AUTO_PROFILER_LABEL_FAST("WebGL2RenderingContext.viewport", DOM, cx); |
14329 | 0 |
|
14330 | 0 | if (MOZ_UNLIKELY(args.length() < 4)) { |
14331 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "WebGL2RenderingContext.viewport"); |
14332 | 0 | } |
14333 | 0 | int32_t arg0; |
14334 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) { |
14335 | 0 | return false; |
14336 | 0 | } |
14337 | 0 | int32_t arg1; |
14338 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], &arg1)) { |
14339 | 0 | return false; |
14340 | 0 | } |
14341 | 0 | int32_t arg2; |
14342 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) { |
14343 | 0 | return false; |
14344 | 0 | } |
14345 | 0 | int32_t arg3; |
14346 | 0 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) { |
14347 | 0 | return false; |
14348 | 0 | } |
14349 | 0 | self->Viewport(arg0, arg1, arg2, arg3); |
14350 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
14351 | 0 | args.rval().setUndefined(); |
14352 | 0 | return true; |
14353 | 0 | } |
14354 | | |
14355 | | static const JSJitInfo viewport_methodinfo = { |
14356 | | { (JSJitGetterOp)viewport }, |
14357 | | { prototypes::id::WebGL2RenderingContext }, |
14358 | | { PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth }, |
14359 | | JSJitInfo::Method, |
14360 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
14361 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
14362 | | false, /* isInfallible. False in setters. */ |
14363 | | false, /* isMovable. Not relevant for setters. */ |
14364 | | false, /* isEliminatable. Not relevant for setters. */ |
14365 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
14366 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
14367 | | false, /* isTypedMethod. Only relevant for methods. */ |
14368 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
14369 | | }; |
14370 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
14371 | | static_assert(0 < 1, "There is no slot for us"); |
14372 | | |
14373 | | static bool |
14374 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
14375 | 0 | { |
14376 | 0 | mozilla::WebGL2Context* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGL2Context>(obj); |
14377 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
14378 | 0 | // obviously can't preserve if we're not initialized. |
14379 | 0 | if (self && self->GetWrapperPreserveColor()) { |
14380 | 0 | PreserveWrapper(self); |
14381 | 0 | } |
14382 | 0 | return true; |
14383 | 0 | } |
14384 | | |
14385 | | static void |
14386 | | _finalize(js::FreeOp* fop, JSObject* obj) |
14387 | 0 | { |
14388 | 0 | mozilla::WebGL2Context* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGL2Context>(obj); |
14389 | 0 | if (self) { |
14390 | 0 | ClearWrapper(self, self, obj); |
14391 | 0 | AddForDeferredFinalization<mozilla::WebGL2Context>(self); |
14392 | 0 | } |
14393 | 0 | } |
14394 | | |
14395 | | static size_t |
14396 | | _objectMoved(JSObject* obj, JSObject* old) |
14397 | 0 | { |
14398 | 0 | mozilla::WebGL2Context* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGL2Context>(obj); |
14399 | 0 | if (self) { |
14400 | 0 | UpdateWrapper(self, self, obj, old); |
14401 | 0 | } |
14402 | 0 |
|
14403 | 0 | return 0; |
14404 | 0 | } |
14405 | | |
14406 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
14407 | | #if defined(__clang__) |
14408 | | #pragma clang diagnostic push |
14409 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
14410 | | #endif |
14411 | | static const JSFunctionSpec sMethods_specs[] = { |
14412 | | JS_FNSPEC("bufferData", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bufferData_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14413 | | JS_FNSPEC("bufferSubData", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bufferSubData_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14414 | | JS_FNSPEC("copyBufferSubData", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(©BufferSubData_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14415 | | JS_FNSPEC("getBufferSubData", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getBufferSubData_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14416 | | JS_FNSPEC("blitFramebuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&blitFramebuffer_methodinfo), 10, JSPROP_ENUMERATE, nullptr), |
14417 | | JS_FNSPEC("framebufferTextureLayer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&framebufferTextureLayer_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14418 | | JS_FNSPEC("invalidateFramebuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&invalidateFramebuffer_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14419 | | JS_FNSPEC("invalidateSubFramebuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&invalidateSubFramebuffer_methodinfo), 6, JSPROP_ENUMERATE, nullptr), |
14420 | | JS_FNSPEC("readBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&readBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14421 | | JS_FNSPEC("getInternalformatParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getInternalformatParameter_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14422 | | JS_FNSPEC("renderbufferStorageMultisample", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&renderbufferStorageMultisample_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14423 | | JS_FNSPEC("texStorage2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texStorage2D_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14424 | | JS_FNSPEC("texStorage3D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texStorage3D_methodinfo), 6, JSPROP_ENUMERATE, nullptr), |
14425 | | JS_FNSPEC("texImage2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texImage2D_methodinfo), 6, JSPROP_ENUMERATE, nullptr), |
14426 | | JS_FNSPEC("texSubImage2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texSubImage2D_methodinfo), 7, JSPROP_ENUMERATE, nullptr), |
14427 | | JS_FNSPEC("texImage3D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texImage3D_methodinfo), 10, JSPROP_ENUMERATE, nullptr), |
14428 | | JS_FNSPEC("texSubImage3D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texSubImage3D_methodinfo), 11, JSPROP_ENUMERATE, nullptr), |
14429 | | JS_FNSPEC("copyTexSubImage3D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(©TexSubImage3D_methodinfo), 9, JSPROP_ENUMERATE, nullptr), |
14430 | | JS_FNSPEC("compressedTexImage2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&compressedTexImage2D_methodinfo), 7, JSPROP_ENUMERATE, nullptr), |
14431 | | JS_FNSPEC("compressedTexImage3D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&compressedTexImage3D_methodinfo), 8, JSPROP_ENUMERATE, nullptr), |
14432 | | JS_FNSPEC("compressedTexSubImage2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&compressedTexSubImage2D_methodinfo), 8, JSPROP_ENUMERATE, nullptr), |
14433 | | JS_FNSPEC("compressedTexSubImage3D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&compressedTexSubImage3D_methodinfo), 10, JSPROP_ENUMERATE, nullptr), |
14434 | | JS_FNSPEC("getFragDataLocation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getFragDataLocation_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14435 | | JS_FNSPEC("uniform1ui", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform1ui_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14436 | | JS_FNSPEC("uniform2ui", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform2ui_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14437 | | JS_FNSPEC("uniform3ui", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform3ui_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14438 | | JS_FNSPEC("uniform4ui", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform4ui_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14439 | | JS_FNSPEC("uniform1fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform1fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14440 | | JS_FNSPEC("uniform2fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform2fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14441 | | JS_FNSPEC("uniform3fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform3fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14442 | | JS_FNSPEC("uniform4fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform4fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14443 | | JS_FNSPEC("uniform1iv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform1iv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14444 | | JS_FNSPEC("uniform2iv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform2iv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14445 | | JS_FNSPEC("uniform3iv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform3iv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14446 | | JS_FNSPEC("uniform4iv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform4iv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14447 | | JS_FNSPEC("uniform1uiv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform1uiv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14448 | | JS_FNSPEC("uniform2uiv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform2uiv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14449 | | JS_FNSPEC("uniform3uiv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform3uiv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14450 | | JS_FNSPEC("uniform4uiv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform4uiv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14451 | | JS_FNSPEC("uniformMatrix2fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix2fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14452 | | JS_FNSPEC("uniformMatrix3x2fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix3x2fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14453 | | JS_FNSPEC("uniformMatrix4x2fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix4x2fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14454 | | JS_FNSPEC("uniformMatrix2x3fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix2x3fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14455 | | JS_FNSPEC("uniformMatrix3fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix3fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14456 | | JS_FNSPEC("uniformMatrix4x3fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix4x3fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14457 | | JS_FNSPEC("uniformMatrix2x4fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix2x4fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14458 | | JS_FNSPEC("uniformMatrix3x4fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix3x4fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14459 | | JS_FNSPEC("uniformMatrix4fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformMatrix4fv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14460 | | JS_FNSPEC("vertexAttribI4i", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttribI4i_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14461 | | JS_FNSPEC("vertexAttribI4iv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttribI4iv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14462 | | JS_FNSPEC("vertexAttribI4ui", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttribI4ui_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14463 | | JS_FNSPEC("vertexAttribI4uiv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttribI4uiv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14464 | | JS_FNSPEC("vertexAttribIPointer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttribIPointer_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14465 | | JS_FNSPEC("vertexAttribDivisor", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttribDivisor_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14466 | | JS_FNSPEC("drawArraysInstanced", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&drawArraysInstanced_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14467 | | JS_FNSPEC("drawElementsInstanced", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&drawElementsInstanced_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14468 | | JS_FNSPEC("drawRangeElements", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&drawRangeElements_methodinfo), 6, JSPROP_ENUMERATE, nullptr), |
14469 | | JS_FNSPEC("readPixels", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&readPixels_methodinfo), 7, JSPROP_ENUMERATE, nullptr), |
14470 | | JS_FNSPEC("drawBuffers", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&drawBuffers_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14471 | | JS_FNSPEC("clearBufferfv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearBufferfv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14472 | | JS_FNSPEC("clearBufferiv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearBufferiv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14473 | | JS_FNSPEC("clearBufferuiv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearBufferuiv_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14474 | | JS_FNSPEC("clearBufferfi", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearBufferfi_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14475 | | JS_FNSPEC("createQuery", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createQuery_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14476 | | JS_FNSPEC("deleteQuery", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteQuery_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14477 | | JS_FNSPEC("isQuery", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isQuery_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14478 | | JS_FNSPEC("beginQuery", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&beginQuery_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14479 | | JS_FNSPEC("endQuery", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&endQuery_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14480 | | JS_FNSPEC("getQuery", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getQuery_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14481 | | JS_FNSPEC("getQueryParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getQueryParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14482 | | JS_FNSPEC("createSampler", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSampler_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14483 | | JS_FNSPEC("deleteSampler", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteSampler_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14484 | | JS_FNSPEC("isSampler", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isSampler_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14485 | | JS_FNSPEC("bindSampler", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindSampler_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14486 | | JS_FNSPEC("samplerParameteri", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&samplerParameteri_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14487 | | JS_FNSPEC("samplerParameterf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&samplerParameterf_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14488 | | JS_FNSPEC("getSamplerParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getSamplerParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14489 | | JS_FNSPEC("fenceSync", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&fenceSync_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14490 | | JS_FNSPEC("isSync", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isSync_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14491 | | JS_FNSPEC("deleteSync", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteSync_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14492 | | JS_FNSPEC("clientWaitSync", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clientWaitSync_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14493 | | JS_FNSPEC("waitSync", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&waitSync_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14494 | | JS_FNSPEC("getSyncParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getSyncParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14495 | | JS_FNSPEC("createTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTransformFeedback_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14496 | | JS_FNSPEC("deleteTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteTransformFeedback_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14497 | | JS_FNSPEC("isTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isTransformFeedback_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14498 | | JS_FNSPEC("bindTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindTransformFeedback_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14499 | | JS_FNSPEC("beginTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&beginTransformFeedback_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14500 | | JS_FNSPEC("endTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&endTransformFeedback_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14501 | | JS_FNSPEC("transformFeedbackVaryings", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&transformFeedbackVaryings_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14502 | | JS_FNSPEC("getTransformFeedbackVarying", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getTransformFeedbackVarying_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14503 | | JS_FNSPEC("pauseTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&pauseTransformFeedback_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14504 | | JS_FNSPEC("resumeTransformFeedback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&resumeTransformFeedback_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14505 | | JS_FNSPEC("bindBufferBase", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindBufferBase_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14506 | | JS_FNSPEC("bindBufferRange", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindBufferRange_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14507 | | JS_FNSPEC("getIndexedParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getIndexedParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14508 | | JS_FNSPEC("getUniformIndices", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getUniformIndices_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14509 | | JS_FNSPEC("getActiveUniforms", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getActiveUniforms_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14510 | | JS_FNSPEC("getUniformBlockIndex", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getUniformBlockIndex_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14511 | | JS_FNSPEC("getActiveUniformBlockParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getActiveUniformBlockParameter_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14512 | | JS_FNSPEC("getActiveUniformBlockName", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getActiveUniformBlockName_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14513 | | JS_FNSPEC("uniformBlockBinding", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniformBlockBinding_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14514 | | JS_FNSPEC("createVertexArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createVertexArray_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14515 | | JS_FNSPEC("deleteVertexArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteVertexArray_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14516 | | JS_FNSPEC("isVertexArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isVertexArray_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14517 | | JS_FNSPEC("bindVertexArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindVertexArray_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14518 | | JS_FNSPEC("getContextAttributes", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getContextAttributes_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14519 | | JS_FNSPEC("isContextLost", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isContextLost_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14520 | | JS_FNSPEC("getSupportedExtensions", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getSupportedExtensions_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14521 | | JS_FNSPEC("getExtension", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getExtension_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14522 | | JS_FNSPEC("activeTexture", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&activeTexture_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14523 | | JS_FNSPEC("attachShader", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&attachShader_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14524 | | JS_FNSPEC("bindAttribLocation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindAttribLocation_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14525 | | JS_FNSPEC("bindBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindBuffer_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14526 | | JS_FNSPEC("bindFramebuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindFramebuffer_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14527 | | JS_FNSPEC("bindRenderbuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindRenderbuffer_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14528 | | JS_FNSPEC("bindTexture", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&bindTexture_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14529 | | JS_FNSPEC("blendColor", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&blendColor_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14530 | | JS_FNSPEC("blendEquation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&blendEquation_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14531 | | JS_FNSPEC("blendEquationSeparate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&blendEquationSeparate_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14532 | | JS_FNSPEC("blendFunc", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&blendFunc_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14533 | | JS_FNSPEC("blendFuncSeparate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&blendFuncSeparate_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14534 | | JS_FNSPEC("checkFramebufferStatus", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&checkFramebufferStatus_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14535 | | JS_FNSPEC("clear", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clear_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14536 | | JS_FNSPEC("clearColor", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearColor_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14537 | | JS_FNSPEC("clearDepth", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearDepth_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14538 | | JS_FNSPEC("clearStencil", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearStencil_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14539 | | JS_FNSPEC("colorMask", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&colorMask_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14540 | | JS_FNSPEC("compileShader", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&compileShader_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14541 | | JS_FNSPEC("copyTexImage2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(©TexImage2D_methodinfo), 8, JSPROP_ENUMERATE, nullptr), |
14542 | | JS_FNSPEC("copyTexSubImage2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(©TexSubImage2D_methodinfo), 8, JSPROP_ENUMERATE, nullptr), |
14543 | | JS_FNSPEC("createBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createBuffer_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14544 | | JS_FNSPEC("createFramebuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createFramebuffer_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14545 | | JS_FNSPEC("createProgram", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createProgram_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14546 | | JS_FNSPEC("createRenderbuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createRenderbuffer_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14547 | | JS_FNSPEC("createShader", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createShader_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14548 | | JS_FNSPEC("createTexture", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTexture_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14549 | | JS_FNSPEC("cullFace", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&cullFace_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14550 | | JS_FNSPEC("deleteBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14551 | | JS_FNSPEC("deleteFramebuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteFramebuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14552 | | JS_FNSPEC("deleteProgram", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteProgram_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14553 | | JS_FNSPEC("deleteRenderbuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteRenderbuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14554 | | JS_FNSPEC("deleteShader", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteShader_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14555 | | JS_FNSPEC("deleteTexture", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteTexture_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14556 | | JS_FNSPEC("depthFunc", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&depthFunc_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14557 | | JS_FNSPEC("depthMask", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&depthMask_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14558 | | JS_FNSPEC("depthRange", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&depthRange_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14559 | | JS_FNSPEC("detachShader", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&detachShader_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14560 | | JS_FNSPEC("disable", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&disable_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14561 | | JS_FNSPEC("disableVertexAttribArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&disableVertexAttribArray_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14562 | | JS_FNSPEC("drawArrays", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&drawArrays_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14563 | | JS_FNSPEC("drawElements", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&drawElements_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14564 | | JS_FNSPEC("enable", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&enable_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14565 | | JS_FNSPEC("enableVertexAttribArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&enableVertexAttribArray_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14566 | | JS_FNSPEC("finish", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&finish_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14567 | | JS_FNSPEC("flush", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&flush_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14568 | | JS_FNSPEC("framebufferRenderbuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&framebufferRenderbuffer_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14569 | | JS_FNSPEC("framebufferTexture2D", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&framebufferTexture2D_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14570 | | JS_FNSPEC("frontFace", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&frontFace_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14571 | | JS_FNSPEC("generateMipmap", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&generateMipmap_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14572 | | JS_FNSPEC("getActiveAttrib", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getActiveAttrib_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14573 | | JS_FNSPEC("getActiveUniform", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getActiveUniform_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14574 | | JS_FNSPEC("getAttachedShaders", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getAttachedShaders_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14575 | | JS_FNSPEC("getAttribLocation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getAttribLocation_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14576 | | JS_FNSPEC("getBufferParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getBufferParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14577 | | JS_FNSPEC("getParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getParameter_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14578 | | JS_FNSPEC("getError", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getError_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
14579 | | JS_FNSPEC("getFramebufferAttachmentParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getFramebufferAttachmentParameter_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14580 | | JS_FNSPEC("getProgramParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getProgramParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14581 | | JS_FNSPEC("getProgramInfoLog", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getProgramInfoLog_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14582 | | JS_FNSPEC("getRenderbufferParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getRenderbufferParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14583 | | JS_FNSPEC("getShaderParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getShaderParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14584 | | JS_FNSPEC("getShaderPrecisionFormat", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getShaderPrecisionFormat_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14585 | | JS_FNSPEC("getShaderInfoLog", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getShaderInfoLog_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14586 | | JS_FNSPEC("getShaderSource", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getShaderSource_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14587 | | JS_FNSPEC("getTexParameter", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getTexParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14588 | | JS_FNSPEC("getUniform", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getUniform_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14589 | | JS_FNSPEC("getUniformLocation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getUniformLocation_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14590 | | JS_FNSPEC("getVertexAttrib", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getVertexAttrib_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14591 | | JS_FNSPEC("getVertexAttribOffset", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getVertexAttribOffset_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14592 | | JS_FNSPEC("hint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&hint_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14593 | | JS_FNSPEC("isBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14594 | | JS_FNSPEC("isEnabled", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isEnabled_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14595 | | JS_FNSPEC("isFramebuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isFramebuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14596 | | JS_FNSPEC("isProgram", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isProgram_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14597 | | JS_FNSPEC("isRenderbuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isRenderbuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14598 | | JS_FNSPEC("isShader", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isShader_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14599 | | JS_FNSPEC("isTexture", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&isTexture_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14600 | | JS_FNSPEC("lineWidth", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&lineWidth_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14601 | | JS_FNSPEC("linkProgram", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&linkProgram_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14602 | | JS_FNSPEC("pixelStorei", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&pixelStorei_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14603 | | JS_FNSPEC("polygonOffset", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&polygonOffset_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14604 | | JS_FNSPEC("renderbufferStorage", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&renderbufferStorage_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14605 | | JS_FNSPEC("sampleCoverage", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&sampleCoverage_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14606 | | JS_FNSPEC("scissor", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&scissor_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14607 | | JS_FNSPEC("shaderSource", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&shaderSource_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14608 | | JS_FNSPEC("stencilFunc", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&stencilFunc_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14609 | | JS_FNSPEC("stencilFuncSeparate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&stencilFuncSeparate_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14610 | | JS_FNSPEC("stencilMask", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&stencilMask_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14611 | | JS_FNSPEC("stencilMaskSeparate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&stencilMaskSeparate_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14612 | | JS_FNSPEC("stencilOp", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&stencilOp_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14613 | | JS_FNSPEC("stencilOpSeparate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&stencilOpSeparate_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14614 | | JS_FNSPEC("texParameterf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texParameterf_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14615 | | JS_FNSPEC("texParameteri", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&texParameteri_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14616 | | JS_FNSPEC("uniform1f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform1f_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14617 | | JS_FNSPEC("uniform2f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform2f_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14618 | | JS_FNSPEC("uniform3f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform3f_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14619 | | JS_FNSPEC("uniform4f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform4f_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14620 | | JS_FNSPEC("uniform1i", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform1i_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14621 | | JS_FNSPEC("uniform2i", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform2i_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14622 | | JS_FNSPEC("uniform3i", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform3i_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14623 | | JS_FNSPEC("uniform4i", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&uniform4i_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14624 | | JS_FNSPEC("useProgram", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&useProgram_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14625 | | JS_FNSPEC("validateProgram", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&validateProgram_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
14626 | | JS_FNSPEC("vertexAttrib1f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib1f_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14627 | | JS_FNSPEC("vertexAttrib1fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib1fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14628 | | JS_FNSPEC("vertexAttrib2f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib2f_methodinfo), 3, JSPROP_ENUMERATE, nullptr), |
14629 | | JS_FNSPEC("vertexAttrib2fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib2fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14630 | | JS_FNSPEC("vertexAttrib3f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib3f_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14631 | | JS_FNSPEC("vertexAttrib3fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib3fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14632 | | JS_FNSPEC("vertexAttrib4f", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib4f_methodinfo), 5, JSPROP_ENUMERATE, nullptr), |
14633 | | JS_FNSPEC("vertexAttrib4fv", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttrib4fv_methodinfo), 2, JSPROP_ENUMERATE, nullptr), |
14634 | | JS_FNSPEC("vertexAttribPointer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&vertexAttribPointer_methodinfo), 6, JSPROP_ENUMERATE, nullptr), |
14635 | | JS_FNSPEC("viewport", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&viewport_methodinfo), 4, JSPROP_ENUMERATE, nullptr), |
14636 | | JS_FS_END |
14637 | | }; |
14638 | | #if defined(__clang__) |
14639 | | #pragma clang diagnostic pop |
14640 | | #endif |
14641 | | |
14642 | | |
14643 | | static const Prefable<const JSFunctionSpec> sMethods[] = { |
14644 | | { nullptr, &sMethods_specs[0] }, |
14645 | | { nullptr, nullptr } |
14646 | | }; |
14647 | | |
14648 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
14649 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
14650 | | static_assert(224 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
14651 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
14652 | | |
14653 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
14654 | | #if defined(__clang__) |
14655 | | #pragma clang diagnostic push |
14656 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
14657 | | #endif |
14658 | | static const JSPropertySpec sAttributes_specs[] = { |
14659 | | { "canvas", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canvas_getterinfo, nullptr, nullptr }, |
14660 | | { "drawingBufferWidth", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &drawingBufferWidth_getterinfo, nullptr, nullptr }, |
14661 | | { "drawingBufferHeight", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &drawingBufferHeight_getterinfo, nullptr, nullptr }, |
14662 | | { nullptr, 0, nullptr, nullptr, nullptr, nullptr } |
14663 | | }; |
14664 | | #if defined(__clang__) |
14665 | | #pragma clang diagnostic pop |
14666 | | #endif |
14667 | | |
14668 | | |
14669 | | static const Prefable<const JSPropertySpec> sAttributes[] = { |
14670 | | { nullptr, &sAttributes_specs[0] }, |
14671 | | { nullptr, nullptr } |
14672 | | }; |
14673 | | |
14674 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
14675 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
14676 | | static_assert(3 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
14677 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
14678 | | |
14679 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
14680 | | #if defined(__clang__) |
14681 | | #pragma clang diagnostic push |
14682 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
14683 | | #endif |
14684 | | static const ConstantSpec sConstants_specs[] = { |
14685 | | { "READ_BUFFER", JS::NumberValue(3074U) }, |
14686 | | { "UNPACK_ROW_LENGTH", JS::NumberValue(3314U) }, |
14687 | | { "UNPACK_SKIP_ROWS", JS::NumberValue(3315U) }, |
14688 | | { "UNPACK_SKIP_PIXELS", JS::NumberValue(3316U) }, |
14689 | | { "PACK_ROW_LENGTH", JS::NumberValue(3330U) }, |
14690 | | { "PACK_SKIP_ROWS", JS::NumberValue(3331U) }, |
14691 | | { "PACK_SKIP_PIXELS", JS::NumberValue(3332U) }, |
14692 | | { "COLOR", JS::NumberValue(6144U) }, |
14693 | | { "DEPTH", JS::NumberValue(6145U) }, |
14694 | | { "STENCIL", JS::NumberValue(6146U) }, |
14695 | | { "RED", JS::NumberValue(6403U) }, |
14696 | | { "RGB8", JS::NumberValue(32849U) }, |
14697 | | { "RGBA8", JS::NumberValue(32856U) }, |
14698 | | { "RGB10_A2", JS::NumberValue(32857U) }, |
14699 | | { "TEXTURE_BINDING_3D", JS::NumberValue(32874U) }, |
14700 | | { "UNPACK_SKIP_IMAGES", JS::NumberValue(32877U) }, |
14701 | | { "UNPACK_IMAGE_HEIGHT", JS::NumberValue(32878U) }, |
14702 | | { "TEXTURE_3D", JS::NumberValue(32879U) }, |
14703 | | { "TEXTURE_WRAP_R", JS::NumberValue(32882U) }, |
14704 | | { "MAX_3D_TEXTURE_SIZE", JS::NumberValue(32883U) }, |
14705 | | { "UNSIGNED_INT_2_10_10_10_REV", JS::NumberValue(33640U) }, |
14706 | | { "MAX_ELEMENTS_VERTICES", JS::NumberValue(33000U) }, |
14707 | | { "MAX_ELEMENTS_INDICES", JS::NumberValue(33001U) }, |
14708 | | { "TEXTURE_MIN_LOD", JS::NumberValue(33082U) }, |
14709 | | { "TEXTURE_MAX_LOD", JS::NumberValue(33083U) }, |
14710 | | { "TEXTURE_BASE_LEVEL", JS::NumberValue(33084U) }, |
14711 | | { "TEXTURE_MAX_LEVEL", JS::NumberValue(33085U) }, |
14712 | | { "MIN", JS::NumberValue(32775U) }, |
14713 | | { "MAX", JS::NumberValue(32776U) }, |
14714 | | { "DEPTH_COMPONENT24", JS::NumberValue(33190U) }, |
14715 | | { "MAX_TEXTURE_LOD_BIAS", JS::NumberValue(34045U) }, |
14716 | | { "TEXTURE_COMPARE_MODE", JS::NumberValue(34892U) }, |
14717 | | { "TEXTURE_COMPARE_FUNC", JS::NumberValue(34893U) }, |
14718 | | { "CURRENT_QUERY", JS::NumberValue(34917U) }, |
14719 | | { "QUERY_RESULT", JS::NumberValue(34918U) }, |
14720 | | { "QUERY_RESULT_AVAILABLE", JS::NumberValue(34919U) }, |
14721 | | { "STREAM_READ", JS::NumberValue(35041U) }, |
14722 | | { "STREAM_COPY", JS::NumberValue(35042U) }, |
14723 | | { "STATIC_READ", JS::NumberValue(35045U) }, |
14724 | | { "STATIC_COPY", JS::NumberValue(35046U) }, |
14725 | | { "DYNAMIC_READ", JS::NumberValue(35049U) }, |
14726 | | { "DYNAMIC_COPY", JS::NumberValue(35050U) }, |
14727 | | { "MAX_DRAW_BUFFERS", JS::NumberValue(34852U) }, |
14728 | | { "DRAW_BUFFER0", JS::NumberValue(34853U) }, |
14729 | | { "DRAW_BUFFER1", JS::NumberValue(34854U) }, |
14730 | | { "DRAW_BUFFER2", JS::NumberValue(34855U) }, |
14731 | | { "DRAW_BUFFER3", JS::NumberValue(34856U) }, |
14732 | | { "DRAW_BUFFER4", JS::NumberValue(34857U) }, |
14733 | | { "DRAW_BUFFER5", JS::NumberValue(34858U) }, |
14734 | | { "DRAW_BUFFER6", JS::NumberValue(34859U) }, |
14735 | | { "DRAW_BUFFER7", JS::NumberValue(34860U) }, |
14736 | | { "DRAW_BUFFER8", JS::NumberValue(34861U) }, |
14737 | | { "DRAW_BUFFER9", JS::NumberValue(34862U) }, |
14738 | | { "DRAW_BUFFER10", JS::NumberValue(34863U) }, |
14739 | | { "DRAW_BUFFER11", JS::NumberValue(34864U) }, |
14740 | | { "DRAW_BUFFER12", JS::NumberValue(34865U) }, |
14741 | | { "DRAW_BUFFER13", JS::NumberValue(34866U) }, |
14742 | | { "DRAW_BUFFER14", JS::NumberValue(34867U) }, |
14743 | | { "DRAW_BUFFER15", JS::NumberValue(34868U) }, |
14744 | | { "MAX_FRAGMENT_UNIFORM_COMPONENTS", JS::NumberValue(35657U) }, |
14745 | | { "MAX_VERTEX_UNIFORM_COMPONENTS", JS::NumberValue(35658U) }, |
14746 | | { "SAMPLER_3D", JS::NumberValue(35679U) }, |
14747 | | { "SAMPLER_2D_SHADOW", JS::NumberValue(35682U) }, |
14748 | | { "FRAGMENT_SHADER_DERIVATIVE_HINT", JS::NumberValue(35723U) }, |
14749 | | { "PIXEL_PACK_BUFFER", JS::NumberValue(35051U) }, |
14750 | | { "PIXEL_UNPACK_BUFFER", JS::NumberValue(35052U) }, |
14751 | | { "PIXEL_PACK_BUFFER_BINDING", JS::NumberValue(35053U) }, |
14752 | | { "PIXEL_UNPACK_BUFFER_BINDING", JS::NumberValue(35055U) }, |
14753 | | { "FLOAT_MAT2x3", JS::NumberValue(35685U) }, |
14754 | | { "FLOAT_MAT2x4", JS::NumberValue(35686U) }, |
14755 | | { "FLOAT_MAT3x2", JS::NumberValue(35687U) }, |
14756 | | { "FLOAT_MAT3x4", JS::NumberValue(35688U) }, |
14757 | | { "FLOAT_MAT4x2", JS::NumberValue(35689U) }, |
14758 | | { "FLOAT_MAT4x3", JS::NumberValue(35690U) }, |
14759 | | { "SRGB", JS::NumberValue(35904U) }, |
14760 | | { "SRGB8", JS::NumberValue(35905U) }, |
14761 | | { "SRGB8_ALPHA8", JS::NumberValue(35907U) }, |
14762 | | { "COMPARE_REF_TO_TEXTURE", JS::NumberValue(34894U) }, |
14763 | | { "RGBA32F", JS::NumberValue(34836U) }, |
14764 | | { "RGB32F", JS::NumberValue(34837U) }, |
14765 | | { "RGBA16F", JS::NumberValue(34842U) }, |
14766 | | { "RGB16F", JS::NumberValue(34843U) }, |
14767 | | { "VERTEX_ATTRIB_ARRAY_INTEGER", JS::NumberValue(35069U) }, |
14768 | | { "MAX_ARRAY_TEXTURE_LAYERS", JS::NumberValue(35071U) }, |
14769 | | { "MIN_PROGRAM_TEXEL_OFFSET", JS::NumberValue(35076U) }, |
14770 | | { "MAX_PROGRAM_TEXEL_OFFSET", JS::NumberValue(35077U) }, |
14771 | | { "MAX_VARYING_COMPONENTS", JS::NumberValue(35659U) }, |
14772 | | { "TEXTURE_2D_ARRAY", JS::NumberValue(35866U) }, |
14773 | | { "TEXTURE_BINDING_2D_ARRAY", JS::NumberValue(35869U) }, |
14774 | | { "R11F_G11F_B10F", JS::NumberValue(35898U) }, |
14775 | | { "UNSIGNED_INT_10F_11F_11F_REV", JS::NumberValue(35899U) }, |
14776 | | { "RGB9_E5", JS::NumberValue(35901U) }, |
14777 | | { "UNSIGNED_INT_5_9_9_9_REV", JS::NumberValue(35902U) }, |
14778 | | { "TRANSFORM_FEEDBACK_BUFFER_MODE", JS::NumberValue(35967U) }, |
14779 | | { "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", JS::NumberValue(35968U) }, |
14780 | | { "TRANSFORM_FEEDBACK_VARYINGS", JS::NumberValue(35971U) }, |
14781 | | { "TRANSFORM_FEEDBACK_BUFFER_START", JS::NumberValue(35972U) }, |
14782 | | { "TRANSFORM_FEEDBACK_BUFFER_SIZE", JS::NumberValue(35973U) }, |
14783 | | { "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", JS::NumberValue(35976U) }, |
14784 | | { "RASTERIZER_DISCARD", JS::NumberValue(35977U) }, |
14785 | | { "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", JS::NumberValue(35978U) }, |
14786 | | { "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", JS::NumberValue(35979U) }, |
14787 | | { "INTERLEAVED_ATTRIBS", JS::NumberValue(35980U) }, |
14788 | | { "SEPARATE_ATTRIBS", JS::NumberValue(35981U) }, |
14789 | | { "TRANSFORM_FEEDBACK_BUFFER", JS::NumberValue(35982U) }, |
14790 | | { "TRANSFORM_FEEDBACK_BUFFER_BINDING", JS::NumberValue(35983U) }, |
14791 | | { "RGBA32UI", JS::NumberValue(36208U) }, |
14792 | | { "RGB32UI", JS::NumberValue(36209U) }, |
14793 | | { "RGBA16UI", JS::NumberValue(36214U) }, |
14794 | | { "RGB16UI", JS::NumberValue(36215U) }, |
14795 | | { "RGBA8UI", JS::NumberValue(36220U) }, |
14796 | | { "RGB8UI", JS::NumberValue(36221U) }, |
14797 | | { "RGBA32I", JS::NumberValue(36226U) }, |
14798 | | { "RGB32I", JS::NumberValue(36227U) }, |
14799 | | { "RGBA16I", JS::NumberValue(36232U) }, |
14800 | | { "RGB16I", JS::NumberValue(36233U) }, |
14801 | | { "RGBA8I", JS::NumberValue(36238U) }, |
14802 | | { "RGB8I", JS::NumberValue(36239U) }, |
14803 | | { "RED_INTEGER", JS::NumberValue(36244U) }, |
14804 | | { "RGB_INTEGER", JS::NumberValue(36248U) }, |
14805 | | { "RGBA_INTEGER", JS::NumberValue(36249U) }, |
14806 | | { "SAMPLER_2D_ARRAY", JS::NumberValue(36289U) }, |
14807 | | { "SAMPLER_2D_ARRAY_SHADOW", JS::NumberValue(36292U) }, |
14808 | | { "SAMPLER_CUBE_SHADOW", JS::NumberValue(36293U) }, |
14809 | | { "UNSIGNED_INT_VEC2", JS::NumberValue(36294U) }, |
14810 | | { "UNSIGNED_INT_VEC3", JS::NumberValue(36295U) }, |
14811 | | { "UNSIGNED_INT_VEC4", JS::NumberValue(36296U) }, |
14812 | | { "INT_SAMPLER_2D", JS::NumberValue(36298U) }, |
14813 | | { "INT_SAMPLER_3D", JS::NumberValue(36299U) }, |
14814 | | { "INT_SAMPLER_CUBE", JS::NumberValue(36300U) }, |
14815 | | { "INT_SAMPLER_2D_ARRAY", JS::NumberValue(36303U) }, |
14816 | | { "UNSIGNED_INT_SAMPLER_2D", JS::NumberValue(36306U) }, |
14817 | | { "UNSIGNED_INT_SAMPLER_3D", JS::NumberValue(36307U) }, |
14818 | | { "UNSIGNED_INT_SAMPLER_CUBE", JS::NumberValue(36308U) }, |
14819 | | { "UNSIGNED_INT_SAMPLER_2D_ARRAY", JS::NumberValue(36311U) }, |
14820 | | { "DEPTH_COMPONENT32F", JS::NumberValue(36012U) }, |
14821 | | { "DEPTH32F_STENCIL8", JS::NumberValue(36013U) }, |
14822 | | { "FLOAT_32_UNSIGNED_INT_24_8_REV", JS::NumberValue(36269U) }, |
14823 | | { "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", JS::NumberValue(33296U) }, |
14824 | | { "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", JS::NumberValue(33297U) }, |
14825 | | { "FRAMEBUFFER_ATTACHMENT_RED_SIZE", JS::NumberValue(33298U) }, |
14826 | | { "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", JS::NumberValue(33299U) }, |
14827 | | { "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", JS::NumberValue(33300U) }, |
14828 | | { "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", JS::NumberValue(33301U) }, |
14829 | | { "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", JS::NumberValue(33302U) }, |
14830 | | { "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", JS::NumberValue(33303U) }, |
14831 | | { "FRAMEBUFFER_DEFAULT", JS::NumberValue(33304U) }, |
14832 | | { "UNSIGNED_INT_24_8", JS::NumberValue(34042U) }, |
14833 | | { "DEPTH24_STENCIL8", JS::NumberValue(35056U) }, |
14834 | | { "UNSIGNED_NORMALIZED", JS::NumberValue(35863U) }, |
14835 | | { "DRAW_FRAMEBUFFER_BINDING", JS::NumberValue(36006U) }, |
14836 | | { "READ_FRAMEBUFFER", JS::NumberValue(36008U) }, |
14837 | | { "DRAW_FRAMEBUFFER", JS::NumberValue(36009U) }, |
14838 | | { "READ_FRAMEBUFFER_BINDING", JS::NumberValue(36010U) }, |
14839 | | { "RENDERBUFFER_SAMPLES", JS::NumberValue(36011U) }, |
14840 | | { "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", JS::NumberValue(36052U) }, |
14841 | | { "MAX_COLOR_ATTACHMENTS", JS::NumberValue(36063U) }, |
14842 | | { "COLOR_ATTACHMENT1", JS::NumberValue(36065U) }, |
14843 | | { "COLOR_ATTACHMENT2", JS::NumberValue(36066U) }, |
14844 | | { "COLOR_ATTACHMENT3", JS::NumberValue(36067U) }, |
14845 | | { "COLOR_ATTACHMENT4", JS::NumberValue(36068U) }, |
14846 | | { "COLOR_ATTACHMENT5", JS::NumberValue(36069U) }, |
14847 | | { "COLOR_ATTACHMENT6", JS::NumberValue(36070U) }, |
14848 | | { "COLOR_ATTACHMENT7", JS::NumberValue(36071U) }, |
14849 | | { "COLOR_ATTACHMENT8", JS::NumberValue(36072U) }, |
14850 | | { "COLOR_ATTACHMENT9", JS::NumberValue(36073U) }, |
14851 | | { "COLOR_ATTACHMENT10", JS::NumberValue(36074U) }, |
14852 | | { "COLOR_ATTACHMENT11", JS::NumberValue(36075U) }, |
14853 | | { "COLOR_ATTACHMENT12", JS::NumberValue(36076U) }, |
14854 | | { "COLOR_ATTACHMENT13", JS::NumberValue(36077U) }, |
14855 | | { "COLOR_ATTACHMENT14", JS::NumberValue(36078U) }, |
14856 | | { "COLOR_ATTACHMENT15", JS::NumberValue(36079U) }, |
14857 | | { "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", JS::NumberValue(36182U) }, |
14858 | | { "MAX_SAMPLES", JS::NumberValue(36183U) }, |
14859 | | { "HALF_FLOAT", JS::NumberValue(5131U) }, |
14860 | | { "RG", JS::NumberValue(33319U) }, |
14861 | | { "RG_INTEGER", JS::NumberValue(33320U) }, |
14862 | | { "R8", JS::NumberValue(33321U) }, |
14863 | | { "RG8", JS::NumberValue(33323U) }, |
14864 | | { "R16F", JS::NumberValue(33325U) }, |
14865 | | { "R32F", JS::NumberValue(33326U) }, |
14866 | | { "RG16F", JS::NumberValue(33327U) }, |
14867 | | { "RG32F", JS::NumberValue(33328U) }, |
14868 | | { "R8I", JS::NumberValue(33329U) }, |
14869 | | { "R8UI", JS::NumberValue(33330U) }, |
14870 | | { "R16I", JS::NumberValue(33331U) }, |
14871 | | { "R16UI", JS::NumberValue(33332U) }, |
14872 | | { "R32I", JS::NumberValue(33333U) }, |
14873 | | { "R32UI", JS::NumberValue(33334U) }, |
14874 | | { "RG8I", JS::NumberValue(33335U) }, |
14875 | | { "RG8UI", JS::NumberValue(33336U) }, |
14876 | | { "RG16I", JS::NumberValue(33337U) }, |
14877 | | { "RG16UI", JS::NumberValue(33338U) }, |
14878 | | { "RG32I", JS::NumberValue(33339U) }, |
14879 | | { "RG32UI", JS::NumberValue(33340U) }, |
14880 | | { "VERTEX_ARRAY_BINDING", JS::NumberValue(34229U) }, |
14881 | | { "R8_SNORM", JS::NumberValue(36756U) }, |
14882 | | { "RG8_SNORM", JS::NumberValue(36757U) }, |
14883 | | { "RGB8_SNORM", JS::NumberValue(36758U) }, |
14884 | | { "RGBA8_SNORM", JS::NumberValue(36759U) }, |
14885 | | { "SIGNED_NORMALIZED", JS::NumberValue(36764U) }, |
14886 | | { "COPY_READ_BUFFER", JS::NumberValue(36662U) }, |
14887 | | { "COPY_WRITE_BUFFER", JS::NumberValue(36663U) }, |
14888 | | { "COPY_READ_BUFFER_BINDING", JS::NumberValue(36662U) }, |
14889 | | { "COPY_WRITE_BUFFER_BINDING", JS::NumberValue(36663U) }, |
14890 | | { "UNIFORM_BUFFER", JS::NumberValue(35345U) }, |
14891 | | { "UNIFORM_BUFFER_BINDING", JS::NumberValue(35368U) }, |
14892 | | { "UNIFORM_BUFFER_START", JS::NumberValue(35369U) }, |
14893 | | { "UNIFORM_BUFFER_SIZE", JS::NumberValue(35370U) }, |
14894 | | { "MAX_VERTEX_UNIFORM_BLOCKS", JS::NumberValue(35371U) }, |
14895 | | { "MAX_FRAGMENT_UNIFORM_BLOCKS", JS::NumberValue(35373U) }, |
14896 | | { "MAX_COMBINED_UNIFORM_BLOCKS", JS::NumberValue(35374U) }, |
14897 | | { "MAX_UNIFORM_BUFFER_BINDINGS", JS::NumberValue(35375U) }, |
14898 | | { "MAX_UNIFORM_BLOCK_SIZE", JS::NumberValue(35376U) }, |
14899 | | { "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", JS::NumberValue(35377U) }, |
14900 | | { "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", JS::NumberValue(35379U) }, |
14901 | | { "UNIFORM_BUFFER_OFFSET_ALIGNMENT", JS::NumberValue(35380U) }, |
14902 | | { "ACTIVE_UNIFORM_BLOCKS", JS::NumberValue(35382U) }, |
14903 | | { "UNIFORM_TYPE", JS::NumberValue(35383U) }, |
14904 | | { "UNIFORM_SIZE", JS::NumberValue(35384U) }, |
14905 | | { "UNIFORM_BLOCK_INDEX", JS::NumberValue(35386U) }, |
14906 | | { "UNIFORM_OFFSET", JS::NumberValue(35387U) }, |
14907 | | { "UNIFORM_ARRAY_STRIDE", JS::NumberValue(35388U) }, |
14908 | | { "UNIFORM_MATRIX_STRIDE", JS::NumberValue(35389U) }, |
14909 | | { "UNIFORM_IS_ROW_MAJOR", JS::NumberValue(35390U) }, |
14910 | | { "UNIFORM_BLOCK_BINDING", JS::NumberValue(35391U) }, |
14911 | | { "UNIFORM_BLOCK_DATA_SIZE", JS::NumberValue(35392U) }, |
14912 | | { "UNIFORM_BLOCK_ACTIVE_UNIFORMS", JS::NumberValue(35394U) }, |
14913 | | { "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", JS::NumberValue(35395U) }, |
14914 | | { "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", JS::NumberValue(35396U) }, |
14915 | | { "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", JS::NumberValue(35398U) }, |
14916 | | { "INVALID_INDEX", JS::NumberValue(4294967295U) }, |
14917 | | { "MAX_VERTEX_OUTPUT_COMPONENTS", JS::NumberValue(37154U) }, |
14918 | | { "MAX_FRAGMENT_INPUT_COMPONENTS", JS::NumberValue(37157U) }, |
14919 | | { "MAX_SERVER_WAIT_TIMEOUT", JS::NumberValue(37137U) }, |
14920 | | { "OBJECT_TYPE", JS::NumberValue(37138U) }, |
14921 | | { "SYNC_CONDITION", JS::NumberValue(37139U) }, |
14922 | | { "SYNC_STATUS", JS::NumberValue(37140U) }, |
14923 | | { "SYNC_FLAGS", JS::NumberValue(37141U) }, |
14924 | | { "SYNC_FENCE", JS::NumberValue(37142U) }, |
14925 | | { "SYNC_GPU_COMMANDS_COMPLETE", JS::NumberValue(37143U) }, |
14926 | | { "UNSIGNALED", JS::NumberValue(37144U) }, |
14927 | | { "SIGNALED", JS::NumberValue(37145U) }, |
14928 | | { "ALREADY_SIGNALED", JS::NumberValue(37146U) }, |
14929 | | { "TIMEOUT_EXPIRED", JS::NumberValue(37147U) }, |
14930 | | { "CONDITION_SATISFIED", JS::NumberValue(37148U) }, |
14931 | | { "WAIT_FAILED", JS::NumberValue(37149U) }, |
14932 | | { "SYNC_FLUSH_COMMANDS_BIT", JS::NumberValue(1U) }, |
14933 | | { "VERTEX_ATTRIB_ARRAY_DIVISOR", JS::NumberValue(35070U) }, |
14934 | | { "ANY_SAMPLES_PASSED", JS::NumberValue(35887U) }, |
14935 | | { "ANY_SAMPLES_PASSED_CONSERVATIVE", JS::NumberValue(36202U) }, |
14936 | | { "SAMPLER_BINDING", JS::NumberValue(35097U) }, |
14937 | | { "RGB10_A2UI", JS::NumberValue(36975U) }, |
14938 | | { "INT_2_10_10_10_REV", JS::NumberValue(36255U) }, |
14939 | | { "TRANSFORM_FEEDBACK", JS::NumberValue(36386U) }, |
14940 | | { "TRANSFORM_FEEDBACK_PAUSED", JS::NumberValue(36387U) }, |
14941 | | { "TRANSFORM_FEEDBACK_ACTIVE", JS::NumberValue(36388U) }, |
14942 | | { "TRANSFORM_FEEDBACK_BINDING", JS::NumberValue(36389U) }, |
14943 | | { "TEXTURE_IMMUTABLE_FORMAT", JS::NumberValue(37167U) }, |
14944 | | { "MAX_ELEMENT_INDEX", JS::NumberValue(36203U) }, |
14945 | | { "TEXTURE_IMMUTABLE_LEVELS", JS::NumberValue(33503U) }, |
14946 | | { "TIMEOUT_IGNORED", JS::CanonicalizedDoubleValue(-1LL) }, |
14947 | | { "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", JS::NumberValue(37447U) }, |
14948 | | { "DEPTH_BUFFER_BIT", JS::NumberValue(256U) }, |
14949 | | { "STENCIL_BUFFER_BIT", JS::NumberValue(1024U) }, |
14950 | | { "COLOR_BUFFER_BIT", JS::NumberValue(16384U) }, |
14951 | | { "POINTS", JS::NumberValue(0U) }, |
14952 | | { "LINES", JS::NumberValue(1U) }, |
14953 | | { "LINE_LOOP", JS::NumberValue(2U) }, |
14954 | | { "LINE_STRIP", JS::NumberValue(3U) }, |
14955 | | { "TRIANGLES", JS::NumberValue(4U) }, |
14956 | | { "TRIANGLE_STRIP", JS::NumberValue(5U) }, |
14957 | | { "TRIANGLE_FAN", JS::NumberValue(6U) }, |
14958 | | { "ZERO", JS::NumberValue(0U) }, |
14959 | | { "ONE", JS::NumberValue(1U) }, |
14960 | | { "SRC_COLOR", JS::NumberValue(768U) }, |
14961 | | { "ONE_MINUS_SRC_COLOR", JS::NumberValue(769U) }, |
14962 | | { "SRC_ALPHA", JS::NumberValue(770U) }, |
14963 | | { "ONE_MINUS_SRC_ALPHA", JS::NumberValue(771U) }, |
14964 | | { "DST_ALPHA", JS::NumberValue(772U) }, |
14965 | | { "ONE_MINUS_DST_ALPHA", JS::NumberValue(773U) }, |
14966 | | { "DST_COLOR", JS::NumberValue(774U) }, |
14967 | | { "ONE_MINUS_DST_COLOR", JS::NumberValue(775U) }, |
14968 | | { "SRC_ALPHA_SATURATE", JS::NumberValue(776U) }, |
14969 | | { "FUNC_ADD", JS::NumberValue(32774U) }, |
14970 | | { "BLEND_EQUATION", JS::NumberValue(32777U) }, |
14971 | | { "BLEND_EQUATION_RGB", JS::NumberValue(32777U) }, |
14972 | | { "BLEND_EQUATION_ALPHA", JS::NumberValue(34877U) }, |
14973 | | { "FUNC_SUBTRACT", JS::NumberValue(32778U) }, |
14974 | | { "FUNC_REVERSE_SUBTRACT", JS::NumberValue(32779U) }, |
14975 | | { "BLEND_DST_RGB", JS::NumberValue(32968U) }, |
14976 | | { "BLEND_SRC_RGB", JS::NumberValue(32969U) }, |
14977 | | { "BLEND_DST_ALPHA", JS::NumberValue(32970U) }, |
14978 | | { "BLEND_SRC_ALPHA", JS::NumberValue(32971U) }, |
14979 | | { "CONSTANT_COLOR", JS::NumberValue(32769U) }, |
14980 | | { "ONE_MINUS_CONSTANT_COLOR", JS::NumberValue(32770U) }, |
14981 | | { "CONSTANT_ALPHA", JS::NumberValue(32771U) }, |
14982 | | { "ONE_MINUS_CONSTANT_ALPHA", JS::NumberValue(32772U) }, |
14983 | | { "BLEND_COLOR", JS::NumberValue(32773U) }, |
14984 | | { "ARRAY_BUFFER", JS::NumberValue(34962U) }, |
14985 | | { "ELEMENT_ARRAY_BUFFER", JS::NumberValue(34963U) }, |
14986 | | { "ARRAY_BUFFER_BINDING", JS::NumberValue(34964U) }, |
14987 | | { "ELEMENT_ARRAY_BUFFER_BINDING", JS::NumberValue(34965U) }, |
14988 | | { "STREAM_DRAW", JS::NumberValue(35040U) }, |
14989 | | { "STATIC_DRAW", JS::NumberValue(35044U) }, |
14990 | | { "DYNAMIC_DRAW", JS::NumberValue(35048U) }, |
14991 | | { "BUFFER_SIZE", JS::NumberValue(34660U) }, |
14992 | | { "BUFFER_USAGE", JS::NumberValue(34661U) }, |
14993 | | { "CURRENT_VERTEX_ATTRIB", JS::NumberValue(34342U) }, |
14994 | | { "FRONT", JS::NumberValue(1028U) }, |
14995 | | { "BACK", JS::NumberValue(1029U) }, |
14996 | | { "FRONT_AND_BACK", JS::NumberValue(1032U) }, |
14997 | | { "CULL_FACE", JS::NumberValue(2884U) }, |
14998 | | { "BLEND", JS::NumberValue(3042U) }, |
14999 | | { "DITHER", JS::NumberValue(3024U) }, |
15000 | | { "STENCIL_TEST", JS::NumberValue(2960U) }, |
15001 | | { "DEPTH_TEST", JS::NumberValue(2929U) }, |
15002 | | { "SCISSOR_TEST", JS::NumberValue(3089U) }, |
15003 | | { "POLYGON_OFFSET_FILL", JS::NumberValue(32823U) }, |
15004 | | { "SAMPLE_ALPHA_TO_COVERAGE", JS::NumberValue(32926U) }, |
15005 | | { "SAMPLE_COVERAGE", JS::NumberValue(32928U) }, |
15006 | | { "NO_ERROR", JS::NumberValue(0U) }, |
15007 | | { "INVALID_ENUM", JS::NumberValue(1280U) }, |
15008 | | { "INVALID_VALUE", JS::NumberValue(1281U) }, |
15009 | | { "INVALID_OPERATION", JS::NumberValue(1282U) }, |
15010 | | { "OUT_OF_MEMORY", JS::NumberValue(1285U) }, |
15011 | | { "CW", JS::NumberValue(2304U) }, |
15012 | | { "CCW", JS::NumberValue(2305U) }, |
15013 | | { "LINE_WIDTH", JS::NumberValue(2849U) }, |
15014 | | { "ALIASED_POINT_SIZE_RANGE", JS::NumberValue(33901U) }, |
15015 | | { "ALIASED_LINE_WIDTH_RANGE", JS::NumberValue(33902U) }, |
15016 | | { "CULL_FACE_MODE", JS::NumberValue(2885U) }, |
15017 | | { "FRONT_FACE", JS::NumberValue(2886U) }, |
15018 | | { "DEPTH_RANGE", JS::NumberValue(2928U) }, |
15019 | | { "DEPTH_WRITEMASK", JS::NumberValue(2930U) }, |
15020 | | { "DEPTH_CLEAR_VALUE", JS::NumberValue(2931U) }, |
15021 | | { "DEPTH_FUNC", JS::NumberValue(2932U) }, |
15022 | | { "STENCIL_CLEAR_VALUE", JS::NumberValue(2961U) }, |
15023 | | { "STENCIL_FUNC", JS::NumberValue(2962U) }, |
15024 | | { "STENCIL_FAIL", JS::NumberValue(2964U) }, |
15025 | | { "STENCIL_PASS_DEPTH_FAIL", JS::NumberValue(2965U) }, |
15026 | | { "STENCIL_PASS_DEPTH_PASS", JS::NumberValue(2966U) }, |
15027 | | { "STENCIL_REF", JS::NumberValue(2967U) }, |
15028 | | { "STENCIL_VALUE_MASK", JS::NumberValue(2963U) }, |
15029 | | { "STENCIL_WRITEMASK", JS::NumberValue(2968U) }, |
15030 | | { "STENCIL_BACK_FUNC", JS::NumberValue(34816U) }, |
15031 | | { "STENCIL_BACK_FAIL", JS::NumberValue(34817U) }, |
15032 | | { "STENCIL_BACK_PASS_DEPTH_FAIL", JS::NumberValue(34818U) }, |
15033 | | { "STENCIL_BACK_PASS_DEPTH_PASS", JS::NumberValue(34819U) }, |
15034 | | { "STENCIL_BACK_REF", JS::NumberValue(36003U) }, |
15035 | | { "STENCIL_BACK_VALUE_MASK", JS::NumberValue(36004U) }, |
15036 | | { "STENCIL_BACK_WRITEMASK", JS::NumberValue(36005U) }, |
15037 | | { "VIEWPORT", JS::NumberValue(2978U) }, |
15038 | | { "SCISSOR_BOX", JS::NumberValue(3088U) }, |
15039 | | { "COLOR_CLEAR_VALUE", JS::NumberValue(3106U) }, |
15040 | | { "COLOR_WRITEMASK", JS::NumberValue(3107U) }, |
15041 | | { "UNPACK_ALIGNMENT", JS::NumberValue(3317U) }, |
15042 | | { "PACK_ALIGNMENT", JS::NumberValue(3333U) }, |
15043 | | { "MAX_TEXTURE_SIZE", JS::NumberValue(3379U) }, |
15044 | | { "MAX_VIEWPORT_DIMS", JS::NumberValue(3386U) }, |
15045 | | { "SUBPIXEL_BITS", JS::NumberValue(3408U) }, |
15046 | | { "RED_BITS", JS::NumberValue(3410U) }, |
15047 | | { "GREEN_BITS", JS::NumberValue(3411U) }, |
15048 | | { "BLUE_BITS", JS::NumberValue(3412U) }, |
15049 | | { "ALPHA_BITS", JS::NumberValue(3413U) }, |
15050 | | { "DEPTH_BITS", JS::NumberValue(3414U) }, |
15051 | | { "STENCIL_BITS", JS::NumberValue(3415U) }, |
15052 | | { "POLYGON_OFFSET_UNITS", JS::NumberValue(10752U) }, |
15053 | | { "POLYGON_OFFSET_FACTOR", JS::NumberValue(32824U) }, |
15054 | | { "TEXTURE_BINDING_2D", JS::NumberValue(32873U) }, |
15055 | | { "SAMPLE_BUFFERS", JS::NumberValue(32936U) }, |
15056 | | { "SAMPLES", JS::NumberValue(32937U) }, |
15057 | | { "SAMPLE_COVERAGE_VALUE", JS::NumberValue(32938U) }, |
15058 | | { "SAMPLE_COVERAGE_INVERT", JS::NumberValue(32939U) }, |
15059 | | { "COMPRESSED_TEXTURE_FORMATS", JS::NumberValue(34467U) }, |
15060 | | { "DONT_CARE", JS::NumberValue(4352U) }, |
15061 | | { "FASTEST", JS::NumberValue(4353U) }, |
15062 | | { "NICEST", JS::NumberValue(4354U) }, |
15063 | | { "GENERATE_MIPMAP_HINT", JS::NumberValue(33170U) }, |
15064 | | { "BYTE", JS::NumberValue(5120U) }, |
15065 | | { "UNSIGNED_BYTE", JS::NumberValue(5121U) }, |
15066 | | { "SHORT", JS::NumberValue(5122U) }, |
15067 | | { "UNSIGNED_SHORT", JS::NumberValue(5123U) }, |
15068 | | { "INT", JS::NumberValue(5124U) }, |
15069 | | { "UNSIGNED_INT", JS::NumberValue(5125U) }, |
15070 | | { "FLOAT", JS::NumberValue(5126U) }, |
15071 | | { "DEPTH_COMPONENT", JS::NumberValue(6402U) }, |
15072 | | { "ALPHA", JS::NumberValue(6406U) }, |
15073 | | { "RGB", JS::NumberValue(6407U) }, |
15074 | | { "RGBA", JS::NumberValue(6408U) }, |
15075 | | { "LUMINANCE", JS::NumberValue(6409U) }, |
15076 | | { "LUMINANCE_ALPHA", JS::NumberValue(6410U) }, |
15077 | | { "UNSIGNED_SHORT_4_4_4_4", JS::NumberValue(32819U) }, |
15078 | | { "UNSIGNED_SHORT_5_5_5_1", JS::NumberValue(32820U) }, |
15079 | | { "UNSIGNED_SHORT_5_6_5", JS::NumberValue(33635U) }, |
15080 | | { "FRAGMENT_SHADER", JS::NumberValue(35632U) }, |
15081 | | { "VERTEX_SHADER", JS::NumberValue(35633U) }, |
15082 | | { "MAX_VERTEX_ATTRIBS", JS::NumberValue(34921U) }, |
15083 | | { "MAX_VERTEX_UNIFORM_VECTORS", JS::NumberValue(36347U) }, |
15084 | | { "MAX_VARYING_VECTORS", JS::NumberValue(36348U) }, |
15085 | | { "MAX_COMBINED_TEXTURE_IMAGE_UNITS", JS::NumberValue(35661U) }, |
15086 | | { "MAX_VERTEX_TEXTURE_IMAGE_UNITS", JS::NumberValue(35660U) }, |
15087 | | { "MAX_TEXTURE_IMAGE_UNITS", JS::NumberValue(34930U) }, |
15088 | | { "MAX_FRAGMENT_UNIFORM_VECTORS", JS::NumberValue(36349U) }, |
15089 | | { "SHADER_TYPE", JS::NumberValue(35663U) }, |
15090 | | { "DELETE_STATUS", JS::NumberValue(35712U) }, |
15091 | | { "LINK_STATUS", JS::NumberValue(35714U) }, |
15092 | | { "VALIDATE_STATUS", JS::NumberValue(35715U) }, |
15093 | | { "ATTACHED_SHADERS", JS::NumberValue(35717U) }, |
15094 | | { "ACTIVE_UNIFORMS", JS::NumberValue(35718U) }, |
15095 | | { "ACTIVE_ATTRIBUTES", JS::NumberValue(35721U) }, |
15096 | | { "SHADING_LANGUAGE_VERSION", JS::NumberValue(35724U) }, |
15097 | | { "CURRENT_PROGRAM", JS::NumberValue(35725U) }, |
15098 | | { "NEVER", JS::NumberValue(512U) }, |
15099 | | { "LESS", JS::NumberValue(513U) }, |
15100 | | { "EQUAL", JS::NumberValue(514U) }, |
15101 | | { "LEQUAL", JS::NumberValue(515U) }, |
15102 | | { "GREATER", JS::NumberValue(516U) }, |
15103 | | { "NOTEQUAL", JS::NumberValue(517U) }, |
15104 | | { "GEQUAL", JS::NumberValue(518U) }, |
15105 | | { "ALWAYS", JS::NumberValue(519U) }, |
15106 | | { "KEEP", JS::NumberValue(7680U) }, |
15107 | | { "REPLACE", JS::NumberValue(7681U) }, |
15108 | | { "INCR", JS::NumberValue(7682U) }, |
15109 | | { "DECR", JS::NumberValue(7683U) }, |
15110 | | { "INVERT", JS::NumberValue(5386U) }, |
15111 | | { "INCR_WRAP", JS::NumberValue(34055U) }, |
15112 | | { "DECR_WRAP", JS::NumberValue(34056U) }, |
15113 | | { "VENDOR", JS::NumberValue(7936U) }, |
15114 | | { "RENDERER", JS::NumberValue(7937U) }, |
15115 | | { "VERSION", JS::NumberValue(7938U) }, |
15116 | | { "NEAREST", JS::NumberValue(9728U) }, |
15117 | | { "LINEAR", JS::NumberValue(9729U) }, |
15118 | | { "NEAREST_MIPMAP_NEAREST", JS::NumberValue(9984U) }, |
15119 | | { "LINEAR_MIPMAP_NEAREST", JS::NumberValue(9985U) }, |
15120 | | { "NEAREST_MIPMAP_LINEAR", JS::NumberValue(9986U) }, |
15121 | | { "LINEAR_MIPMAP_LINEAR", JS::NumberValue(9987U) }, |
15122 | | { "TEXTURE_MAG_FILTER", JS::NumberValue(10240U) }, |
15123 | | { "TEXTURE_MIN_FILTER", JS::NumberValue(10241U) }, |
15124 | | { "TEXTURE_WRAP_S", JS::NumberValue(10242U) }, |
15125 | | { "TEXTURE_WRAP_T", JS::NumberValue(10243U) }, |
15126 | | { "TEXTURE_2D", JS::NumberValue(3553U) }, |
15127 | | { "TEXTURE", JS::NumberValue(5890U) }, |
15128 | | { "TEXTURE_CUBE_MAP", JS::NumberValue(34067U) }, |
15129 | | { "TEXTURE_BINDING_CUBE_MAP", JS::NumberValue(34068U) }, |
15130 | | { "TEXTURE_CUBE_MAP_POSITIVE_X", JS::NumberValue(34069U) }, |
15131 | | { "TEXTURE_CUBE_MAP_NEGATIVE_X", JS::NumberValue(34070U) }, |
15132 | | { "TEXTURE_CUBE_MAP_POSITIVE_Y", JS::NumberValue(34071U) }, |
15133 | | { "TEXTURE_CUBE_MAP_NEGATIVE_Y", JS::NumberValue(34072U) }, |
15134 | | { "TEXTURE_CUBE_MAP_POSITIVE_Z", JS::NumberValue(34073U) }, |
15135 | | { "TEXTURE_CUBE_MAP_NEGATIVE_Z", JS::NumberValue(34074U) }, |
15136 | | { "MAX_CUBE_MAP_TEXTURE_SIZE", JS::NumberValue(34076U) }, |
15137 | | { "TEXTURE0", JS::NumberValue(33984U) }, |
15138 | | { "TEXTURE1", JS::NumberValue(33985U) }, |
15139 | | { "TEXTURE2", JS::NumberValue(33986U) }, |
15140 | | { "TEXTURE3", JS::NumberValue(33987U) }, |
15141 | | { "TEXTURE4", JS::NumberValue(33988U) }, |
15142 | | { "TEXTURE5", JS::NumberValue(33989U) }, |
15143 | | { "TEXTURE6", JS::NumberValue(33990U) }, |
15144 | | { "TEXTURE7", JS::NumberValue(33991U) }, |
15145 | | { "TEXTURE8", JS::NumberValue(33992U) }, |
15146 | | { "TEXTURE9", JS::NumberValue(33993U) }, |
15147 | | { "TEXTURE10", JS::NumberValue(33994U) }, |
15148 | | { "TEXTURE11", JS::NumberValue(33995U) }, |
15149 | | { "TEXTURE12", JS::NumberValue(33996U) }, |
15150 | | { "TEXTURE13", JS::NumberValue(33997U) }, |
15151 | | { "TEXTURE14", JS::NumberValue(33998U) }, |
15152 | | { "TEXTURE15", JS::NumberValue(33999U) }, |
15153 | | { "TEXTURE16", JS::NumberValue(34000U) }, |
15154 | | { "TEXTURE17", JS::NumberValue(34001U) }, |
15155 | | { "TEXTURE18", JS::NumberValue(34002U) }, |
15156 | | { "TEXTURE19", JS::NumberValue(34003U) }, |
15157 | | { "TEXTURE20", JS::NumberValue(34004U) }, |
15158 | | { "TEXTURE21", JS::NumberValue(34005U) }, |
15159 | | { "TEXTURE22", JS::NumberValue(34006U) }, |
15160 | | { "TEXTURE23", JS::NumberValue(34007U) }, |
15161 | | { "TEXTURE24", JS::NumberValue(34008U) }, |
15162 | | { "TEXTURE25", JS::NumberValue(34009U) }, |
15163 | | { "TEXTURE26", JS::NumberValue(34010U) }, |
15164 | | { "TEXTURE27", JS::NumberValue(34011U) }, |
15165 | | { "TEXTURE28", JS::NumberValue(34012U) }, |
15166 | | { "TEXTURE29", JS::NumberValue(34013U) }, |
15167 | | { "TEXTURE30", JS::NumberValue(34014U) }, |
15168 | | { "TEXTURE31", JS::NumberValue(34015U) }, |
15169 | | { "ACTIVE_TEXTURE", JS::NumberValue(34016U) }, |
15170 | | { "REPEAT", JS::NumberValue(10497U) }, |
15171 | | { "CLAMP_TO_EDGE", JS::NumberValue(33071U) }, |
15172 | | { "MIRRORED_REPEAT", JS::NumberValue(33648U) }, |
15173 | | { "FLOAT_VEC2", JS::NumberValue(35664U) }, |
15174 | | { "FLOAT_VEC3", JS::NumberValue(35665U) }, |
15175 | | { "FLOAT_VEC4", JS::NumberValue(35666U) }, |
15176 | | { "INT_VEC2", JS::NumberValue(35667U) }, |
15177 | | { "INT_VEC3", JS::NumberValue(35668U) }, |
15178 | | { "INT_VEC4", JS::NumberValue(35669U) }, |
15179 | | { "BOOL", JS::NumberValue(35670U) }, |
15180 | | { "BOOL_VEC2", JS::NumberValue(35671U) }, |
15181 | | { "BOOL_VEC3", JS::NumberValue(35672U) }, |
15182 | | { "BOOL_VEC4", JS::NumberValue(35673U) }, |
15183 | | { "FLOAT_MAT2", JS::NumberValue(35674U) }, |
15184 | | { "FLOAT_MAT3", JS::NumberValue(35675U) }, |
15185 | | { "FLOAT_MAT4", JS::NumberValue(35676U) }, |
15186 | | { "SAMPLER_2D", JS::NumberValue(35678U) }, |
15187 | | { "SAMPLER_CUBE", JS::NumberValue(35680U) }, |
15188 | | { "VERTEX_ATTRIB_ARRAY_ENABLED", JS::NumberValue(34338U) }, |
15189 | | { "VERTEX_ATTRIB_ARRAY_SIZE", JS::NumberValue(34339U) }, |
15190 | | { "VERTEX_ATTRIB_ARRAY_STRIDE", JS::NumberValue(34340U) }, |
15191 | | { "VERTEX_ATTRIB_ARRAY_TYPE", JS::NumberValue(34341U) }, |
15192 | | { "VERTEX_ATTRIB_ARRAY_NORMALIZED", JS::NumberValue(34922U) }, |
15193 | | { "VERTEX_ATTRIB_ARRAY_POINTER", JS::NumberValue(34373U) }, |
15194 | | { "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", JS::NumberValue(34975U) }, |
15195 | | { "IMPLEMENTATION_COLOR_READ_TYPE", JS::NumberValue(35738U) }, |
15196 | | { "IMPLEMENTATION_COLOR_READ_FORMAT", JS::NumberValue(35739U) }, |
15197 | | { "COMPILE_STATUS", JS::NumberValue(35713U) }, |
15198 | | { "LOW_FLOAT", JS::NumberValue(36336U) }, |
15199 | | { "MEDIUM_FLOAT", JS::NumberValue(36337U) }, |
15200 | | { "HIGH_FLOAT", JS::NumberValue(36338U) }, |
15201 | | { "LOW_INT", JS::NumberValue(36339U) }, |
15202 | | { "MEDIUM_INT", JS::NumberValue(36340U) }, |
15203 | | { "HIGH_INT", JS::NumberValue(36341U) }, |
15204 | | { "FRAMEBUFFER", JS::NumberValue(36160U) }, |
15205 | | { "RENDERBUFFER", JS::NumberValue(36161U) }, |
15206 | | { "RGBA4", JS::NumberValue(32854U) }, |
15207 | | { "RGB5_A1", JS::NumberValue(32855U) }, |
15208 | | { "RGB565", JS::NumberValue(36194U) }, |
15209 | | { "DEPTH_COMPONENT16", JS::NumberValue(33189U) }, |
15210 | | { "STENCIL_INDEX8", JS::NumberValue(36168U) }, |
15211 | | { "DEPTH_STENCIL", JS::NumberValue(34041U) }, |
15212 | | { "RENDERBUFFER_WIDTH", JS::NumberValue(36162U) }, |
15213 | | { "RENDERBUFFER_HEIGHT", JS::NumberValue(36163U) }, |
15214 | | { "RENDERBUFFER_INTERNAL_FORMAT", JS::NumberValue(36164U) }, |
15215 | | { "RENDERBUFFER_RED_SIZE", JS::NumberValue(36176U) }, |
15216 | | { "RENDERBUFFER_GREEN_SIZE", JS::NumberValue(36177U) }, |
15217 | | { "RENDERBUFFER_BLUE_SIZE", JS::NumberValue(36178U) }, |
15218 | | { "RENDERBUFFER_ALPHA_SIZE", JS::NumberValue(36179U) }, |
15219 | | { "RENDERBUFFER_DEPTH_SIZE", JS::NumberValue(36180U) }, |
15220 | | { "RENDERBUFFER_STENCIL_SIZE", JS::NumberValue(36181U) }, |
15221 | | { "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", JS::NumberValue(36048U) }, |
15222 | | { "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", JS::NumberValue(36049U) }, |
15223 | | { "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", JS::NumberValue(36050U) }, |
15224 | | { "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", JS::NumberValue(36051U) }, |
15225 | | { "COLOR_ATTACHMENT0", JS::NumberValue(36064U) }, |
15226 | | { "DEPTH_ATTACHMENT", JS::NumberValue(36096U) }, |
15227 | | { "STENCIL_ATTACHMENT", JS::NumberValue(36128U) }, |
15228 | | { "DEPTH_STENCIL_ATTACHMENT", JS::NumberValue(33306U) }, |
15229 | | { "NONE", JS::NumberValue(0U) }, |
15230 | | { "FRAMEBUFFER_COMPLETE", JS::NumberValue(36053U) }, |
15231 | | { "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", JS::NumberValue(36054U) }, |
15232 | | { "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", JS::NumberValue(36055U) }, |
15233 | | { "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", JS::NumberValue(36057U) }, |
15234 | | { "FRAMEBUFFER_UNSUPPORTED", JS::NumberValue(36061U) }, |
15235 | | { "FRAMEBUFFER_BINDING", JS::NumberValue(36006U) }, |
15236 | | { "RENDERBUFFER_BINDING", JS::NumberValue(36007U) }, |
15237 | | { "MAX_RENDERBUFFER_SIZE", JS::NumberValue(34024U) }, |
15238 | | { "INVALID_FRAMEBUFFER_OPERATION", JS::NumberValue(1286U) }, |
15239 | | { "UNPACK_FLIP_Y_WEBGL", JS::NumberValue(37440U) }, |
15240 | | { "UNPACK_PREMULTIPLY_ALPHA_WEBGL", JS::NumberValue(37441U) }, |
15241 | | { "CONTEXT_LOST_WEBGL", JS::NumberValue(37442U) }, |
15242 | | { "UNPACK_COLORSPACE_CONVERSION_WEBGL", JS::NumberValue(37443U) }, |
15243 | | { "BROWSER_DEFAULT_WEBGL", JS::NumberValue(37444U) }, |
15244 | | { 0, JS::UndefinedValue() } |
15245 | | }; |
15246 | | #if defined(__clang__) |
15247 | | #pragma clang diagnostic pop |
15248 | | #endif |
15249 | | |
15250 | | |
15251 | | static const Prefable<const ConstantSpec> sConstants[] = { |
15252 | | { nullptr, &sConstants_specs[0] }, |
15253 | | { nullptr, nullptr } |
15254 | | }; |
15255 | | |
15256 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
15257 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
15258 | | static_assert(559 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
15259 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
15260 | | |
15261 | | |
15262 | | static uint16_t sNativeProperties_sortedPropertyIndices[786]; |
15263 | | static PropertyInfo sNativeProperties_propertyInfos[786]; |
15264 | | |
15265 | | static const NativePropertiesN<3> sNativeProperties = { |
15266 | | false, 0, |
15267 | | false, 0, |
15268 | | true, 0 /* sMethods */, |
15269 | | true, 1 /* sAttributes */, |
15270 | | false, 0, |
15271 | | false, 0, |
15272 | | true, 2 /* sConstants */, |
15273 | | -1, |
15274 | | 786, |
15275 | | sNativeProperties_sortedPropertyIndices, |
15276 | | { |
15277 | | { sMethods, &sNativeProperties_propertyInfos[0] }, |
15278 | | { sAttributes, &sNativeProperties_propertyInfos[224] }, |
15279 | | { sConstants, &sNativeProperties_propertyInfos[227] } |
15280 | | } |
15281 | | }; |
15282 | | static_assert(786 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
15283 | | "We have a property info count that is oversized"); |
15284 | | |
15285 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
15286 | | { |
15287 | | "Function", |
15288 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
15289 | | &sBoringInterfaceObjectClassClassOps, |
15290 | | JS_NULL_CLASS_SPEC, |
15291 | | JS_NULL_CLASS_EXT, |
15292 | | &sInterfaceObjectClassObjectOps |
15293 | | }, |
15294 | | eInterface, |
15295 | | true, |
15296 | | prototypes::id::WebGL2RenderingContext, |
15297 | | PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth, |
15298 | | sNativePropertyHooks, |
15299 | | "function WebGL2RenderingContext() {\n [native code]\n}", |
15300 | | JS::GetRealmFunctionPrototype |
15301 | | }; |
15302 | | |
15303 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
15304 | | { |
15305 | | "WebGL2RenderingContextPrototype", |
15306 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
15307 | | JS_NULL_CLASS_OPS, |
15308 | | JS_NULL_CLASS_SPEC, |
15309 | | JS_NULL_CLASS_EXT, |
15310 | | JS_NULL_OBJECT_OPS |
15311 | | }, |
15312 | | eInterfacePrototype, |
15313 | | false, |
15314 | | prototypes::id::WebGL2RenderingContext, |
15315 | | PrototypeTraits<prototypes::id::WebGL2RenderingContext>::Depth, |
15316 | | sNativePropertyHooks, |
15317 | | "[object WebGL2RenderingContextPrototype]", |
15318 | | JS::GetRealmObjectPrototype |
15319 | | }; |
15320 | | |
15321 | | bool |
15322 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj) |
15323 | 0 | { |
15324 | 0 | static bool sPrefValue; |
15325 | 0 | static bool sPrefCacheSetUp = false; |
15326 | 0 | if (!sPrefCacheSetUp) { |
15327 | 0 | sPrefCacheSetUp = true; |
15328 | 0 | Preferences::AddBoolVarCache(&sPrefValue, "webgl.enable-webgl2"); |
15329 | 0 | } |
15330 | 0 |
|
15331 | 0 | return sPrefValue; |
15332 | 0 | } |
15333 | | |
15334 | | static const js::ClassOps sClassOps = { |
15335 | | _addProperty, /* addProperty */ |
15336 | | nullptr, /* delProperty */ |
15337 | | nullptr, /* enumerate */ |
15338 | | nullptr, /* newEnumerate */ |
15339 | | nullptr, /* resolve */ |
15340 | | nullptr, /* mayResolve */ |
15341 | | _finalize, /* finalize */ |
15342 | | nullptr, /* call */ |
15343 | | nullptr, /* hasInstance */ |
15344 | | nullptr, /* construct */ |
15345 | | nullptr, /* trace */ |
15346 | | }; |
15347 | | |
15348 | | static const js::ClassExtension sClassExtension = { |
15349 | | nullptr, /* weakmapKeyDelegateOp */ |
15350 | | _objectMoved /* objectMovedOp */ |
15351 | | }; |
15352 | | |
15353 | | static const DOMJSClass sClass = { |
15354 | | { "WebGL2RenderingContext", |
15355 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
15356 | | &sClassOps, |
15357 | | JS_NULL_CLASS_SPEC, |
15358 | | &sClassExtension, |
15359 | | JS_NULL_OBJECT_OPS |
15360 | | }, |
15361 | | { prototypes::id::WebGL2RenderingContext, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
15362 | | IsBaseOf<nsISupports, mozilla::WebGL2Context >::value, |
15363 | | sNativePropertyHooks, |
15364 | | FindAssociatedGlobalForNative<mozilla::WebGL2Context>::Get, |
15365 | | GetProtoObjectHandle, |
15366 | | GetCCParticipant<mozilla::WebGL2Context>::Get() |
15367 | | }; |
15368 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
15369 | | "Must have the right minimal number of reserved slots."); |
15370 | | static_assert(1 >= 1, |
15371 | | "Must have enough reserved slots."); |
15372 | | |
15373 | | const JSClass* |
15374 | | GetJSClass() |
15375 | 0 | { |
15376 | 0 | return sClass.ToJSClass(); |
15377 | 0 | } |
15378 | | |
15379 | | bool |
15380 | | Wrap(JSContext* aCx, mozilla::WebGL2Context* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
15381 | 0 | { |
15382 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::WebGL2Context>::value, |
15383 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
15384 | 0 | MOZ_ASSERT(static_cast<mozilla::WebGL2Context*>(aObject) == |
15385 | 0 | reinterpret_cast<mozilla::WebGL2Context*>(aObject), |
15386 | 0 | "Multiple inheritance for mozilla::WebGL2Context is broken."); |
15387 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
15388 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
15389 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
15390 | 0 | "You should probably not be using Wrap() directly; use " |
15391 | 0 | "GetOrCreateDOMReflector instead"); |
15392 | 0 |
|
15393 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
15394 | 0 | "nsISupports must be on our primary inheritance chain"); |
15395 | 0 |
|
15396 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
15397 | 0 | if (!global) { |
15398 | 0 | return false; |
15399 | 0 | } |
15400 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
15401 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
15402 | 0 |
|
15403 | 0 | // That might have ended up wrapping us already, due to the wonders |
15404 | 0 | // of XBL. Check for that, and bail out as needed. |
15405 | 0 | aReflector.set(aCache->GetWrapper()); |
15406 | 0 | if (aReflector) { |
15407 | | #ifdef DEBUG |
15408 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
15409 | | #endif // DEBUG |
15410 | | return true; |
15411 | 0 | } |
15412 | 0 |
|
15413 | 0 | JSAutoRealm ar(aCx, global); |
15414 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
15415 | 0 | if (!canonicalProto) { |
15416 | 0 | return false; |
15417 | 0 | } |
15418 | 0 | JS::Rooted<JSObject*> proto(aCx); |
15419 | 0 | if (aGivenProto) { |
15420 | 0 | proto = aGivenProto; |
15421 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
15422 | 0 | // coming in, we changed compartments to that of "parent" so may need |
15423 | 0 | // to wrap the proto here. |
15424 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
15425 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
15426 | 0 | return false; |
15427 | 0 | } |
15428 | 0 | } |
15429 | 0 | } else { |
15430 | 0 | proto = canonicalProto; |
15431 | 0 | } |
15432 | 0 |
|
15433 | 0 | BindingJSObjectCreator<mozilla::WebGL2Context> creator(aCx); |
15434 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
15435 | 0 | if (!aReflector) { |
15436 | 0 | return false; |
15437 | 0 | } |
15438 | 0 | |
15439 | 0 | aCache->SetWrapper(aReflector); |
15440 | 0 | creator.InitializationSucceeded(); |
15441 | 0 |
|
15442 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
15443 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
15444 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
15445 | 0 | // otherwise we won't be able to properly recreate it later, since |
15446 | 0 | // we won't know what proto to use. Note that we don't check |
15447 | 0 | // aGivenProto here, since it's entirely possible (and even |
15448 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
15449 | 0 | // same as canonicalProto. |
15450 | 0 | if (proto != canonicalProto) { |
15451 | 0 | PreserveWrapper(aObject); |
15452 | 0 | } |
15453 | 0 |
|
15454 | 0 | return true; |
15455 | 0 | } |
15456 | | |
15457 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
15458 | | nullptr, |
15459 | | nullptr, |
15460 | | nullptr, |
15461 | | { sNativeProperties.Upcast(), nullptr }, |
15462 | | prototypes::id::WebGL2RenderingContext, |
15463 | | constructors::id::WebGL2RenderingContext, |
15464 | | nullptr, |
15465 | | &DefaultXrayExpandoObjectClass |
15466 | | } }; |
15467 | | |
15468 | | void |
15469 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
15470 | 0 | { |
15471 | 0 | JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx)); |
15472 | 0 | if (!parentProto) { |
15473 | 0 | return; |
15474 | 0 | } |
15475 | 0 | |
15476 | 0 | JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx)); |
15477 | 0 | if (!constructorProto) { |
15478 | 0 | return; |
15479 | 0 | } |
15480 | 0 | |
15481 | 0 | static bool sIdsInited = false; |
15482 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
15483 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
15484 | 0 | return; |
15485 | 0 | } |
15486 | 0 | sIdsInited = true; |
15487 | 0 | } |
15488 | 0 |
|
15489 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::WebGL2RenderingContext); |
15490 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::WebGL2RenderingContext); |
15491 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
15492 | 0 | &sPrototypeClass.mBase, protoCache, |
15493 | 0 | nullptr, |
15494 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
15495 | 0 | interfaceCache, |
15496 | 0 | sNativeProperties.Upcast(), |
15497 | 0 | nullptr, |
15498 | 0 | "WebGL2RenderingContext", aDefineOnGlobal, |
15499 | 0 | nullptr, |
15500 | 0 | false); |
15501 | 0 | } |
15502 | | |
15503 | | JSObject* |
15504 | | GetConstructorObject(JSContext* aCx) |
15505 | 0 | { |
15506 | 0 | return GetConstructorObjectHandle(aCx); |
15507 | 0 | } |
15508 | | |
15509 | | } // namespace WebGL2RenderingContext_Binding |
15510 | | |
15511 | | |
15512 | | |
15513 | | namespace WebGLSampler_Binding { |
15514 | | |
15515 | | static bool |
15516 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
15517 | 0 | { |
15518 | 0 | mozilla::WebGLSampler* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLSampler>(obj); |
15519 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
15520 | 0 | // obviously can't preserve if we're not initialized. |
15521 | 0 | if (self && self->GetWrapperPreserveColor()) { |
15522 | 0 | PreserveWrapper(self); |
15523 | 0 | } |
15524 | 0 | return true; |
15525 | 0 | } |
15526 | | |
15527 | | static void |
15528 | | _finalize(js::FreeOp* fop, JSObject* obj) |
15529 | 0 | { |
15530 | 0 | mozilla::WebGLSampler* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLSampler>(obj); |
15531 | 0 | if (self) { |
15532 | 0 | ClearWrapper(self, self, obj); |
15533 | 0 | AddForDeferredFinalization<mozilla::WebGLSampler>(self); |
15534 | 0 | } |
15535 | 0 | } |
15536 | | |
15537 | | static size_t |
15538 | | _objectMoved(JSObject* obj, JSObject* old) |
15539 | 0 | { |
15540 | 0 | mozilla::WebGLSampler* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLSampler>(obj); |
15541 | 0 | if (self) { |
15542 | 0 | UpdateWrapper(self, self, obj, old); |
15543 | 0 | } |
15544 | 0 |
|
15545 | 0 | return 0; |
15546 | 0 | } |
15547 | | |
15548 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
15549 | | { |
15550 | | "Function", |
15551 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
15552 | | &sBoringInterfaceObjectClassClassOps, |
15553 | | JS_NULL_CLASS_SPEC, |
15554 | | JS_NULL_CLASS_EXT, |
15555 | | &sInterfaceObjectClassObjectOps |
15556 | | }, |
15557 | | eInterface, |
15558 | | true, |
15559 | | prototypes::id::WebGLSampler, |
15560 | | PrototypeTraits<prototypes::id::WebGLSampler>::Depth, |
15561 | | sNativePropertyHooks, |
15562 | | "function WebGLSampler() {\n [native code]\n}", |
15563 | | JS::GetRealmFunctionPrototype |
15564 | | }; |
15565 | | |
15566 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
15567 | | { |
15568 | | "WebGLSamplerPrototype", |
15569 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
15570 | | JS_NULL_CLASS_OPS, |
15571 | | JS_NULL_CLASS_SPEC, |
15572 | | JS_NULL_CLASS_EXT, |
15573 | | JS_NULL_OBJECT_OPS |
15574 | | }, |
15575 | | eInterfacePrototype, |
15576 | | false, |
15577 | | prototypes::id::WebGLSampler, |
15578 | | PrototypeTraits<prototypes::id::WebGLSampler>::Depth, |
15579 | | sNativePropertyHooks, |
15580 | | "[object WebGLSamplerPrototype]", |
15581 | | JS::GetRealmObjectPrototype |
15582 | | }; |
15583 | | |
15584 | | bool |
15585 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj) |
15586 | 0 | { |
15587 | 0 | static bool sPrefValue; |
15588 | 0 | static bool sPrefCacheSetUp = false; |
15589 | 0 | if (!sPrefCacheSetUp) { |
15590 | 0 | sPrefCacheSetUp = true; |
15591 | 0 | Preferences::AddBoolVarCache(&sPrefValue, "webgl.enable-webgl2"); |
15592 | 0 | } |
15593 | 0 |
|
15594 | 0 | return sPrefValue; |
15595 | 0 | } |
15596 | | |
15597 | | static const js::ClassOps sClassOps = { |
15598 | | _addProperty, /* addProperty */ |
15599 | | nullptr, /* delProperty */ |
15600 | | nullptr, /* enumerate */ |
15601 | | nullptr, /* newEnumerate */ |
15602 | | nullptr, /* resolve */ |
15603 | | nullptr, /* mayResolve */ |
15604 | | _finalize, /* finalize */ |
15605 | | nullptr, /* call */ |
15606 | | nullptr, /* hasInstance */ |
15607 | | nullptr, /* construct */ |
15608 | | nullptr, /* trace */ |
15609 | | }; |
15610 | | |
15611 | | static const js::ClassExtension sClassExtension = { |
15612 | | nullptr, /* weakmapKeyDelegateOp */ |
15613 | | _objectMoved /* objectMovedOp */ |
15614 | | }; |
15615 | | |
15616 | | static const DOMJSClass sClass = { |
15617 | | { "WebGLSampler", |
15618 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
15619 | | &sClassOps, |
15620 | | JS_NULL_CLASS_SPEC, |
15621 | | &sClassExtension, |
15622 | | JS_NULL_OBJECT_OPS |
15623 | | }, |
15624 | | { prototypes::id::WebGLSampler, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
15625 | | IsBaseOf<nsISupports, mozilla::WebGLSampler >::value, |
15626 | | sNativePropertyHooks, |
15627 | | FindAssociatedGlobalForNative<mozilla::WebGLSampler>::Get, |
15628 | | GetProtoObjectHandle, |
15629 | | GetCCParticipant<mozilla::WebGLSampler>::Get() |
15630 | | }; |
15631 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
15632 | | "Must have the right minimal number of reserved slots."); |
15633 | | static_assert(1 >= 1, |
15634 | | "Must have enough reserved slots."); |
15635 | | |
15636 | | const JSClass* |
15637 | | GetJSClass() |
15638 | 0 | { |
15639 | 0 | return sClass.ToJSClass(); |
15640 | 0 | } |
15641 | | |
15642 | | bool |
15643 | | Wrap(JSContext* aCx, mozilla::WebGLSampler* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
15644 | 0 | { |
15645 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::WebGLSampler>::value, |
15646 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
15647 | 0 | MOZ_ASSERT(static_cast<mozilla::WebGLSampler*>(aObject) == |
15648 | 0 | reinterpret_cast<mozilla::WebGLSampler*>(aObject), |
15649 | 0 | "Multiple inheritance for mozilla::WebGLSampler is broken."); |
15650 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
15651 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
15652 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
15653 | 0 | "You should probably not be using Wrap() directly; use " |
15654 | 0 | "GetOrCreateDOMReflector instead"); |
15655 | 0 |
|
15656 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
15657 | 0 | "nsISupports must be on our primary inheritance chain"); |
15658 | 0 |
|
15659 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
15660 | 0 | if (!global) { |
15661 | 0 | return false; |
15662 | 0 | } |
15663 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
15664 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
15665 | 0 |
|
15666 | 0 | // That might have ended up wrapping us already, due to the wonders |
15667 | 0 | // of XBL. Check for that, and bail out as needed. |
15668 | 0 | aReflector.set(aCache->GetWrapper()); |
15669 | 0 | if (aReflector) { |
15670 | | #ifdef DEBUG |
15671 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
15672 | | #endif // DEBUG |
15673 | | return true; |
15674 | 0 | } |
15675 | 0 |
|
15676 | 0 | JSAutoRealm ar(aCx, global); |
15677 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
15678 | 0 | if (!canonicalProto) { |
15679 | 0 | return false; |
15680 | 0 | } |
15681 | 0 | JS::Rooted<JSObject*> proto(aCx); |
15682 | 0 | if (aGivenProto) { |
15683 | 0 | proto = aGivenProto; |
15684 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
15685 | 0 | // coming in, we changed compartments to that of "parent" so may need |
15686 | 0 | // to wrap the proto here. |
15687 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
15688 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
15689 | 0 | return false; |
15690 | 0 | } |
15691 | 0 | } |
15692 | 0 | } else { |
15693 | 0 | proto = canonicalProto; |
15694 | 0 | } |
15695 | 0 |
|
15696 | 0 | BindingJSObjectCreator<mozilla::WebGLSampler> creator(aCx); |
15697 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
15698 | 0 | if (!aReflector) { |
15699 | 0 | return false; |
15700 | 0 | } |
15701 | 0 | |
15702 | 0 | aCache->SetWrapper(aReflector); |
15703 | 0 | creator.InitializationSucceeded(); |
15704 | 0 |
|
15705 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
15706 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
15707 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
15708 | 0 | // otherwise we won't be able to properly recreate it later, since |
15709 | 0 | // we won't know what proto to use. Note that we don't check |
15710 | 0 | // aGivenProto here, since it's entirely possible (and even |
15711 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
15712 | 0 | // same as canonicalProto. |
15713 | 0 | if (proto != canonicalProto) { |
15714 | 0 | PreserveWrapper(aObject); |
15715 | 0 | } |
15716 | 0 |
|
15717 | 0 | return true; |
15718 | 0 | } |
15719 | | |
15720 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
15721 | | nullptr, |
15722 | | nullptr, |
15723 | | nullptr, |
15724 | | { nullptr, nullptr }, |
15725 | | prototypes::id::WebGLSampler, |
15726 | | constructors::id::WebGLSampler, |
15727 | | nullptr, |
15728 | | &DefaultXrayExpandoObjectClass |
15729 | | } }; |
15730 | | |
15731 | | void |
15732 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
15733 | 0 | { |
15734 | 0 | JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx)); |
15735 | 0 | if (!parentProto) { |
15736 | 0 | return; |
15737 | 0 | } |
15738 | 0 | |
15739 | 0 | JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx)); |
15740 | 0 | if (!constructorProto) { |
15741 | 0 | return; |
15742 | 0 | } |
15743 | 0 | |
15744 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::WebGLSampler); |
15745 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::WebGLSampler); |
15746 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
15747 | 0 | &sPrototypeClass.mBase, protoCache, |
15748 | 0 | nullptr, |
15749 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
15750 | 0 | interfaceCache, |
15751 | 0 | nullptr, |
15752 | 0 | nullptr, |
15753 | 0 | "WebGLSampler", aDefineOnGlobal, |
15754 | 0 | nullptr, |
15755 | 0 | false); |
15756 | 0 | } |
15757 | | |
15758 | | JSObject* |
15759 | | GetConstructorObject(JSContext* aCx) |
15760 | 0 | { |
15761 | 0 | return GetConstructorObjectHandle(aCx); |
15762 | 0 | } |
15763 | | |
15764 | | } // namespace WebGLSampler_Binding |
15765 | | |
15766 | | |
15767 | | |
15768 | | namespace WebGLSync_Binding { |
15769 | | |
15770 | | static bool |
15771 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
15772 | 0 | { |
15773 | 0 | mozilla::WebGLSync* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLSync>(obj); |
15774 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
15775 | 0 | // obviously can't preserve if we're not initialized. |
15776 | 0 | if (self && self->GetWrapperPreserveColor()) { |
15777 | 0 | PreserveWrapper(self); |
15778 | 0 | } |
15779 | 0 | return true; |
15780 | 0 | } |
15781 | | |
15782 | | static void |
15783 | | _finalize(js::FreeOp* fop, JSObject* obj) |
15784 | 0 | { |
15785 | 0 | mozilla::WebGLSync* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLSync>(obj); |
15786 | 0 | if (self) { |
15787 | 0 | ClearWrapper(self, self, obj); |
15788 | 0 | AddForDeferredFinalization<mozilla::WebGLSync>(self); |
15789 | 0 | } |
15790 | 0 | } |
15791 | | |
15792 | | static size_t |
15793 | | _objectMoved(JSObject* obj, JSObject* old) |
15794 | 0 | { |
15795 | 0 | mozilla::WebGLSync* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLSync>(obj); |
15796 | 0 | if (self) { |
15797 | 0 | UpdateWrapper(self, self, obj, old); |
15798 | 0 | } |
15799 | 0 |
|
15800 | 0 | return 0; |
15801 | 0 | } |
15802 | | |
15803 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
15804 | | { |
15805 | | "Function", |
15806 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
15807 | | &sBoringInterfaceObjectClassClassOps, |
15808 | | JS_NULL_CLASS_SPEC, |
15809 | | JS_NULL_CLASS_EXT, |
15810 | | &sInterfaceObjectClassObjectOps |
15811 | | }, |
15812 | | eInterface, |
15813 | | true, |
15814 | | prototypes::id::WebGLSync, |
15815 | | PrototypeTraits<prototypes::id::WebGLSync>::Depth, |
15816 | | sNativePropertyHooks, |
15817 | | "function WebGLSync() {\n [native code]\n}", |
15818 | | JS::GetRealmFunctionPrototype |
15819 | | }; |
15820 | | |
15821 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
15822 | | { |
15823 | | "WebGLSyncPrototype", |
15824 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
15825 | | JS_NULL_CLASS_OPS, |
15826 | | JS_NULL_CLASS_SPEC, |
15827 | | JS_NULL_CLASS_EXT, |
15828 | | JS_NULL_OBJECT_OPS |
15829 | | }, |
15830 | | eInterfacePrototype, |
15831 | | false, |
15832 | | prototypes::id::WebGLSync, |
15833 | | PrototypeTraits<prototypes::id::WebGLSync>::Depth, |
15834 | | sNativePropertyHooks, |
15835 | | "[object WebGLSyncPrototype]", |
15836 | | JS::GetRealmObjectPrototype |
15837 | | }; |
15838 | | |
15839 | | bool |
15840 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj) |
15841 | 0 | { |
15842 | 0 | static bool sPrefValue; |
15843 | 0 | static bool sPrefCacheSetUp = false; |
15844 | 0 | if (!sPrefCacheSetUp) { |
15845 | 0 | sPrefCacheSetUp = true; |
15846 | 0 | Preferences::AddBoolVarCache(&sPrefValue, "webgl.enable-webgl2"); |
15847 | 0 | } |
15848 | 0 |
|
15849 | 0 | return sPrefValue; |
15850 | 0 | } |
15851 | | |
15852 | | static const js::ClassOps sClassOps = { |
15853 | | _addProperty, /* addProperty */ |
15854 | | nullptr, /* delProperty */ |
15855 | | nullptr, /* enumerate */ |
15856 | | nullptr, /* newEnumerate */ |
15857 | | nullptr, /* resolve */ |
15858 | | nullptr, /* mayResolve */ |
15859 | | _finalize, /* finalize */ |
15860 | | nullptr, /* call */ |
15861 | | nullptr, /* hasInstance */ |
15862 | | nullptr, /* construct */ |
15863 | | nullptr, /* trace */ |
15864 | | }; |
15865 | | |
15866 | | static const js::ClassExtension sClassExtension = { |
15867 | | nullptr, /* weakmapKeyDelegateOp */ |
15868 | | _objectMoved /* objectMovedOp */ |
15869 | | }; |
15870 | | |
15871 | | static const DOMJSClass sClass = { |
15872 | | { "WebGLSync", |
15873 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
15874 | | &sClassOps, |
15875 | | JS_NULL_CLASS_SPEC, |
15876 | | &sClassExtension, |
15877 | | JS_NULL_OBJECT_OPS |
15878 | | }, |
15879 | | { prototypes::id::WebGLSync, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
15880 | | IsBaseOf<nsISupports, mozilla::WebGLSync >::value, |
15881 | | sNativePropertyHooks, |
15882 | | FindAssociatedGlobalForNative<mozilla::WebGLSync>::Get, |
15883 | | GetProtoObjectHandle, |
15884 | | GetCCParticipant<mozilla::WebGLSync>::Get() |
15885 | | }; |
15886 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
15887 | | "Must have the right minimal number of reserved slots."); |
15888 | | static_assert(1 >= 1, |
15889 | | "Must have enough reserved slots."); |
15890 | | |
15891 | | const JSClass* |
15892 | | GetJSClass() |
15893 | 0 | { |
15894 | 0 | return sClass.ToJSClass(); |
15895 | 0 | } |
15896 | | |
15897 | | bool |
15898 | | Wrap(JSContext* aCx, mozilla::WebGLSync* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
15899 | 0 | { |
15900 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::WebGLSync>::value, |
15901 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
15902 | 0 | MOZ_ASSERT(static_cast<mozilla::WebGLSync*>(aObject) == |
15903 | 0 | reinterpret_cast<mozilla::WebGLSync*>(aObject), |
15904 | 0 | "Multiple inheritance for mozilla::WebGLSync is broken."); |
15905 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
15906 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
15907 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
15908 | 0 | "You should probably not be using Wrap() directly; use " |
15909 | 0 | "GetOrCreateDOMReflector instead"); |
15910 | 0 |
|
15911 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
15912 | 0 | "nsISupports must be on our primary inheritance chain"); |
15913 | 0 |
|
15914 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
15915 | 0 | if (!global) { |
15916 | 0 | return false; |
15917 | 0 | } |
15918 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
15919 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
15920 | 0 |
|
15921 | 0 | // That might have ended up wrapping us already, due to the wonders |
15922 | 0 | // of XBL. Check for that, and bail out as needed. |
15923 | 0 | aReflector.set(aCache->GetWrapper()); |
15924 | 0 | if (aReflector) { |
15925 | | #ifdef DEBUG |
15926 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
15927 | | #endif // DEBUG |
15928 | | return true; |
15929 | 0 | } |
15930 | 0 |
|
15931 | 0 | JSAutoRealm ar(aCx, global); |
15932 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
15933 | 0 | if (!canonicalProto) { |
15934 | 0 | return false; |
15935 | 0 | } |
15936 | 0 | JS::Rooted<JSObject*> proto(aCx); |
15937 | 0 | if (aGivenProto) { |
15938 | 0 | proto = aGivenProto; |
15939 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
15940 | 0 | // coming in, we changed compartments to that of "parent" so may need |
15941 | 0 | // to wrap the proto here. |
15942 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
15943 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
15944 | 0 | return false; |
15945 | 0 | } |
15946 | 0 | } |
15947 | 0 | } else { |
15948 | 0 | proto = canonicalProto; |
15949 | 0 | } |
15950 | 0 |
|
15951 | 0 | BindingJSObjectCreator<mozilla::WebGLSync> creator(aCx); |
15952 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
15953 | 0 | if (!aReflector) { |
15954 | 0 | return false; |
15955 | 0 | } |
15956 | 0 | |
15957 | 0 | aCache->SetWrapper(aReflector); |
15958 | 0 | creator.InitializationSucceeded(); |
15959 | 0 |
|
15960 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
15961 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
15962 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
15963 | 0 | // otherwise we won't be able to properly recreate it later, since |
15964 | 0 | // we won't know what proto to use. Note that we don't check |
15965 | 0 | // aGivenProto here, since it's entirely possible (and even |
15966 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
15967 | 0 | // same as canonicalProto. |
15968 | 0 | if (proto != canonicalProto) { |
15969 | 0 | PreserveWrapper(aObject); |
15970 | 0 | } |
15971 | 0 |
|
15972 | 0 | return true; |
15973 | 0 | } |
15974 | | |
15975 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
15976 | | nullptr, |
15977 | | nullptr, |
15978 | | nullptr, |
15979 | | { nullptr, nullptr }, |
15980 | | prototypes::id::WebGLSync, |
15981 | | constructors::id::WebGLSync, |
15982 | | nullptr, |
15983 | | &DefaultXrayExpandoObjectClass |
15984 | | } }; |
15985 | | |
15986 | | void |
15987 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
15988 | 0 | { |
15989 | 0 | JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx)); |
15990 | 0 | if (!parentProto) { |
15991 | 0 | return; |
15992 | 0 | } |
15993 | 0 | |
15994 | 0 | JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx)); |
15995 | 0 | if (!constructorProto) { |
15996 | 0 | return; |
15997 | 0 | } |
15998 | 0 | |
15999 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::WebGLSync); |
16000 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::WebGLSync); |
16001 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
16002 | 0 | &sPrototypeClass.mBase, protoCache, |
16003 | 0 | nullptr, |
16004 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
16005 | 0 | interfaceCache, |
16006 | 0 | nullptr, |
16007 | 0 | nullptr, |
16008 | 0 | "WebGLSync", aDefineOnGlobal, |
16009 | 0 | nullptr, |
16010 | 0 | false); |
16011 | 0 | } |
16012 | | |
16013 | | JSObject* |
16014 | | GetConstructorObject(JSContext* aCx) |
16015 | 0 | { |
16016 | 0 | return GetConstructorObjectHandle(aCx); |
16017 | 0 | } |
16018 | | |
16019 | | } // namespace WebGLSync_Binding |
16020 | | |
16021 | | |
16022 | | |
16023 | | namespace WebGLTransformFeedback_Binding { |
16024 | | |
16025 | | static bool |
16026 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
16027 | 0 | { |
16028 | 0 | mozilla::WebGLTransformFeedback* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLTransformFeedback>(obj); |
16029 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
16030 | 0 | // obviously can't preserve if we're not initialized. |
16031 | 0 | if (self && self->GetWrapperPreserveColor()) { |
16032 | 0 | PreserveWrapper(self); |
16033 | 0 | } |
16034 | 0 | return true; |
16035 | 0 | } |
16036 | | |
16037 | | static void |
16038 | | _finalize(js::FreeOp* fop, JSObject* obj) |
16039 | 0 | { |
16040 | 0 | mozilla::WebGLTransformFeedback* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLTransformFeedback>(obj); |
16041 | 0 | if (self) { |
16042 | 0 | ClearWrapper(self, self, obj); |
16043 | 0 | AddForDeferredFinalization<mozilla::WebGLTransformFeedback>(self); |
16044 | 0 | } |
16045 | 0 | } |
16046 | | |
16047 | | static size_t |
16048 | | _objectMoved(JSObject* obj, JSObject* old) |
16049 | 0 | { |
16050 | 0 | mozilla::WebGLTransformFeedback* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::WebGLTransformFeedback>(obj); |
16051 | 0 | if (self) { |
16052 | 0 | UpdateWrapper(self, self, obj, old); |
16053 | 0 | } |
16054 | 0 |
|
16055 | 0 | return 0; |
16056 | 0 | } |
16057 | | |
16058 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
16059 | | { |
16060 | | "Function", |
16061 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
16062 | | &sBoringInterfaceObjectClassClassOps, |
16063 | | JS_NULL_CLASS_SPEC, |
16064 | | JS_NULL_CLASS_EXT, |
16065 | | &sInterfaceObjectClassObjectOps |
16066 | | }, |
16067 | | eInterface, |
16068 | | true, |
16069 | | prototypes::id::WebGLTransformFeedback, |
16070 | | PrototypeTraits<prototypes::id::WebGLTransformFeedback>::Depth, |
16071 | | sNativePropertyHooks, |
16072 | | "function WebGLTransformFeedback() {\n [native code]\n}", |
16073 | | JS::GetRealmFunctionPrototype |
16074 | | }; |
16075 | | |
16076 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
16077 | | { |
16078 | | "WebGLTransformFeedbackPrototype", |
16079 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
16080 | | JS_NULL_CLASS_OPS, |
16081 | | JS_NULL_CLASS_SPEC, |
16082 | | JS_NULL_CLASS_EXT, |
16083 | | JS_NULL_OBJECT_OPS |
16084 | | }, |
16085 | | eInterfacePrototype, |
16086 | | false, |
16087 | | prototypes::id::WebGLTransformFeedback, |
16088 | | PrototypeTraits<prototypes::id::WebGLTransformFeedback>::Depth, |
16089 | | sNativePropertyHooks, |
16090 | | "[object WebGLTransformFeedbackPrototype]", |
16091 | | JS::GetRealmObjectPrototype |
16092 | | }; |
16093 | | |
16094 | | bool |
16095 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj) |
16096 | 0 | { |
16097 | 0 | static bool sPrefValue; |
16098 | 0 | static bool sPrefCacheSetUp = false; |
16099 | 0 | if (!sPrefCacheSetUp) { |
16100 | 0 | sPrefCacheSetUp = true; |
16101 | 0 | Preferences::AddBoolVarCache(&sPrefValue, "webgl.enable-webgl2"); |
16102 | 0 | } |
16103 | 0 |
|
16104 | 0 | return sPrefValue; |
16105 | 0 | } |
16106 | | |
16107 | | static const js::ClassOps sClassOps = { |
16108 | | _addProperty, /* addProperty */ |
16109 | | nullptr, /* delProperty */ |
16110 | | nullptr, /* enumerate */ |
16111 | | nullptr, /* newEnumerate */ |
16112 | | nullptr, /* resolve */ |
16113 | | nullptr, /* mayResolve */ |
16114 | | _finalize, /* finalize */ |
16115 | | nullptr, /* call */ |
16116 | | nullptr, /* hasInstance */ |
16117 | | nullptr, /* construct */ |
16118 | | nullptr, /* trace */ |
16119 | | }; |
16120 | | |
16121 | | static const js::ClassExtension sClassExtension = { |
16122 | | nullptr, /* weakmapKeyDelegateOp */ |
16123 | | _objectMoved /* objectMovedOp */ |
16124 | | }; |
16125 | | |
16126 | | static const DOMJSClass sClass = { |
16127 | | { "WebGLTransformFeedback", |
16128 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
16129 | | &sClassOps, |
16130 | | JS_NULL_CLASS_SPEC, |
16131 | | &sClassExtension, |
16132 | | JS_NULL_OBJECT_OPS |
16133 | | }, |
16134 | | { prototypes::id::WebGLTransformFeedback, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
16135 | | IsBaseOf<nsISupports, mozilla::WebGLTransformFeedback >::value, |
16136 | | sNativePropertyHooks, |
16137 | | FindAssociatedGlobalForNative<mozilla::WebGLTransformFeedback>::Get, |
16138 | | GetProtoObjectHandle, |
16139 | | GetCCParticipant<mozilla::WebGLTransformFeedback>::Get() |
16140 | | }; |
16141 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
16142 | | "Must have the right minimal number of reserved slots."); |
16143 | | static_assert(1 >= 1, |
16144 | | "Must have enough reserved slots."); |
16145 | | |
16146 | | const JSClass* |
16147 | | GetJSClass() |
16148 | 0 | { |
16149 | 0 | return sClass.ToJSClass(); |
16150 | 0 | } |
16151 | | |
16152 | | bool |
16153 | | Wrap(JSContext* aCx, mozilla::WebGLTransformFeedback* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
16154 | 0 | { |
16155 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::WebGLTransformFeedback>::value, |
16156 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
16157 | 0 | MOZ_ASSERT(static_cast<mozilla::WebGLTransformFeedback*>(aObject) == |
16158 | 0 | reinterpret_cast<mozilla::WebGLTransformFeedback*>(aObject), |
16159 | 0 | "Multiple inheritance for mozilla::WebGLTransformFeedback is broken."); |
16160 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
16161 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
16162 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
16163 | 0 | "You should probably not be using Wrap() directly; use " |
16164 | 0 | "GetOrCreateDOMReflector instead"); |
16165 | 0 |
|
16166 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
16167 | 0 | "nsISupports must be on our primary inheritance chain"); |
16168 | 0 |
|
16169 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
16170 | 0 | if (!global) { |
16171 | 0 | return false; |
16172 | 0 | } |
16173 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
16174 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
16175 | 0 |
|
16176 | 0 | // That might have ended up wrapping us already, due to the wonders |
16177 | 0 | // of XBL. Check for that, and bail out as needed. |
16178 | 0 | aReflector.set(aCache->GetWrapper()); |
16179 | 0 | if (aReflector) { |
16180 | | #ifdef DEBUG |
16181 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
16182 | | #endif // DEBUG |
16183 | | return true; |
16184 | 0 | } |
16185 | 0 |
|
16186 | 0 | JSAutoRealm ar(aCx, global); |
16187 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
16188 | 0 | if (!canonicalProto) { |
16189 | 0 | return false; |
16190 | 0 | } |
16191 | 0 | JS::Rooted<JSObject*> proto(aCx); |
16192 | 0 | if (aGivenProto) { |
16193 | 0 | proto = aGivenProto; |
16194 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
16195 | 0 | // coming in, we changed compartments to that of "parent" so may need |
16196 | 0 | // to wrap the proto here. |
16197 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
16198 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
16199 | 0 | return false; |
16200 | 0 | } |
16201 | 0 | } |
16202 | 0 | } else { |
16203 | 0 | proto = canonicalProto; |
16204 | 0 | } |
16205 | 0 |
|
16206 | 0 | BindingJSObjectCreator<mozilla::WebGLTransformFeedback> creator(aCx); |
16207 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
16208 | 0 | if (!aReflector) { |
16209 | 0 | return false; |
16210 | 0 | } |
16211 | 0 | |
16212 | 0 | aCache->SetWrapper(aReflector); |
16213 | 0 | creator.InitializationSucceeded(); |
16214 | 0 |
|
16215 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
16216 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
16217 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
16218 | 0 | // otherwise we won't be able to properly recreate it later, since |
16219 | 0 | // we won't know what proto to use. Note that we don't check |
16220 | 0 | // aGivenProto here, since it's entirely possible (and even |
16221 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
16222 | 0 | // same as canonicalProto. |
16223 | 0 | if (proto != canonicalProto) { |
16224 | 0 | PreserveWrapper(aObject); |
16225 | 0 | } |
16226 | 0 |
|
16227 | 0 | return true; |
16228 | 0 | } |
16229 | | |
16230 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
16231 | | nullptr, |
16232 | | nullptr, |
16233 | | nullptr, |
16234 | | { nullptr, nullptr }, |
16235 | | prototypes::id::WebGLTransformFeedback, |
16236 | | constructors::id::WebGLTransformFeedback, |
16237 | | nullptr, |
16238 | | &DefaultXrayExpandoObjectClass |
16239 | | } }; |
16240 | | |
16241 | | void |
16242 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
16243 | 0 | { |
16244 | 0 | JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx)); |
16245 | 0 | if (!parentProto) { |
16246 | 0 | return; |
16247 | 0 | } |
16248 | 0 | |
16249 | 0 | JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx)); |
16250 | 0 | if (!constructorProto) { |
16251 | 0 | return; |
16252 | 0 | } |
16253 | 0 | |
16254 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::WebGLTransformFeedback); |
16255 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::WebGLTransformFeedback); |
16256 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
16257 | 0 | &sPrototypeClass.mBase, protoCache, |
16258 | 0 | nullptr, |
16259 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
16260 | 0 | interfaceCache, |
16261 | 0 | nullptr, |
16262 | 0 | nullptr, |
16263 | 0 | "WebGLTransformFeedback", aDefineOnGlobal, |
16264 | 0 | nullptr, |
16265 | 0 | false); |
16266 | 0 | } |
16267 | | |
16268 | | JSObject* |
16269 | | GetConstructorObject(JSContext* aCx) |
16270 | 0 | { |
16271 | 0 | return GetConstructorObjectHandle(aCx); |
16272 | 0 | } |
16273 | | |
16274 | | } // namespace WebGLTransformFeedback_Binding |
16275 | | |
16276 | | |
16277 | | |
16278 | | } // namespace dom |
16279 | | } // namespace mozilla |