1 | /* |
2 | This file is part of the WebKit open source project. |
3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
4 | |
5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. |
9 | |
10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #include "config.h" |
22 | #include "JSCanvasRenderingContext2D.h" |
23 | |
24 | #include "CallTracer.h" |
25 | #include "JSCanvasDirection.h" |
26 | #include "JSCanvasFillRule.h" |
27 | #include "JSCanvasGradient.h" |
28 | #include "JSCanvasLineCap.h" |
29 | #include "JSCanvasLineJoin.h" |
30 | #include "JSCanvasPattern.h" |
31 | #include "JSCanvasTextAlign.h" |
32 | #include "JSCanvasTextBaseline.h" |
33 | #include "JSDOMAttribute.h" |
34 | #include "JSDOMBinding.h" |
35 | #include "JSDOMConstructorNotConstructable.h" |
36 | #include "JSDOMConvertBoolean.h" |
37 | #include "JSDOMConvertDictionary.h" |
38 | #include "JSDOMConvertEnumeration.h" |
39 | #include "JSDOMConvertInterface.h" |
40 | #include "JSDOMConvertNullable.h" |
41 | #include "JSDOMConvertNumbers.h" |
42 | #include "JSDOMConvertSequences.h" |
43 | #include "JSDOMConvertStrings.h" |
44 | #include "JSDOMConvertUnion.h" |
45 | #include "JSDOMExceptionHandling.h" |
46 | #include "JSDOMGlobalObject.h" |
47 | #include "JSDOMMatrix.h" |
48 | #include "JSDOMMatrix2DInit.h" |
49 | #include "JSDOMOperation.h" |
50 | #include "JSDOMWrapperCache.h" |
51 | #include "JSElement.h" |
52 | #include "JSHTMLCanvasElement.h" |
53 | #include "JSHTMLImageElement.h" |
54 | #include "JSHTMLVideoElement.h" |
55 | #include "JSImageBitmap.h" |
56 | #include "JSImageData.h" |
57 | #include "JSImageSmoothingQuality.h" |
58 | #include "JSPath2D.h" |
59 | #include "JSTextMetrics.h" |
60 | #include "RuntimeEnabledFeatures.h" |
61 | #include "ScriptExecutionContext.h" |
62 | #include <JavaScriptCore/FunctionPrototype.h> |
63 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
64 | #include <JavaScriptCore/JSArray.h> |
65 | #include <JavaScriptCore/JSCInlines.h> |
66 | #include <wtf/GetPtr.h> |
67 | #include <wtf/PointerPreparations.h> |
68 | #include <wtf/URL.h> |
69 | #include <wtf/Variant.h> |
70 | |
71 | |
72 | namespace WebCore { |
73 | using namespace JSC; |
74 | |
75 | // Functions |
76 | |
77 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetAlpha(JSC::ExecState*); |
78 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetCompositeOperation(JSC::ExecState*); |
79 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRect(JSC::ExecState*); |
80 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor(JSC::ExecState*); |
81 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetFillColor(JSC::ExecState*); |
82 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineWidth(JSC::ExecState*); |
83 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineCap(JSC::ExecState*); |
84 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineJoin(JSC::ExecState*); |
85 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetMiterLimit(JSC::ExecState*); |
86 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetShadow(JSC::ExecState*); |
87 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClearShadow(JSC::ExecState*); |
88 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetPath(JSC::ExecState*); |
89 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetPath(JSC::ExecState*); |
90 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawImage(JSC::ExecState*); |
91 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionBeginPath(JSC::ExecState*); |
92 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionFill(JSC::ExecState*); |
93 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStroke(JSC::ExecState*); |
94 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClip(JSC::ExecState*); |
95 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath(JSC::ExecState*); |
96 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionIsPointInStroke(JSC::ExecState*); |
97 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateLinearGradient(JSC::ExecState*); |
98 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateRadialGradient(JSC::ExecState*); |
99 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreatePattern(JSC::ExecState*); |
100 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateImageData(JSC::ExecState*); |
101 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetImageData(JSC::ExecState*); |
102 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionPutImageData(JSC::ExecState*); |
103 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClosePath(JSC::ExecState*); |
104 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionMoveTo(JSC::ExecState*); |
105 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionLineTo(JSC::ExecState*); |
106 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionQuadraticCurveTo(JSC::ExecState*); |
107 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionBezierCurveTo(JSC::ExecState*); |
108 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionArcTo(JSC::ExecState*); |
109 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionRect(JSC::ExecState*); |
110 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionArc(JSC::ExecState*); |
111 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionEllipse(JSC::ExecState*); |
112 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineDash(JSC::ExecState*); |
113 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetLineDash(JSC::ExecState*); |
114 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClearRect(JSC::ExecState*); |
115 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionFillRect(JSC::ExecState*); |
116 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStrokeRect(JSC::ExecState*); |
117 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSave(JSC::ExecState*); |
118 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionRestore(JSC::ExecState*); |
119 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionFillText(JSC::ExecState*); |
120 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStrokeText(JSC::ExecState*); |
121 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionMeasureText(JSC::ExecState*); |
122 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionScale(JSC::ExecState*); |
123 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionRotate(JSC::ExecState*); |
124 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionTranslate(JSC::ExecState*); |
125 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionTransform(JSC::ExecState*); |
126 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetTransform(JSC::ExecState*); |
127 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetTransform(JSC::ExecState*); |
128 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionResetTransform(JSC::ExecState*); |
129 | JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeeded(JSC::ExecState*); |
130 | |
131 | // Attributes |
132 | |
133 | JSC::EncodedJSValue jsCanvasRenderingContext2DConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
134 | bool setJSCanvasRenderingContext2DConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
135 | JSC::EncodedJSValue jsCanvasRenderingContext2DCanvas(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
136 | JSC::EncodedJSValue jsCanvasRenderingContext2DWebkitBackingStorePixelRatio(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
137 | JSC::EncodedJSValue jsCanvasRenderingContext2DWebkitImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
138 | bool setJSCanvasRenderingContext2DWebkitImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
139 | JSC::EncodedJSValue jsCanvasRenderingContext2DWebkitLineDash(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
140 | bool setJSCanvasRenderingContext2DWebkitLineDash(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
141 | JSC::EncodedJSValue jsCanvasRenderingContext2DWebkitLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
142 | bool setJSCanvasRenderingContext2DWebkitLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
143 | JSC::EncodedJSValue jsCanvasRenderingContext2DGlobalAlpha(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
144 | bool setJSCanvasRenderingContext2DGlobalAlpha(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
145 | JSC::EncodedJSValue jsCanvasRenderingContext2DGlobalCompositeOperation(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
146 | bool setJSCanvasRenderingContext2DGlobalCompositeOperation(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
147 | JSC::EncodedJSValue jsCanvasRenderingContext2DStrokeStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
148 | bool setJSCanvasRenderingContext2DStrokeStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
149 | JSC::EncodedJSValue jsCanvasRenderingContext2DFillStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
150 | bool setJSCanvasRenderingContext2DFillStyle(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
151 | JSC::EncodedJSValue jsCanvasRenderingContext2DImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
152 | bool setJSCanvasRenderingContext2DImageSmoothingEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
153 | JSC::EncodedJSValue jsCanvasRenderingContext2DImageSmoothingQuality(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
154 | bool setJSCanvasRenderingContext2DImageSmoothingQuality(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
155 | JSC::EncodedJSValue jsCanvasRenderingContext2DCurrentX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
156 | JSC::EncodedJSValue jsCanvasRenderingContext2DCurrentY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
157 | JSC::EncodedJSValue jsCanvasRenderingContext2DLineWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
158 | bool setJSCanvasRenderingContext2DLineWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
159 | JSC::EncodedJSValue jsCanvasRenderingContext2DLineCap(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
160 | bool setJSCanvasRenderingContext2DLineCap(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
161 | JSC::EncodedJSValue jsCanvasRenderingContext2DLineJoin(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
162 | bool setJSCanvasRenderingContext2DLineJoin(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
163 | JSC::EncodedJSValue jsCanvasRenderingContext2DMiterLimit(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
164 | bool setJSCanvasRenderingContext2DMiterLimit(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
165 | JSC::EncodedJSValue jsCanvasRenderingContext2DLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
166 | bool setJSCanvasRenderingContext2DLineDashOffset(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
167 | JSC::EncodedJSValue jsCanvasRenderingContext2DShadowOffsetX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
168 | bool setJSCanvasRenderingContext2DShadowOffsetX(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
169 | JSC::EncodedJSValue jsCanvasRenderingContext2DShadowOffsetY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
170 | bool setJSCanvasRenderingContext2DShadowOffsetY(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
171 | JSC::EncodedJSValue jsCanvasRenderingContext2DShadowBlur(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
172 | bool setJSCanvasRenderingContext2DShadowBlur(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
173 | JSC::EncodedJSValue jsCanvasRenderingContext2DShadowColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
174 | bool setJSCanvasRenderingContext2DShadowColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
175 | JSC::EncodedJSValue jsCanvasRenderingContext2DFont(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
176 | bool setJSCanvasRenderingContext2DFont(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
177 | JSC::EncodedJSValue jsCanvasRenderingContext2DTextAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
178 | bool setJSCanvasRenderingContext2DTextAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
179 | JSC::EncodedJSValue jsCanvasRenderingContext2DTextBaseline(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
180 | bool setJSCanvasRenderingContext2DTextBaseline(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
181 | JSC::EncodedJSValue jsCanvasRenderingContext2DDirection(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
182 | bool setJSCanvasRenderingContext2DDirection(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
183 | |
184 | class JSCanvasRenderingContext2DPrototype : public JSC::JSNonFinalObject { |
185 | public: |
186 | using Base = JSC::JSNonFinalObject; |
187 | static JSCanvasRenderingContext2DPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
188 | { |
189 | JSCanvasRenderingContext2DPrototype* ptr = new (NotNull, JSC::allocateCell<JSCanvasRenderingContext2DPrototype>(vm.heap)) JSCanvasRenderingContext2DPrototype(vm, globalObject, structure); |
190 | ptr->finishCreation(vm); |
191 | return ptr; |
192 | } |
193 | |
194 | DECLARE_INFO; |
195 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
196 | { |
197 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
198 | } |
199 | |
200 | private: |
201 | JSCanvasRenderingContext2DPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
202 | : JSC::JSNonFinalObject(vm, structure) |
203 | { |
204 | } |
205 | |
206 | void finishCreation(JSC::VM&); |
207 | }; |
208 | |
209 | using JSCanvasRenderingContext2DConstructor = JSDOMConstructorNotConstructable<JSCanvasRenderingContext2D>; |
210 | |
211 | template<> JSValue JSCanvasRenderingContext2DConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
212 | { |
213 | UNUSED_PARAM(vm); |
214 | return globalObject.functionPrototype(); |
215 | } |
216 | |
217 | template<> void JSCanvasRenderingContext2DConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
218 | { |
219 | putDirect(vm, vm.propertyNames->prototype, JSCanvasRenderingContext2D::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
220 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("CanvasRenderingContext2D"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
221 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
222 | } |
223 | |
224 | template<> const ClassInfo JSCanvasRenderingContext2DConstructor::s_info = { "CanvasRenderingContext2D" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCanvasRenderingContext2DConstructor) }; |
225 | |
226 | /* Hash table for prototype */ |
227 | |
228 | static const HashTableValue JSCanvasRenderingContext2DPrototypeTableValues[] = |
229 | { |
230 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DConstructor) } }, |
231 | { "canvas" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DCanvas), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
232 | { "webkitBackingStorePixelRatio" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DWebkitBackingStorePixelRatio), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
233 | { "webkitImageSmoothingEnabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DWebkitImageSmoothingEnabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DWebkitImageSmoothingEnabled) } }, |
234 | { "webkitLineDash" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DWebkitLineDash), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DWebkitLineDash) } }, |
235 | { "webkitLineDashOffset" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DWebkitLineDashOffset), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DWebkitLineDashOffset) } }, |
236 | { "globalAlpha" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DGlobalAlpha), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DGlobalAlpha) } }, |
237 | { "globalCompositeOperation" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DGlobalCompositeOperation), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DGlobalCompositeOperation) } }, |
238 | { "strokeStyle" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DStrokeStyle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DStrokeStyle) } }, |
239 | { "fillStyle" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DFillStyle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DFillStyle) } }, |
240 | { "imageSmoothingEnabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DImageSmoothingEnabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DImageSmoothingEnabled) } }, |
241 | { "imageSmoothingQuality" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DImageSmoothingQuality), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DImageSmoothingQuality) } }, |
242 | { "currentX" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DCurrentX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
243 | { "currentY" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DCurrentY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
244 | { "lineWidth" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DLineWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DLineWidth) } }, |
245 | { "lineCap" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DLineCap), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DLineCap) } }, |
246 | { "lineJoin" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DLineJoin), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DLineJoin) } }, |
247 | { "miterLimit" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DMiterLimit), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DMiterLimit) } }, |
248 | { "lineDashOffset" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DLineDashOffset), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DLineDashOffset) } }, |
249 | { "shadowOffsetX" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DShadowOffsetX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DShadowOffsetX) } }, |
250 | { "shadowOffsetY" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DShadowOffsetY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DShadowOffsetY) } }, |
251 | { "shadowBlur" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DShadowBlur), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DShadowBlur) } }, |
252 | { "shadowColor" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DShadowColor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DShadowColor) } }, |
253 | { "font" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DFont), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DFont) } }, |
254 | { "textAlign" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DTextAlign), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DTextAlign) } }, |
255 | { "textBaseline" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DTextBaseline), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DTextBaseline) } }, |
256 | { "direction" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCanvasRenderingContext2DDirection), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCanvasRenderingContext2DDirection) } }, |
257 | { "setAlpha" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetAlpha), (intptr_t) (0) } }, |
258 | { "setCompositeOperation" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetCompositeOperation), (intptr_t) (0) } }, |
259 | { "drawImageFromRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRect), (intptr_t) (1) } }, |
260 | { "setStrokeColor" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor), (intptr_t) (1) } }, |
261 | { "setFillColor" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetFillColor), (intptr_t) (1) } }, |
262 | { "setLineWidth" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetLineWidth), (intptr_t) (0) } }, |
263 | { "setLineCap" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetLineCap), (intptr_t) (0) } }, |
264 | { "setLineJoin" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetLineJoin), (intptr_t) (0) } }, |
265 | { "setMiterLimit" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetMiterLimit), (intptr_t) (0) } }, |
266 | { "setShadow" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetShadow), (intptr_t) (3) } }, |
267 | { "clearShadow" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionClearShadow), (intptr_t) (0) } }, |
268 | { "setPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetPath), (intptr_t) (1) } }, |
269 | { "getPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionGetPath), (intptr_t) (0) } }, |
270 | { "drawImage" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionDrawImage), (intptr_t) (3) } }, |
271 | { "beginPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionBeginPath), (intptr_t) (0) } }, |
272 | { "fill" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionFill), (intptr_t) (0) } }, |
273 | { "stroke" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionStroke), (intptr_t) (0) } }, |
274 | { "clip" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionClip), (intptr_t) (0) } }, |
275 | { "isPointInPath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath), (intptr_t) (2) } }, |
276 | { "isPointInStroke" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionIsPointInStroke), (intptr_t) (2) } }, |
277 | { "createLinearGradient" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionCreateLinearGradient), (intptr_t) (4) } }, |
278 | { "createRadialGradient" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionCreateRadialGradient), (intptr_t) (6) } }, |
279 | { "createPattern" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionCreatePattern), (intptr_t) (2) } }, |
280 | { "createImageData" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionCreateImageData), (intptr_t) (1) } }, |
281 | { "getImageData" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionGetImageData), (intptr_t) (4) } }, |
282 | { "putImageData" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionPutImageData), (intptr_t) (3) } }, |
283 | { "closePath" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionClosePath), (intptr_t) (0) } }, |
284 | { "moveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionMoveTo), (intptr_t) (2) } }, |
285 | { "lineTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionLineTo), (intptr_t) (2) } }, |
286 | { "quadraticCurveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionQuadraticCurveTo), (intptr_t) (4) } }, |
287 | { "bezierCurveTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionBezierCurveTo), (intptr_t) (6) } }, |
288 | { "arcTo" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionArcTo), (intptr_t) (5) } }, |
289 | { "rect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionRect), (intptr_t) (4) } }, |
290 | { "arc" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionArc), (intptr_t) (5) } }, |
291 | { "ellipse" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionEllipse), (intptr_t) (7) } }, |
292 | { "setLineDash" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetLineDash), (intptr_t) (1) } }, |
293 | { "getLineDash" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionGetLineDash), (intptr_t) (0) } }, |
294 | { "clearRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionClearRect), (intptr_t) (4) } }, |
295 | { "fillRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionFillRect), (intptr_t) (4) } }, |
296 | { "strokeRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionStrokeRect), (intptr_t) (4) } }, |
297 | { "save" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSave), (intptr_t) (0) } }, |
298 | { "restore" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionRestore), (intptr_t) (0) } }, |
299 | { "fillText" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionFillText), (intptr_t) (3) } }, |
300 | { "strokeText" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionStrokeText), (intptr_t) (3) } }, |
301 | { "measureText" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionMeasureText), (intptr_t) (1) } }, |
302 | { "scale" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionScale), (intptr_t) (2) } }, |
303 | { "rotate" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionRotate), (intptr_t) (1) } }, |
304 | { "translate" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionTranslate), (intptr_t) (2) } }, |
305 | { "transform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionTransform), (intptr_t) (6) } }, |
306 | { "getTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionGetTransform), (intptr_t) (0) } }, |
307 | { "setTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetTransform), (intptr_t) (0) } }, |
308 | { "resetTransform" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionResetTransform), (intptr_t) (0) } }, |
309 | { "drawFocusIfNeeded" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeeded), (intptr_t) (1) } }, |
310 | }; |
311 | |
312 | const ClassInfo JSCanvasRenderingContext2DPrototype::s_info = { "CanvasRenderingContext2DPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCanvasRenderingContext2DPrototype) }; |
313 | |
314 | void JSCanvasRenderingContext2DPrototype::finishCreation(VM& vm) |
315 | { |
316 | Base::finishCreation(vm); |
317 | reifyStaticProperties(vm, JSCanvasRenderingContext2D::info(), JSCanvasRenderingContext2DPrototypeTableValues, *this); |
318 | bool hasDisabledRuntimeProperties = false; |
319 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
320 | hasDisabledRuntimeProperties = true; |
321 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("setPath" ), strlen("setPath" )); |
322 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
323 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
324 | } |
325 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
326 | hasDisabledRuntimeProperties = true; |
327 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("getPath" ), strlen("getPath" )); |
328 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
329 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
330 | } |
331 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
332 | hasDisabledRuntimeProperties = true; |
333 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("currentX" ), strlen("currentX" )); |
334 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
335 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
336 | } |
337 | if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { |
338 | hasDisabledRuntimeProperties = true; |
339 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("currentY" ), strlen("currentY" )); |
340 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
341 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
342 | } |
343 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
344 | flattenDictionaryObject(vm); |
345 | } |
346 | |
347 | const ClassInfo JSCanvasRenderingContext2D::s_info = { "CanvasRenderingContext2D" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCanvasRenderingContext2D) }; |
348 | |
349 | JSCanvasRenderingContext2D::JSCanvasRenderingContext2D(Structure* structure, JSDOMGlobalObject& globalObject, Ref<CanvasRenderingContext2D>&& impl) |
350 | : JSDOMWrapper<CanvasRenderingContext2D>(structure, globalObject, WTFMove(impl)) |
351 | { |
352 | } |
353 | |
354 | void JSCanvasRenderingContext2D::finishCreation(VM& vm) |
355 | { |
356 | Base::finishCreation(vm); |
357 | ASSERT(inherits(vm, info())); |
358 | |
359 | } |
360 | |
361 | JSObject* JSCanvasRenderingContext2D::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
362 | { |
363 | return JSCanvasRenderingContext2DPrototype::create(vm, &globalObject, JSCanvasRenderingContext2DPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
364 | } |
365 | |
366 | JSObject* JSCanvasRenderingContext2D::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
367 | { |
368 | return getDOMPrototype<JSCanvasRenderingContext2D>(vm, globalObject); |
369 | } |
370 | |
371 | JSValue JSCanvasRenderingContext2D::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
372 | { |
373 | return getDOMConstructor<JSCanvasRenderingContext2DConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
374 | } |
375 | |
376 | void JSCanvasRenderingContext2D::destroy(JSC::JSCell* cell) |
377 | { |
378 | JSCanvasRenderingContext2D* thisObject = static_cast<JSCanvasRenderingContext2D*>(cell); |
379 | thisObject->JSCanvasRenderingContext2D::~JSCanvasRenderingContext2D(); |
380 | } |
381 | |
382 | template<> inline JSCanvasRenderingContext2D* IDLAttribute<JSCanvasRenderingContext2D>::cast(ExecState& state, EncodedJSValue thisValue) |
383 | { |
384 | return jsDynamicCast<JSCanvasRenderingContext2D*>(state.vm(), JSValue::decode(thisValue)); |
385 | } |
386 | |
387 | template<> inline JSCanvasRenderingContext2D* IDLOperation<JSCanvasRenderingContext2D>::cast(ExecState& state) |
388 | { |
389 | return jsDynamicCast<JSCanvasRenderingContext2D*>(state.vm(), state.thisValue()); |
390 | } |
391 | |
392 | EncodedJSValue jsCanvasRenderingContext2DConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
393 | { |
394 | VM& vm = state->vm(); |
395 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
396 | auto* prototype = jsDynamicCast<JSCanvasRenderingContext2DPrototype*>(vm, JSValue::decode(thisValue)); |
397 | if (UNLIKELY(!prototype)) |
398 | return throwVMTypeError(state, throwScope); |
399 | return JSValue::encode(JSCanvasRenderingContext2D::getConstructor(state->vm(), prototype->globalObject())); |
400 | } |
401 | |
402 | bool setJSCanvasRenderingContext2DConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
403 | { |
404 | VM& vm = state->vm(); |
405 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
406 | auto* prototype = jsDynamicCast<JSCanvasRenderingContext2DPrototype*>(vm, JSValue::decode(thisValue)); |
407 | if (UNLIKELY(!prototype)) { |
408 | throwVMTypeError(state, throwScope); |
409 | return false; |
410 | } |
411 | // Shadowing a built-in constructor |
412 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
413 | } |
414 | |
415 | static inline JSValue jsCanvasRenderingContext2DCanvasGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
416 | { |
417 | UNUSED_PARAM(throwScope); |
418 | UNUSED_PARAM(state); |
419 | auto& impl = thisObject.wrapped(); |
420 | JSValue result = toJS<IDLInterface<HTMLCanvasElement>>(state, *thisObject.globalObject(), throwScope, impl.canvas()); |
421 | return result; |
422 | } |
423 | |
424 | EncodedJSValue jsCanvasRenderingContext2DCanvas(ExecState* state, EncodedJSValue thisValue, PropertyName) |
425 | { |
426 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DCanvasGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "canvas" ); |
427 | } |
428 | |
429 | static inline JSValue jsCanvasRenderingContext2DWebkitBackingStorePixelRatioGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
430 | { |
431 | UNUSED_PARAM(throwScope); |
432 | UNUSED_PARAM(state); |
433 | auto& impl = thisObject.wrapped(); |
434 | JSValue result = toJS<IDLFloat>(state, throwScope, impl.webkitBackingStorePixelRatio()); |
435 | return result; |
436 | } |
437 | |
438 | EncodedJSValue jsCanvasRenderingContext2DWebkitBackingStorePixelRatio(ExecState* state, EncodedJSValue thisValue, PropertyName) |
439 | { |
440 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DWebkitBackingStorePixelRatioGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitBackingStorePixelRatio" ); |
441 | } |
442 | |
443 | static inline JSValue jsCanvasRenderingContext2DWebkitImageSmoothingEnabledGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
444 | { |
445 | UNUSED_PARAM(throwScope); |
446 | UNUSED_PARAM(state); |
447 | auto& impl = thisObject.wrapped(); |
448 | if (UNLIKELY(impl.callTracingActive())) |
449 | CallTracer::recordCanvasAction(impl, "webkitImageSmoothingEnabled"_s ); |
450 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.imageSmoothingEnabled()); |
451 | return result; |
452 | } |
453 | |
454 | EncodedJSValue jsCanvasRenderingContext2DWebkitImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
455 | { |
456 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DWebkitImageSmoothingEnabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitImageSmoothingEnabled" ); |
457 | } |
458 | |
459 | static inline bool setJSCanvasRenderingContext2DWebkitImageSmoothingEnabledSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
460 | { |
461 | UNUSED_PARAM(throwScope); |
462 | auto& impl = thisObject.wrapped(); |
463 | auto nativeValue = convert<IDLBoolean>(state, value); |
464 | RETURN_IF_EXCEPTION(throwScope, false); |
465 | if (UNLIKELY(impl.callTracingActive())) { |
466 | Vector<RecordCanvasActionVariant> callTracerParameters; |
467 | callTracerParameters.append(nativeValue); |
468 | CallTracer::recordCanvasAction(impl, "webkitImageSmoothingEnabled"_s , WTFMove(callTracerParameters)); |
469 | } |
470 | AttributeSetter::call(state, throwScope, [&] { |
471 | return impl.setImageSmoothingEnabled(WTFMove(nativeValue)); |
472 | }); |
473 | return true; |
474 | } |
475 | |
476 | bool setJSCanvasRenderingContext2DWebkitImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
477 | { |
478 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DWebkitImageSmoothingEnabledSetter>(*state, thisValue, encodedValue, "webkitImageSmoothingEnabled" ); |
479 | } |
480 | |
481 | static inline JSValue jsCanvasRenderingContext2DWebkitLineDashGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
482 | { |
483 | UNUSED_PARAM(throwScope); |
484 | UNUSED_PARAM(state); |
485 | auto& impl = thisObject.wrapped(); |
486 | if (UNLIKELY(impl.callTracingActive())) |
487 | CallTracer::recordCanvasAction(impl, "webkitLineDash"_s ); |
488 | JSValue result = toJS<IDLSequence<IDLUnrestrictedFloat>>(state, *thisObject.globalObject(), throwScope, impl.webkitLineDash()); |
489 | return result; |
490 | } |
491 | |
492 | EncodedJSValue jsCanvasRenderingContext2DWebkitLineDash(ExecState* state, EncodedJSValue thisValue, PropertyName) |
493 | { |
494 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DWebkitLineDashGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitLineDash" ); |
495 | } |
496 | |
497 | static inline bool setJSCanvasRenderingContext2DWebkitLineDashSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
498 | { |
499 | UNUSED_PARAM(throwScope); |
500 | auto& impl = thisObject.wrapped(); |
501 | auto nativeValue = convert<IDLSequence<IDLUnrestrictedFloat>>(state, value); |
502 | RETURN_IF_EXCEPTION(throwScope, false); |
503 | if (UNLIKELY(impl.callTracingActive())) { |
504 | Vector<RecordCanvasActionVariant> callTracerParameters; |
505 | callTracerParameters.append(nativeValue); |
506 | CallTracer::recordCanvasAction(impl, "webkitLineDash"_s , WTFMove(callTracerParameters)); |
507 | } |
508 | AttributeSetter::call(state, throwScope, [&] { |
509 | return impl.setWebkitLineDash(WTFMove(nativeValue)); |
510 | }); |
511 | return true; |
512 | } |
513 | |
514 | bool setJSCanvasRenderingContext2DWebkitLineDash(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
515 | { |
516 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DWebkitLineDashSetter>(*state, thisValue, encodedValue, "webkitLineDash" ); |
517 | } |
518 | |
519 | static inline JSValue jsCanvasRenderingContext2DWebkitLineDashOffsetGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
520 | { |
521 | UNUSED_PARAM(throwScope); |
522 | UNUSED_PARAM(state); |
523 | auto& impl = thisObject.wrapped(); |
524 | if (UNLIKELY(impl.callTracingActive())) |
525 | CallTracer::recordCanvasAction(impl, "webkitLineDashOffset"_s ); |
526 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.lineDashOffset()); |
527 | return result; |
528 | } |
529 | |
530 | EncodedJSValue jsCanvasRenderingContext2DWebkitLineDashOffset(ExecState* state, EncodedJSValue thisValue, PropertyName) |
531 | { |
532 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DWebkitLineDashOffsetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitLineDashOffset" ); |
533 | } |
534 | |
535 | static inline bool setJSCanvasRenderingContext2DWebkitLineDashOffsetSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
536 | { |
537 | UNUSED_PARAM(throwScope); |
538 | auto& impl = thisObject.wrapped(); |
539 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
540 | RETURN_IF_EXCEPTION(throwScope, false); |
541 | if (UNLIKELY(impl.callTracingActive())) { |
542 | Vector<RecordCanvasActionVariant> callTracerParameters; |
543 | callTracerParameters.append(nativeValue); |
544 | CallTracer::recordCanvasAction(impl, "webkitLineDashOffset"_s , WTFMove(callTracerParameters)); |
545 | } |
546 | AttributeSetter::call(state, throwScope, [&] { |
547 | return impl.setLineDashOffset(WTFMove(nativeValue)); |
548 | }); |
549 | return true; |
550 | } |
551 | |
552 | bool setJSCanvasRenderingContext2DWebkitLineDashOffset(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
553 | { |
554 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DWebkitLineDashOffsetSetter>(*state, thisValue, encodedValue, "webkitLineDashOffset" ); |
555 | } |
556 | |
557 | static inline JSValue jsCanvasRenderingContext2DGlobalAlphaGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
558 | { |
559 | UNUSED_PARAM(throwScope); |
560 | UNUSED_PARAM(state); |
561 | auto& impl = thisObject.wrapped(); |
562 | if (UNLIKELY(impl.callTracingActive())) |
563 | CallTracer::recordCanvasAction(impl, "globalAlpha"_s ); |
564 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.globalAlpha()); |
565 | return result; |
566 | } |
567 | |
568 | EncodedJSValue jsCanvasRenderingContext2DGlobalAlpha(ExecState* state, EncodedJSValue thisValue, PropertyName) |
569 | { |
570 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DGlobalAlphaGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "globalAlpha" ); |
571 | } |
572 | |
573 | static inline bool setJSCanvasRenderingContext2DGlobalAlphaSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
574 | { |
575 | UNUSED_PARAM(throwScope); |
576 | auto& impl = thisObject.wrapped(); |
577 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
578 | RETURN_IF_EXCEPTION(throwScope, false); |
579 | if (UNLIKELY(impl.callTracingActive())) { |
580 | Vector<RecordCanvasActionVariant> callTracerParameters; |
581 | callTracerParameters.append(nativeValue); |
582 | CallTracer::recordCanvasAction(impl, "globalAlpha"_s , WTFMove(callTracerParameters)); |
583 | } |
584 | AttributeSetter::call(state, throwScope, [&] { |
585 | return impl.setGlobalAlpha(WTFMove(nativeValue)); |
586 | }); |
587 | return true; |
588 | } |
589 | |
590 | bool setJSCanvasRenderingContext2DGlobalAlpha(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
591 | { |
592 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DGlobalAlphaSetter>(*state, thisValue, encodedValue, "globalAlpha" ); |
593 | } |
594 | |
595 | static inline JSValue jsCanvasRenderingContext2DGlobalCompositeOperationGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
596 | { |
597 | UNUSED_PARAM(throwScope); |
598 | UNUSED_PARAM(state); |
599 | auto& impl = thisObject.wrapped(); |
600 | if (UNLIKELY(impl.callTracingActive())) |
601 | CallTracer::recordCanvasAction(impl, "globalCompositeOperation"_s ); |
602 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.globalCompositeOperation()); |
603 | return result; |
604 | } |
605 | |
606 | EncodedJSValue jsCanvasRenderingContext2DGlobalCompositeOperation(ExecState* state, EncodedJSValue thisValue, PropertyName) |
607 | { |
608 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DGlobalCompositeOperationGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "globalCompositeOperation" ); |
609 | } |
610 | |
611 | static inline bool setJSCanvasRenderingContext2DGlobalCompositeOperationSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
612 | { |
613 | UNUSED_PARAM(throwScope); |
614 | auto& impl = thisObject.wrapped(); |
615 | auto nativeValue = convert<IDLDOMString>(state, value); |
616 | RETURN_IF_EXCEPTION(throwScope, false); |
617 | if (UNLIKELY(impl.callTracingActive())) { |
618 | Vector<RecordCanvasActionVariant> callTracerParameters; |
619 | callTracerParameters.append(nativeValue); |
620 | CallTracer::recordCanvasAction(impl, "globalCompositeOperation"_s , WTFMove(callTracerParameters)); |
621 | } |
622 | AttributeSetter::call(state, throwScope, [&] { |
623 | return impl.setGlobalCompositeOperation(WTFMove(nativeValue)); |
624 | }); |
625 | return true; |
626 | } |
627 | |
628 | bool setJSCanvasRenderingContext2DGlobalCompositeOperation(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
629 | { |
630 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DGlobalCompositeOperationSetter>(*state, thisValue, encodedValue, "globalCompositeOperation" ); |
631 | } |
632 | |
633 | static inline JSValue jsCanvasRenderingContext2DStrokeStyleGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
634 | { |
635 | UNUSED_PARAM(throwScope); |
636 | UNUSED_PARAM(state); |
637 | auto& impl = thisObject.wrapped(); |
638 | if (UNLIKELY(impl.callTracingActive())) |
639 | CallTracer::recordCanvasAction(impl, "strokeStyle"_s ); |
640 | JSValue result = toJS<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, *thisObject.globalObject(), throwScope, impl.strokeStyle()); |
641 | return result; |
642 | } |
643 | |
644 | EncodedJSValue jsCanvasRenderingContext2DStrokeStyle(ExecState* state, EncodedJSValue thisValue, PropertyName) |
645 | { |
646 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DStrokeStyleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "strokeStyle" ); |
647 | } |
648 | |
649 | static inline bool setJSCanvasRenderingContext2DStrokeStyleSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
650 | { |
651 | UNUSED_PARAM(throwScope); |
652 | auto& impl = thisObject.wrapped(); |
653 | auto nativeValue = convert<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, value); |
654 | RETURN_IF_EXCEPTION(throwScope, false); |
655 | if (UNLIKELY(impl.callTracingActive())) { |
656 | Vector<RecordCanvasActionVariant> callTracerParameters; |
657 | WTF::visit([&] (auto& value) { callTracerParameters.append(value); }, nativeValue); |
658 | CallTracer::recordCanvasAction(impl, "strokeStyle"_s , WTFMove(callTracerParameters)); |
659 | } |
660 | AttributeSetter::call(state, throwScope, [&] { |
661 | return impl.setStrokeStyle(WTFMove(nativeValue)); |
662 | }); |
663 | return true; |
664 | } |
665 | |
666 | bool setJSCanvasRenderingContext2DStrokeStyle(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
667 | { |
668 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DStrokeStyleSetter>(*state, thisValue, encodedValue, "strokeStyle" ); |
669 | } |
670 | |
671 | static inline JSValue jsCanvasRenderingContext2DFillStyleGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
672 | { |
673 | UNUSED_PARAM(throwScope); |
674 | UNUSED_PARAM(state); |
675 | auto& impl = thisObject.wrapped(); |
676 | if (UNLIKELY(impl.callTracingActive())) |
677 | CallTracer::recordCanvasAction(impl, "fillStyle"_s ); |
678 | JSValue result = toJS<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, *thisObject.globalObject(), throwScope, impl.fillStyle()); |
679 | return result; |
680 | } |
681 | |
682 | EncodedJSValue jsCanvasRenderingContext2DFillStyle(ExecState* state, EncodedJSValue thisValue, PropertyName) |
683 | { |
684 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DFillStyleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "fillStyle" ); |
685 | } |
686 | |
687 | static inline bool setJSCanvasRenderingContext2DFillStyleSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
688 | { |
689 | UNUSED_PARAM(throwScope); |
690 | auto& impl = thisObject.wrapped(); |
691 | auto nativeValue = convert<IDLUnion<IDLDOMString, IDLInterface<CanvasGradient>, IDLInterface<CanvasPattern>>>(state, value); |
692 | RETURN_IF_EXCEPTION(throwScope, false); |
693 | if (UNLIKELY(impl.callTracingActive())) { |
694 | Vector<RecordCanvasActionVariant> callTracerParameters; |
695 | WTF::visit([&] (auto& value) { callTracerParameters.append(value); }, nativeValue); |
696 | CallTracer::recordCanvasAction(impl, "fillStyle"_s , WTFMove(callTracerParameters)); |
697 | } |
698 | AttributeSetter::call(state, throwScope, [&] { |
699 | return impl.setFillStyle(WTFMove(nativeValue)); |
700 | }); |
701 | return true; |
702 | } |
703 | |
704 | bool setJSCanvasRenderingContext2DFillStyle(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
705 | { |
706 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DFillStyleSetter>(*state, thisValue, encodedValue, "fillStyle" ); |
707 | } |
708 | |
709 | static inline JSValue jsCanvasRenderingContext2DImageSmoothingEnabledGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
710 | { |
711 | UNUSED_PARAM(throwScope); |
712 | UNUSED_PARAM(state); |
713 | auto& impl = thisObject.wrapped(); |
714 | if (UNLIKELY(impl.callTracingActive())) |
715 | CallTracer::recordCanvasAction(impl, "imageSmoothingEnabled"_s ); |
716 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.imageSmoothingEnabled()); |
717 | return result; |
718 | } |
719 | |
720 | EncodedJSValue jsCanvasRenderingContext2DImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
721 | { |
722 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DImageSmoothingEnabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSmoothingEnabled" ); |
723 | } |
724 | |
725 | static inline bool setJSCanvasRenderingContext2DImageSmoothingEnabledSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
726 | { |
727 | UNUSED_PARAM(throwScope); |
728 | auto& impl = thisObject.wrapped(); |
729 | auto nativeValue = convert<IDLBoolean>(state, value); |
730 | RETURN_IF_EXCEPTION(throwScope, false); |
731 | if (UNLIKELY(impl.callTracingActive())) { |
732 | Vector<RecordCanvasActionVariant> callTracerParameters; |
733 | callTracerParameters.append(nativeValue); |
734 | CallTracer::recordCanvasAction(impl, "imageSmoothingEnabled"_s , WTFMove(callTracerParameters)); |
735 | } |
736 | AttributeSetter::call(state, throwScope, [&] { |
737 | return impl.setImageSmoothingEnabled(WTFMove(nativeValue)); |
738 | }); |
739 | return true; |
740 | } |
741 | |
742 | bool setJSCanvasRenderingContext2DImageSmoothingEnabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
743 | { |
744 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DImageSmoothingEnabledSetter>(*state, thisValue, encodedValue, "imageSmoothingEnabled" ); |
745 | } |
746 | |
747 | static inline JSValue jsCanvasRenderingContext2DImageSmoothingQualityGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
748 | { |
749 | UNUSED_PARAM(throwScope); |
750 | UNUSED_PARAM(state); |
751 | auto& impl = thisObject.wrapped(); |
752 | if (UNLIKELY(impl.callTracingActive())) |
753 | CallTracer::recordCanvasAction(impl, "imageSmoothingQuality"_s ); |
754 | JSValue result = toJS<IDLEnumeration<ImageSmoothingQuality>>(state, throwScope, impl.imageSmoothingQuality()); |
755 | return result; |
756 | } |
757 | |
758 | EncodedJSValue jsCanvasRenderingContext2DImageSmoothingQuality(ExecState* state, EncodedJSValue thisValue, PropertyName) |
759 | { |
760 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DImageSmoothingQualityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSmoothingQuality" ); |
761 | } |
762 | |
763 | static inline bool setJSCanvasRenderingContext2DImageSmoothingQualitySetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
764 | { |
765 | UNUSED_PARAM(throwScope); |
766 | auto& impl = thisObject.wrapped(); |
767 | auto optionalNativeValue = parseEnumeration<ImageSmoothingQuality>(state, value); |
768 | RETURN_IF_EXCEPTION(throwScope, false); |
769 | if (UNLIKELY(!optionalNativeValue)) |
770 | return false; |
771 | auto nativeValue = optionalNativeValue.value(); |
772 | if (UNLIKELY(impl.callTracingActive())) { |
773 | Vector<RecordCanvasActionVariant> callTracerParameters; |
774 | callTracerParameters.append(nativeValue); |
775 | CallTracer::recordCanvasAction(impl, "imageSmoothingQuality"_s , WTFMove(callTracerParameters)); |
776 | } |
777 | AttributeSetter::call(state, throwScope, [&] { |
778 | return impl.setImageSmoothingQuality(WTFMove(nativeValue)); |
779 | }); |
780 | return true; |
781 | } |
782 | |
783 | bool setJSCanvasRenderingContext2DImageSmoothingQuality(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
784 | { |
785 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DImageSmoothingQualitySetter>(*state, thisValue, encodedValue, "imageSmoothingQuality" ); |
786 | } |
787 | |
788 | static inline JSValue jsCanvasRenderingContext2DCurrentXGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
789 | { |
790 | UNUSED_PARAM(throwScope); |
791 | UNUSED_PARAM(state); |
792 | auto& impl = thisObject.wrapped(); |
793 | JSValue result = toJS<IDLFloat>(state, throwScope, impl.currentX()); |
794 | return result; |
795 | } |
796 | |
797 | EncodedJSValue jsCanvasRenderingContext2DCurrentX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
798 | { |
799 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DCurrentXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentX" ); |
800 | } |
801 | |
802 | static inline JSValue jsCanvasRenderingContext2DCurrentYGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
803 | { |
804 | UNUSED_PARAM(throwScope); |
805 | UNUSED_PARAM(state); |
806 | auto& impl = thisObject.wrapped(); |
807 | JSValue result = toJS<IDLFloat>(state, throwScope, impl.currentY()); |
808 | return result; |
809 | } |
810 | |
811 | EncodedJSValue jsCanvasRenderingContext2DCurrentY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
812 | { |
813 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DCurrentYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentY" ); |
814 | } |
815 | |
816 | static inline JSValue jsCanvasRenderingContext2DLineWidthGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
817 | { |
818 | UNUSED_PARAM(throwScope); |
819 | UNUSED_PARAM(state); |
820 | auto& impl = thisObject.wrapped(); |
821 | if (UNLIKELY(impl.callTracingActive())) |
822 | CallTracer::recordCanvasAction(impl, "lineWidth"_s ); |
823 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.lineWidth()); |
824 | return result; |
825 | } |
826 | |
827 | EncodedJSValue jsCanvasRenderingContext2DLineWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
828 | { |
829 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DLineWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineWidth" ); |
830 | } |
831 | |
832 | static inline bool setJSCanvasRenderingContext2DLineWidthSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
833 | { |
834 | UNUSED_PARAM(throwScope); |
835 | auto& impl = thisObject.wrapped(); |
836 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
837 | RETURN_IF_EXCEPTION(throwScope, false); |
838 | if (UNLIKELY(impl.callTracingActive())) { |
839 | Vector<RecordCanvasActionVariant> callTracerParameters; |
840 | callTracerParameters.append(nativeValue); |
841 | CallTracer::recordCanvasAction(impl, "lineWidth"_s , WTFMove(callTracerParameters)); |
842 | } |
843 | AttributeSetter::call(state, throwScope, [&] { |
844 | return impl.setLineWidth(WTFMove(nativeValue)); |
845 | }); |
846 | return true; |
847 | } |
848 | |
849 | bool setJSCanvasRenderingContext2DLineWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
850 | { |
851 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DLineWidthSetter>(*state, thisValue, encodedValue, "lineWidth" ); |
852 | } |
853 | |
854 | static inline JSValue jsCanvasRenderingContext2DLineCapGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
855 | { |
856 | UNUSED_PARAM(throwScope); |
857 | UNUSED_PARAM(state); |
858 | auto& impl = thisObject.wrapped(); |
859 | if (UNLIKELY(impl.callTracingActive())) |
860 | CallTracer::recordCanvasAction(impl, "lineCap"_s ); |
861 | JSValue result = toJS<IDLEnumeration<CanvasLineCap>>(state, throwScope, impl.lineCap()); |
862 | return result; |
863 | } |
864 | |
865 | EncodedJSValue jsCanvasRenderingContext2DLineCap(ExecState* state, EncodedJSValue thisValue, PropertyName) |
866 | { |
867 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DLineCapGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineCap" ); |
868 | } |
869 | |
870 | static inline bool setJSCanvasRenderingContext2DLineCapSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
871 | { |
872 | UNUSED_PARAM(throwScope); |
873 | auto& impl = thisObject.wrapped(); |
874 | auto optionalNativeValue = parseEnumeration<CanvasLineCap>(state, value); |
875 | RETURN_IF_EXCEPTION(throwScope, false); |
876 | if (UNLIKELY(!optionalNativeValue)) |
877 | return false; |
878 | auto nativeValue = optionalNativeValue.value(); |
879 | if (UNLIKELY(impl.callTracingActive())) { |
880 | Vector<RecordCanvasActionVariant> callTracerParameters; |
881 | callTracerParameters.append(nativeValue); |
882 | CallTracer::recordCanvasAction(impl, "lineCap"_s , WTFMove(callTracerParameters)); |
883 | } |
884 | AttributeSetter::call(state, throwScope, [&] { |
885 | return impl.setLineCap(WTFMove(nativeValue)); |
886 | }); |
887 | return true; |
888 | } |
889 | |
890 | bool setJSCanvasRenderingContext2DLineCap(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
891 | { |
892 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DLineCapSetter>(*state, thisValue, encodedValue, "lineCap" ); |
893 | } |
894 | |
895 | static inline JSValue jsCanvasRenderingContext2DLineJoinGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
896 | { |
897 | UNUSED_PARAM(throwScope); |
898 | UNUSED_PARAM(state); |
899 | auto& impl = thisObject.wrapped(); |
900 | if (UNLIKELY(impl.callTracingActive())) |
901 | CallTracer::recordCanvasAction(impl, "lineJoin"_s ); |
902 | JSValue result = toJS<IDLEnumeration<CanvasLineJoin>>(state, throwScope, impl.lineJoin()); |
903 | return result; |
904 | } |
905 | |
906 | EncodedJSValue jsCanvasRenderingContext2DLineJoin(ExecState* state, EncodedJSValue thisValue, PropertyName) |
907 | { |
908 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DLineJoinGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineJoin" ); |
909 | } |
910 | |
911 | static inline bool setJSCanvasRenderingContext2DLineJoinSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
912 | { |
913 | UNUSED_PARAM(throwScope); |
914 | auto& impl = thisObject.wrapped(); |
915 | auto optionalNativeValue = parseEnumeration<CanvasLineJoin>(state, value); |
916 | RETURN_IF_EXCEPTION(throwScope, false); |
917 | if (UNLIKELY(!optionalNativeValue)) |
918 | return false; |
919 | auto nativeValue = optionalNativeValue.value(); |
920 | if (UNLIKELY(impl.callTracingActive())) { |
921 | Vector<RecordCanvasActionVariant> callTracerParameters; |
922 | callTracerParameters.append(nativeValue); |
923 | CallTracer::recordCanvasAction(impl, "lineJoin"_s , WTFMove(callTracerParameters)); |
924 | } |
925 | AttributeSetter::call(state, throwScope, [&] { |
926 | return impl.setLineJoin(WTFMove(nativeValue)); |
927 | }); |
928 | return true; |
929 | } |
930 | |
931 | bool setJSCanvasRenderingContext2DLineJoin(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
932 | { |
933 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DLineJoinSetter>(*state, thisValue, encodedValue, "lineJoin" ); |
934 | } |
935 | |
936 | static inline JSValue jsCanvasRenderingContext2DMiterLimitGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
937 | { |
938 | UNUSED_PARAM(throwScope); |
939 | UNUSED_PARAM(state); |
940 | auto& impl = thisObject.wrapped(); |
941 | if (UNLIKELY(impl.callTracingActive())) |
942 | CallTracer::recordCanvasAction(impl, "miterLimit"_s ); |
943 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.miterLimit()); |
944 | return result; |
945 | } |
946 | |
947 | EncodedJSValue jsCanvasRenderingContext2DMiterLimit(ExecState* state, EncodedJSValue thisValue, PropertyName) |
948 | { |
949 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DMiterLimitGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "miterLimit" ); |
950 | } |
951 | |
952 | static inline bool setJSCanvasRenderingContext2DMiterLimitSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
953 | { |
954 | UNUSED_PARAM(throwScope); |
955 | auto& impl = thisObject.wrapped(); |
956 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
957 | RETURN_IF_EXCEPTION(throwScope, false); |
958 | if (UNLIKELY(impl.callTracingActive())) { |
959 | Vector<RecordCanvasActionVariant> callTracerParameters; |
960 | callTracerParameters.append(nativeValue); |
961 | CallTracer::recordCanvasAction(impl, "miterLimit"_s , WTFMove(callTracerParameters)); |
962 | } |
963 | AttributeSetter::call(state, throwScope, [&] { |
964 | return impl.setMiterLimit(WTFMove(nativeValue)); |
965 | }); |
966 | return true; |
967 | } |
968 | |
969 | bool setJSCanvasRenderingContext2DMiterLimit(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
970 | { |
971 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DMiterLimitSetter>(*state, thisValue, encodedValue, "miterLimit" ); |
972 | } |
973 | |
974 | static inline JSValue jsCanvasRenderingContext2DLineDashOffsetGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
975 | { |
976 | UNUSED_PARAM(throwScope); |
977 | UNUSED_PARAM(state); |
978 | auto& impl = thisObject.wrapped(); |
979 | if (UNLIKELY(impl.callTracingActive())) |
980 | CallTracer::recordCanvasAction(impl, "lineDashOffset"_s ); |
981 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.lineDashOffset()); |
982 | return result; |
983 | } |
984 | |
985 | EncodedJSValue jsCanvasRenderingContext2DLineDashOffset(ExecState* state, EncodedJSValue thisValue, PropertyName) |
986 | { |
987 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DLineDashOffsetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lineDashOffset" ); |
988 | } |
989 | |
990 | static inline bool setJSCanvasRenderingContext2DLineDashOffsetSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
991 | { |
992 | UNUSED_PARAM(throwScope); |
993 | auto& impl = thisObject.wrapped(); |
994 | auto nativeValue = convert<IDLUnrestrictedFloat>(state, value); |
995 | RETURN_IF_EXCEPTION(throwScope, false); |
996 | if (UNLIKELY(impl.callTracingActive())) { |
997 | Vector<RecordCanvasActionVariant> callTracerParameters; |
998 | callTracerParameters.append(nativeValue); |
999 | CallTracer::recordCanvasAction(impl, "lineDashOffset"_s , WTFMove(callTracerParameters)); |
1000 | } |
1001 | AttributeSetter::call(state, throwScope, [&] { |
1002 | return impl.setLineDashOffset(WTFMove(nativeValue)); |
1003 | }); |
1004 | return true; |
1005 | } |
1006 | |
1007 | bool setJSCanvasRenderingContext2DLineDashOffset(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1008 | { |
1009 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DLineDashOffsetSetter>(*state, thisValue, encodedValue, "lineDashOffset" ); |
1010 | } |
1011 | |
1012 | static inline JSValue jsCanvasRenderingContext2DShadowOffsetXGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1013 | { |
1014 | UNUSED_PARAM(throwScope); |
1015 | UNUSED_PARAM(state); |
1016 | auto& impl = thisObject.wrapped(); |
1017 | if (UNLIKELY(impl.callTracingActive())) |
1018 | CallTracer::recordCanvasAction(impl, "shadowOffsetX"_s ); |
1019 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowOffsetX()); |
1020 | return result; |
1021 | } |
1022 | |
1023 | EncodedJSValue jsCanvasRenderingContext2DShadowOffsetX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1024 | { |
1025 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DShadowOffsetXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowOffsetX" ); |
1026 | } |
1027 | |
1028 | static inline bool setJSCanvasRenderingContext2DShadowOffsetXSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1029 | { |
1030 | UNUSED_PARAM(throwScope); |
1031 | auto& impl = thisObject.wrapped(); |
1032 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
1033 | RETURN_IF_EXCEPTION(throwScope, false); |
1034 | if (UNLIKELY(impl.callTracingActive())) { |
1035 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1036 | callTracerParameters.append(nativeValue); |
1037 | CallTracer::recordCanvasAction(impl, "shadowOffsetX"_s , WTFMove(callTracerParameters)); |
1038 | } |
1039 | AttributeSetter::call(state, throwScope, [&] { |
1040 | return impl.setShadowOffsetX(WTFMove(nativeValue)); |
1041 | }); |
1042 | return true; |
1043 | } |
1044 | |
1045 | bool setJSCanvasRenderingContext2DShadowOffsetX(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1046 | { |
1047 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DShadowOffsetXSetter>(*state, thisValue, encodedValue, "shadowOffsetX" ); |
1048 | } |
1049 | |
1050 | static inline JSValue jsCanvasRenderingContext2DShadowOffsetYGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1051 | { |
1052 | UNUSED_PARAM(throwScope); |
1053 | UNUSED_PARAM(state); |
1054 | auto& impl = thisObject.wrapped(); |
1055 | if (UNLIKELY(impl.callTracingActive())) |
1056 | CallTracer::recordCanvasAction(impl, "shadowOffsetY"_s ); |
1057 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowOffsetY()); |
1058 | return result; |
1059 | } |
1060 | |
1061 | EncodedJSValue jsCanvasRenderingContext2DShadowOffsetY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1062 | { |
1063 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DShadowOffsetYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowOffsetY" ); |
1064 | } |
1065 | |
1066 | static inline bool setJSCanvasRenderingContext2DShadowOffsetYSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1067 | { |
1068 | UNUSED_PARAM(throwScope); |
1069 | auto& impl = thisObject.wrapped(); |
1070 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
1071 | RETURN_IF_EXCEPTION(throwScope, false); |
1072 | if (UNLIKELY(impl.callTracingActive())) { |
1073 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1074 | callTracerParameters.append(nativeValue); |
1075 | CallTracer::recordCanvasAction(impl, "shadowOffsetY"_s , WTFMove(callTracerParameters)); |
1076 | } |
1077 | AttributeSetter::call(state, throwScope, [&] { |
1078 | return impl.setShadowOffsetY(WTFMove(nativeValue)); |
1079 | }); |
1080 | return true; |
1081 | } |
1082 | |
1083 | bool setJSCanvasRenderingContext2DShadowOffsetY(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1084 | { |
1085 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DShadowOffsetYSetter>(*state, thisValue, encodedValue, "shadowOffsetY" ); |
1086 | } |
1087 | |
1088 | static inline JSValue jsCanvasRenderingContext2DShadowBlurGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1089 | { |
1090 | UNUSED_PARAM(throwScope); |
1091 | UNUSED_PARAM(state); |
1092 | auto& impl = thisObject.wrapped(); |
1093 | if (UNLIKELY(impl.callTracingActive())) |
1094 | CallTracer::recordCanvasAction(impl, "shadowBlur"_s ); |
1095 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.shadowBlur()); |
1096 | return result; |
1097 | } |
1098 | |
1099 | EncodedJSValue jsCanvasRenderingContext2DShadowBlur(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1100 | { |
1101 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DShadowBlurGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowBlur" ); |
1102 | } |
1103 | |
1104 | static inline bool setJSCanvasRenderingContext2DShadowBlurSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1105 | { |
1106 | UNUSED_PARAM(throwScope); |
1107 | auto& impl = thisObject.wrapped(); |
1108 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
1109 | RETURN_IF_EXCEPTION(throwScope, false); |
1110 | if (UNLIKELY(impl.callTracingActive())) { |
1111 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1112 | callTracerParameters.append(nativeValue); |
1113 | CallTracer::recordCanvasAction(impl, "shadowBlur"_s , WTFMove(callTracerParameters)); |
1114 | } |
1115 | AttributeSetter::call(state, throwScope, [&] { |
1116 | return impl.setShadowBlur(WTFMove(nativeValue)); |
1117 | }); |
1118 | return true; |
1119 | } |
1120 | |
1121 | bool setJSCanvasRenderingContext2DShadowBlur(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1122 | { |
1123 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DShadowBlurSetter>(*state, thisValue, encodedValue, "shadowBlur" ); |
1124 | } |
1125 | |
1126 | static inline JSValue jsCanvasRenderingContext2DShadowColorGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1127 | { |
1128 | UNUSED_PARAM(throwScope); |
1129 | UNUSED_PARAM(state); |
1130 | auto& impl = thisObject.wrapped(); |
1131 | if (UNLIKELY(impl.callTracingActive())) |
1132 | CallTracer::recordCanvasAction(impl, "shadowColor"_s ); |
1133 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.shadowColor()); |
1134 | return result; |
1135 | } |
1136 | |
1137 | EncodedJSValue jsCanvasRenderingContext2DShadowColor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1138 | { |
1139 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DShadowColorGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "shadowColor" ); |
1140 | } |
1141 | |
1142 | static inline bool setJSCanvasRenderingContext2DShadowColorSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1143 | { |
1144 | UNUSED_PARAM(throwScope); |
1145 | auto& impl = thisObject.wrapped(); |
1146 | auto nativeValue = convert<IDLDOMString>(state, value); |
1147 | RETURN_IF_EXCEPTION(throwScope, false); |
1148 | if (UNLIKELY(impl.callTracingActive())) { |
1149 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1150 | callTracerParameters.append(nativeValue); |
1151 | CallTracer::recordCanvasAction(impl, "shadowColor"_s , WTFMove(callTracerParameters)); |
1152 | } |
1153 | AttributeSetter::call(state, throwScope, [&] { |
1154 | return impl.setShadowColor(WTFMove(nativeValue)); |
1155 | }); |
1156 | return true; |
1157 | } |
1158 | |
1159 | bool setJSCanvasRenderingContext2DShadowColor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1160 | { |
1161 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DShadowColorSetter>(*state, thisValue, encodedValue, "shadowColor" ); |
1162 | } |
1163 | |
1164 | static inline JSValue jsCanvasRenderingContext2DFontGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1165 | { |
1166 | UNUSED_PARAM(throwScope); |
1167 | UNUSED_PARAM(state); |
1168 | auto& impl = thisObject.wrapped(); |
1169 | if (UNLIKELY(impl.callTracingActive())) |
1170 | CallTracer::recordCanvasAction(impl, "font"_s ); |
1171 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.font()); |
1172 | return result; |
1173 | } |
1174 | |
1175 | EncodedJSValue jsCanvasRenderingContext2DFont(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1176 | { |
1177 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DFontGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "font" ); |
1178 | } |
1179 | |
1180 | static inline bool setJSCanvasRenderingContext2DFontSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1181 | { |
1182 | UNUSED_PARAM(throwScope); |
1183 | auto& impl = thisObject.wrapped(); |
1184 | auto nativeValue = convert<IDLDOMString>(state, value); |
1185 | RETURN_IF_EXCEPTION(throwScope, false); |
1186 | if (UNLIKELY(impl.callTracingActive())) { |
1187 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1188 | callTracerParameters.append(nativeValue); |
1189 | CallTracer::recordCanvasAction(impl, "font"_s , WTFMove(callTracerParameters)); |
1190 | } |
1191 | AttributeSetter::call(state, throwScope, [&] { |
1192 | return impl.setFont(WTFMove(nativeValue)); |
1193 | }); |
1194 | return true; |
1195 | } |
1196 | |
1197 | bool setJSCanvasRenderingContext2DFont(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1198 | { |
1199 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DFontSetter>(*state, thisValue, encodedValue, "font" ); |
1200 | } |
1201 | |
1202 | static inline JSValue jsCanvasRenderingContext2DTextAlignGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1203 | { |
1204 | UNUSED_PARAM(throwScope); |
1205 | UNUSED_PARAM(state); |
1206 | auto& impl = thisObject.wrapped(); |
1207 | if (UNLIKELY(impl.callTracingActive())) |
1208 | CallTracer::recordCanvasAction(impl, "textAlign"_s ); |
1209 | JSValue result = toJS<IDLEnumeration<CanvasTextAlign>>(state, throwScope, impl.textAlign()); |
1210 | return result; |
1211 | } |
1212 | |
1213 | EncodedJSValue jsCanvasRenderingContext2DTextAlign(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1214 | { |
1215 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DTextAlignGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "textAlign" ); |
1216 | } |
1217 | |
1218 | static inline bool setJSCanvasRenderingContext2DTextAlignSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1219 | { |
1220 | UNUSED_PARAM(throwScope); |
1221 | auto& impl = thisObject.wrapped(); |
1222 | auto optionalNativeValue = parseEnumeration<CanvasTextAlign>(state, value); |
1223 | RETURN_IF_EXCEPTION(throwScope, false); |
1224 | if (UNLIKELY(!optionalNativeValue)) |
1225 | return false; |
1226 | auto nativeValue = optionalNativeValue.value(); |
1227 | if (UNLIKELY(impl.callTracingActive())) { |
1228 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1229 | callTracerParameters.append(nativeValue); |
1230 | CallTracer::recordCanvasAction(impl, "textAlign"_s , WTFMove(callTracerParameters)); |
1231 | } |
1232 | AttributeSetter::call(state, throwScope, [&] { |
1233 | return impl.setTextAlign(WTFMove(nativeValue)); |
1234 | }); |
1235 | return true; |
1236 | } |
1237 | |
1238 | bool setJSCanvasRenderingContext2DTextAlign(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1239 | { |
1240 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DTextAlignSetter>(*state, thisValue, encodedValue, "textAlign" ); |
1241 | } |
1242 | |
1243 | static inline JSValue jsCanvasRenderingContext2DTextBaselineGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1244 | { |
1245 | UNUSED_PARAM(throwScope); |
1246 | UNUSED_PARAM(state); |
1247 | auto& impl = thisObject.wrapped(); |
1248 | if (UNLIKELY(impl.callTracingActive())) |
1249 | CallTracer::recordCanvasAction(impl, "textBaseline"_s ); |
1250 | JSValue result = toJS<IDLEnumeration<CanvasTextBaseline>>(state, throwScope, impl.textBaseline()); |
1251 | return result; |
1252 | } |
1253 | |
1254 | EncodedJSValue jsCanvasRenderingContext2DTextBaseline(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1255 | { |
1256 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DTextBaselineGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "textBaseline" ); |
1257 | } |
1258 | |
1259 | static inline bool setJSCanvasRenderingContext2DTextBaselineSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1260 | { |
1261 | UNUSED_PARAM(throwScope); |
1262 | auto& impl = thisObject.wrapped(); |
1263 | auto optionalNativeValue = parseEnumeration<CanvasTextBaseline>(state, value); |
1264 | RETURN_IF_EXCEPTION(throwScope, false); |
1265 | if (UNLIKELY(!optionalNativeValue)) |
1266 | return false; |
1267 | auto nativeValue = optionalNativeValue.value(); |
1268 | if (UNLIKELY(impl.callTracingActive())) { |
1269 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1270 | callTracerParameters.append(nativeValue); |
1271 | CallTracer::recordCanvasAction(impl, "textBaseline"_s , WTFMove(callTracerParameters)); |
1272 | } |
1273 | AttributeSetter::call(state, throwScope, [&] { |
1274 | return impl.setTextBaseline(WTFMove(nativeValue)); |
1275 | }); |
1276 | return true; |
1277 | } |
1278 | |
1279 | bool setJSCanvasRenderingContext2DTextBaseline(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1280 | { |
1281 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DTextBaselineSetter>(*state, thisValue, encodedValue, "textBaseline" ); |
1282 | } |
1283 | |
1284 | static inline JSValue jsCanvasRenderingContext2DDirectionGetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, ThrowScope& throwScope) |
1285 | { |
1286 | UNUSED_PARAM(throwScope); |
1287 | UNUSED_PARAM(state); |
1288 | auto& impl = thisObject.wrapped(); |
1289 | if (UNLIKELY(impl.callTracingActive())) |
1290 | CallTracer::recordCanvasAction(impl, "direction"_s ); |
1291 | JSValue result = toJS<IDLEnumeration<CanvasDirection>>(state, throwScope, impl.direction()); |
1292 | return result; |
1293 | } |
1294 | |
1295 | EncodedJSValue jsCanvasRenderingContext2DDirection(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1296 | { |
1297 | return IDLAttribute<JSCanvasRenderingContext2D>::get<jsCanvasRenderingContext2DDirectionGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "direction" ); |
1298 | } |
1299 | |
1300 | static inline bool setJSCanvasRenderingContext2DDirectionSetter(ExecState& state, JSCanvasRenderingContext2D& thisObject, JSValue value, ThrowScope& throwScope) |
1301 | { |
1302 | UNUSED_PARAM(throwScope); |
1303 | auto& impl = thisObject.wrapped(); |
1304 | auto optionalNativeValue = parseEnumeration<CanvasDirection>(state, value); |
1305 | RETURN_IF_EXCEPTION(throwScope, false); |
1306 | if (UNLIKELY(!optionalNativeValue)) |
1307 | return false; |
1308 | auto nativeValue = optionalNativeValue.value(); |
1309 | if (UNLIKELY(impl.callTracingActive())) { |
1310 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1311 | callTracerParameters.append(nativeValue); |
1312 | CallTracer::recordCanvasAction(impl, "direction"_s , WTFMove(callTracerParameters)); |
1313 | } |
1314 | AttributeSetter::call(state, throwScope, [&] { |
1315 | return impl.setDirection(WTFMove(nativeValue)); |
1316 | }); |
1317 | return true; |
1318 | } |
1319 | |
1320 | bool setJSCanvasRenderingContext2DDirection(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1321 | { |
1322 | return IDLAttribute<JSCanvasRenderingContext2D>::set<setJSCanvasRenderingContext2DDirectionSetter>(*state, thisValue, encodedValue, "direction" ); |
1323 | } |
1324 | |
1325 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetAlphaBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1326 | { |
1327 | UNUSED_PARAM(state); |
1328 | UNUSED_PARAM(throwScope); |
1329 | auto& impl = castedThis->wrapped(); |
1330 | auto alpha = convert<IDLUnrestrictedFloat>(*state, state->argument(0)); |
1331 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1332 | if (UNLIKELY(impl.callTracingActive())) { |
1333 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1334 | callTracerParameters.append(alpha); |
1335 | CallTracer::recordCanvasAction(impl, "setAlpha"_s , WTFMove(callTracerParameters)); |
1336 | } |
1337 | impl.setGlobalAlpha(WTFMove(alpha)); |
1338 | return JSValue::encode(jsUndefined()); |
1339 | } |
1340 | |
1341 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetAlpha(ExecState* state) |
1342 | { |
1343 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetAlphaBody>(*state, "setAlpha" ); |
1344 | } |
1345 | |
1346 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetCompositeOperationBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1347 | { |
1348 | UNUSED_PARAM(state); |
1349 | UNUSED_PARAM(throwScope); |
1350 | auto& impl = castedThis->wrapped(); |
1351 | auto compositeOperation = convert<IDLDOMString>(*state, state->argument(0)); |
1352 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1353 | if (UNLIKELY(impl.callTracingActive())) { |
1354 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1355 | callTracerParameters.append(compositeOperation); |
1356 | CallTracer::recordCanvasAction(impl, "setCompositeOperation"_s , WTFMove(callTracerParameters)); |
1357 | } |
1358 | impl.setGlobalCompositeOperation(WTFMove(compositeOperation)); |
1359 | return JSValue::encode(jsUndefined()); |
1360 | } |
1361 | |
1362 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetCompositeOperation(ExecState* state) |
1363 | { |
1364 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetCompositeOperationBody>(*state, "setCompositeOperation" ); |
1365 | } |
1366 | |
1367 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRectBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1368 | { |
1369 | UNUSED_PARAM(state); |
1370 | UNUSED_PARAM(throwScope); |
1371 | auto& impl = castedThis->wrapped(); |
1372 | if (UNLIKELY(state->argumentCount() < 1)) |
1373 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1374 | auto image = convert<IDLInterface<HTMLImageElement>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "image" , "CanvasRenderingContext2D" , "drawImageFromRect" , "HTMLImageElement" ); }); |
1375 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1376 | auto sx = state->argument(1).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1377 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1378 | auto sy = state->argument(2).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1379 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1380 | auto sw = state->argument(3).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1381 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1382 | auto sh = state->argument(4).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1383 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1384 | auto dx = state->argument(5).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
1385 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1386 | auto dy = state->argument(6).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(6)); |
1387 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1388 | auto dw = state->argument(7).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(7)); |
1389 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1390 | auto dh = state->argument(8).isUndefined() ? 0 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(8)); |
1391 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1392 | auto compositeOperation = state->argument(9).isUndefined() ? emptyString() : convert<IDLDOMString>(*state, state->uncheckedArgument(9)); |
1393 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1394 | if (UNLIKELY(impl.callTracingActive())) { |
1395 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1396 | callTracerParameters.append(image); |
1397 | callTracerParameters.append(sx); |
1398 | callTracerParameters.append(sy); |
1399 | callTracerParameters.append(sw); |
1400 | callTracerParameters.append(sh); |
1401 | callTracerParameters.append(dx); |
1402 | callTracerParameters.append(dy); |
1403 | callTracerParameters.append(dw); |
1404 | callTracerParameters.append(dh); |
1405 | callTracerParameters.append(compositeOperation); |
1406 | CallTracer::recordCanvasAction(impl, "drawImageFromRect"_s , WTFMove(callTracerParameters)); |
1407 | } |
1408 | impl.drawImageFromRect(*image, WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh), WTFMove(compositeOperation)); |
1409 | return JSValue::encode(jsUndefined()); |
1410 | } |
1411 | |
1412 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRect(ExecState* state) |
1413 | { |
1414 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRectBody>(*state, "drawImageFromRect" ); |
1415 | } |
1416 | |
1417 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1418 | { |
1419 | UNUSED_PARAM(state); |
1420 | UNUSED_PARAM(throwScope); |
1421 | auto& impl = castedThis->wrapped(); |
1422 | auto color = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
1423 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1424 | auto alpha = state->argument(1).isUndefined() ? Optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : Optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1))); |
1425 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1426 | if (UNLIKELY(impl.callTracingActive())) { |
1427 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1428 | callTracerParameters.append(color); |
1429 | if (alpha) |
1430 | callTracerParameters.append(*alpha); |
1431 | CallTracer::recordCanvasAction(impl, "setStrokeColor"_s , WTFMove(callTracerParameters)); |
1432 | } |
1433 | impl.setStrokeColor(WTFMove(color), WTFMove(alpha)); |
1434 | return JSValue::encode(jsUndefined()); |
1435 | } |
1436 | |
1437 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1438 | { |
1439 | UNUSED_PARAM(state); |
1440 | UNUSED_PARAM(throwScope); |
1441 | auto& impl = castedThis->wrapped(); |
1442 | auto grayLevel = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1443 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1444 | auto alpha = state->argument(1).isUndefined() ? 1 : convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
1445 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1446 | if (UNLIKELY(impl.callTracingActive())) { |
1447 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1448 | callTracerParameters.append(grayLevel); |
1449 | callTracerParameters.append(alpha); |
1450 | CallTracer::recordCanvasAction(impl, "setStrokeColor"_s , WTFMove(callTracerParameters)); |
1451 | } |
1452 | impl.setStrokeColor(WTFMove(grayLevel), WTFMove(alpha)); |
1453 | return JSValue::encode(jsUndefined()); |
1454 | } |
1455 | |
1456 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor3Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1457 | { |
1458 | UNUSED_PARAM(state); |
1459 | UNUSED_PARAM(throwScope); |
1460 | auto& impl = castedThis->wrapped(); |
1461 | auto r = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1462 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1463 | auto g = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1464 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1465 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1466 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1467 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1468 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1469 | if (UNLIKELY(impl.callTracingActive())) { |
1470 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1471 | callTracerParameters.append(r); |
1472 | callTracerParameters.append(g); |
1473 | callTracerParameters.append(b); |
1474 | callTracerParameters.append(a); |
1475 | CallTracer::recordCanvasAction(impl, "setStrokeColor"_s , WTFMove(callTracerParameters)); |
1476 | } |
1477 | impl.setStrokeColor(WTFMove(r), WTFMove(g), WTFMove(b), WTFMove(a)); |
1478 | return JSValue::encode(jsUndefined()); |
1479 | } |
1480 | |
1481 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor4Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1482 | { |
1483 | UNUSED_PARAM(state); |
1484 | UNUSED_PARAM(throwScope); |
1485 | auto& impl = castedThis->wrapped(); |
1486 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1487 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1488 | auto m = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1489 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1490 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1491 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1492 | auto k = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1493 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1494 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1495 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1496 | if (UNLIKELY(impl.callTracingActive())) { |
1497 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1498 | callTracerParameters.append(c); |
1499 | callTracerParameters.append(m); |
1500 | callTracerParameters.append(y); |
1501 | callTracerParameters.append(k); |
1502 | callTracerParameters.append(a); |
1503 | CallTracer::recordCanvasAction(impl, "setStrokeColor"_s , WTFMove(callTracerParameters)); |
1504 | } |
1505 | impl.setStrokeColor(WTFMove(c), WTFMove(m), WTFMove(y), WTFMove(k), WTFMove(a)); |
1506 | return JSValue::encode(jsUndefined()); |
1507 | } |
1508 | |
1509 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColorOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1510 | { |
1511 | UNUSED_PARAM(state); |
1512 | UNUSED_PARAM(throwScope); |
1513 | VM& vm = state->vm(); |
1514 | UNUSED_PARAM(vm); |
1515 | size_t argsCount = std::min<size_t>(5, state->argumentCount()); |
1516 | if (argsCount == 1) { |
1517 | JSValue distinguishingArg = state->uncheckedArgument(0); |
1518 | if (distinguishingArg.isNumber()) |
1519 | return jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor2Body(state, castedThis, throwScope); |
1520 | return jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor1Body(state, castedThis, throwScope); |
1521 | } |
1522 | if (argsCount == 2) { |
1523 | JSValue distinguishingArg = state->uncheckedArgument(0); |
1524 | if (distinguishingArg.isNumber()) |
1525 | return jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor2Body(state, castedThis, throwScope); |
1526 | return jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor1Body(state, castedThis, throwScope); |
1527 | } |
1528 | if (argsCount == 4) { |
1529 | return jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor3Body(state, castedThis, throwScope); |
1530 | } |
1531 | if (argsCount == 5) { |
1532 | return jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor4Body(state, castedThis, throwScope); |
1533 | } |
1534 | return argsCount < 1 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
1535 | } |
1536 | |
1537 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor(ExecState* state) |
1538 | { |
1539 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColorOverloadDispatcher>(*state, "setStrokeColor" ); |
1540 | } |
1541 | |
1542 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetFillColor1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1543 | { |
1544 | UNUSED_PARAM(state); |
1545 | UNUSED_PARAM(throwScope); |
1546 | auto& impl = castedThis->wrapped(); |
1547 | auto color = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
1548 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1549 | auto alpha = state->argument(1).isUndefined() ? Optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : Optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1))); |
1550 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1551 | if (UNLIKELY(impl.callTracingActive())) { |
1552 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1553 | callTracerParameters.append(color); |
1554 | if (alpha) |
1555 | callTracerParameters.append(*alpha); |
1556 | CallTracer::recordCanvasAction(impl, "setFillColor"_s , WTFMove(callTracerParameters)); |
1557 | } |
1558 | impl.setFillColor(WTFMove(color), WTFMove(alpha)); |
1559 | return JSValue::encode(jsUndefined()); |
1560 | } |
1561 | |
1562 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetFillColor2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1563 | { |
1564 | UNUSED_PARAM(state); |
1565 | UNUSED_PARAM(throwScope); |
1566 | auto& impl = castedThis->wrapped(); |
1567 | auto grayLevel = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1568 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1569 | auto alpha = state->argument(1).isUndefined() ? 1 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1570 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1571 | if (UNLIKELY(impl.callTracingActive())) { |
1572 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1573 | callTracerParameters.append(grayLevel); |
1574 | callTracerParameters.append(alpha); |
1575 | CallTracer::recordCanvasAction(impl, "setFillColor"_s , WTFMove(callTracerParameters)); |
1576 | } |
1577 | impl.setFillColor(WTFMove(grayLevel), WTFMove(alpha)); |
1578 | return JSValue::encode(jsUndefined()); |
1579 | } |
1580 | |
1581 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetFillColor3Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1582 | { |
1583 | UNUSED_PARAM(state); |
1584 | UNUSED_PARAM(throwScope); |
1585 | auto& impl = castedThis->wrapped(); |
1586 | auto r = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1587 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1588 | auto g = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1589 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1590 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1591 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1592 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1593 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1594 | if (UNLIKELY(impl.callTracingActive())) { |
1595 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1596 | callTracerParameters.append(r); |
1597 | callTracerParameters.append(g); |
1598 | callTracerParameters.append(b); |
1599 | callTracerParameters.append(a); |
1600 | CallTracer::recordCanvasAction(impl, "setFillColor"_s , WTFMove(callTracerParameters)); |
1601 | } |
1602 | impl.setFillColor(WTFMove(r), WTFMove(g), WTFMove(b), WTFMove(a)); |
1603 | return JSValue::encode(jsUndefined()); |
1604 | } |
1605 | |
1606 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetFillColor4Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1607 | { |
1608 | UNUSED_PARAM(state); |
1609 | UNUSED_PARAM(throwScope); |
1610 | auto& impl = castedThis->wrapped(); |
1611 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1612 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1613 | auto m = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1614 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1615 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1616 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1617 | auto k = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1618 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1619 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1620 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1621 | if (UNLIKELY(impl.callTracingActive())) { |
1622 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1623 | callTracerParameters.append(c); |
1624 | callTracerParameters.append(m); |
1625 | callTracerParameters.append(y); |
1626 | callTracerParameters.append(k); |
1627 | callTracerParameters.append(a); |
1628 | CallTracer::recordCanvasAction(impl, "setFillColor"_s , WTFMove(callTracerParameters)); |
1629 | } |
1630 | impl.setFillColor(WTFMove(c), WTFMove(m), WTFMove(y), WTFMove(k), WTFMove(a)); |
1631 | return JSValue::encode(jsUndefined()); |
1632 | } |
1633 | |
1634 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetFillColorOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1635 | { |
1636 | UNUSED_PARAM(state); |
1637 | UNUSED_PARAM(throwScope); |
1638 | VM& vm = state->vm(); |
1639 | UNUSED_PARAM(vm); |
1640 | size_t argsCount = std::min<size_t>(5, state->argumentCount()); |
1641 | if (argsCount == 1) { |
1642 | JSValue distinguishingArg = state->uncheckedArgument(0); |
1643 | if (distinguishingArg.isNumber()) |
1644 | return jsCanvasRenderingContext2DPrototypeFunctionSetFillColor2Body(state, castedThis, throwScope); |
1645 | return jsCanvasRenderingContext2DPrototypeFunctionSetFillColor1Body(state, castedThis, throwScope); |
1646 | } |
1647 | if (argsCount == 2) { |
1648 | JSValue distinguishingArg = state->uncheckedArgument(0); |
1649 | if (distinguishingArg.isNumber()) |
1650 | return jsCanvasRenderingContext2DPrototypeFunctionSetFillColor2Body(state, castedThis, throwScope); |
1651 | return jsCanvasRenderingContext2DPrototypeFunctionSetFillColor1Body(state, castedThis, throwScope); |
1652 | } |
1653 | if (argsCount == 4) { |
1654 | return jsCanvasRenderingContext2DPrototypeFunctionSetFillColor3Body(state, castedThis, throwScope); |
1655 | } |
1656 | if (argsCount == 5) { |
1657 | return jsCanvasRenderingContext2DPrototypeFunctionSetFillColor4Body(state, castedThis, throwScope); |
1658 | } |
1659 | return argsCount < 1 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
1660 | } |
1661 | |
1662 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetFillColor(ExecState* state) |
1663 | { |
1664 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetFillColorOverloadDispatcher>(*state, "setFillColor" ); |
1665 | } |
1666 | |
1667 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetLineWidthBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1668 | { |
1669 | UNUSED_PARAM(state); |
1670 | UNUSED_PARAM(throwScope); |
1671 | auto& impl = castedThis->wrapped(); |
1672 | auto width = convert<IDLUnrestrictedFloat>(*state, state->argument(0)); |
1673 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1674 | if (UNLIKELY(impl.callTracingActive())) { |
1675 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1676 | callTracerParameters.append(width); |
1677 | CallTracer::recordCanvasAction(impl, "setLineWidth"_s , WTFMove(callTracerParameters)); |
1678 | } |
1679 | impl.setLineWidth(WTFMove(width)); |
1680 | return JSValue::encode(jsUndefined()); |
1681 | } |
1682 | |
1683 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineWidth(ExecState* state) |
1684 | { |
1685 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetLineWidthBody>(*state, "setLineWidth" ); |
1686 | } |
1687 | |
1688 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetLineCapBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1689 | { |
1690 | UNUSED_PARAM(state); |
1691 | UNUSED_PARAM(throwScope); |
1692 | auto& impl = castedThis->wrapped(); |
1693 | auto cap = convert<IDLDOMString>(*state, state->argument(0)); |
1694 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1695 | if (UNLIKELY(impl.callTracingActive())) { |
1696 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1697 | callTracerParameters.append(cap); |
1698 | CallTracer::recordCanvasAction(impl, "setLineCap"_s , WTFMove(callTracerParameters)); |
1699 | } |
1700 | impl.setLineCap(WTFMove(cap)); |
1701 | return JSValue::encode(jsUndefined()); |
1702 | } |
1703 | |
1704 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineCap(ExecState* state) |
1705 | { |
1706 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetLineCapBody>(*state, "setLineCap" ); |
1707 | } |
1708 | |
1709 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetLineJoinBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1710 | { |
1711 | UNUSED_PARAM(state); |
1712 | UNUSED_PARAM(throwScope); |
1713 | auto& impl = castedThis->wrapped(); |
1714 | auto join = convert<IDLDOMString>(*state, state->argument(0)); |
1715 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1716 | if (UNLIKELY(impl.callTracingActive())) { |
1717 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1718 | callTracerParameters.append(join); |
1719 | CallTracer::recordCanvasAction(impl, "setLineJoin"_s , WTFMove(callTracerParameters)); |
1720 | } |
1721 | impl.setLineJoin(WTFMove(join)); |
1722 | return JSValue::encode(jsUndefined()); |
1723 | } |
1724 | |
1725 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineJoin(ExecState* state) |
1726 | { |
1727 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetLineJoinBody>(*state, "setLineJoin" ); |
1728 | } |
1729 | |
1730 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetMiterLimitBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1731 | { |
1732 | UNUSED_PARAM(state); |
1733 | UNUSED_PARAM(throwScope); |
1734 | auto& impl = castedThis->wrapped(); |
1735 | auto limit = convert<IDLUnrestrictedFloat>(*state, state->argument(0)); |
1736 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1737 | if (UNLIKELY(impl.callTracingActive())) { |
1738 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1739 | callTracerParameters.append(limit); |
1740 | CallTracer::recordCanvasAction(impl, "setMiterLimit"_s , WTFMove(callTracerParameters)); |
1741 | } |
1742 | impl.setMiterLimit(WTFMove(limit)); |
1743 | return JSValue::encode(jsUndefined()); |
1744 | } |
1745 | |
1746 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetMiterLimit(ExecState* state) |
1747 | { |
1748 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetMiterLimitBody>(*state, "setMiterLimit" ); |
1749 | } |
1750 | |
1751 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetShadow1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1752 | { |
1753 | UNUSED_PARAM(state); |
1754 | UNUSED_PARAM(throwScope); |
1755 | auto& impl = castedThis->wrapped(); |
1756 | auto width = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1757 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1758 | auto height = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1759 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1760 | auto blur = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1761 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1762 | auto color = state->argument(3).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(3)); |
1763 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1764 | auto alpha = state->argument(4).isUndefined() ? Optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : Optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4))); |
1765 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1766 | if (UNLIKELY(impl.callTracingActive())) { |
1767 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1768 | callTracerParameters.append(width); |
1769 | callTracerParameters.append(height); |
1770 | callTracerParameters.append(blur); |
1771 | callTracerParameters.append(color); |
1772 | if (alpha) |
1773 | callTracerParameters.append(*alpha); |
1774 | CallTracer::recordCanvasAction(impl, "setShadow"_s , WTFMove(callTracerParameters)); |
1775 | } |
1776 | impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(color), WTFMove(alpha)); |
1777 | return JSValue::encode(jsUndefined()); |
1778 | } |
1779 | |
1780 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetShadow2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1781 | { |
1782 | UNUSED_PARAM(state); |
1783 | UNUSED_PARAM(throwScope); |
1784 | auto& impl = castedThis->wrapped(); |
1785 | auto width = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1786 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1787 | auto height = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1788 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1789 | auto blur = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1790 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1791 | auto grayLevel = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1792 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1793 | auto alpha = state->argument(4).isUndefined() ? 1 : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1794 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1795 | if (UNLIKELY(impl.callTracingActive())) { |
1796 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1797 | callTracerParameters.append(width); |
1798 | callTracerParameters.append(height); |
1799 | callTracerParameters.append(blur); |
1800 | callTracerParameters.append(grayLevel); |
1801 | callTracerParameters.append(alpha); |
1802 | CallTracer::recordCanvasAction(impl, "setShadow"_s , WTFMove(callTracerParameters)); |
1803 | } |
1804 | impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(grayLevel), WTFMove(alpha)); |
1805 | return JSValue::encode(jsUndefined()); |
1806 | } |
1807 | |
1808 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetShadow3Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1809 | { |
1810 | UNUSED_PARAM(state); |
1811 | UNUSED_PARAM(throwScope); |
1812 | auto& impl = castedThis->wrapped(); |
1813 | auto width = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
1814 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1815 | auto height = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1816 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1817 | auto blur = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1818 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1819 | auto r = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1820 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1821 | auto g = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1822 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1823 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
1824 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1825 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(6)); |
1826 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1827 | if (UNLIKELY(impl.callTracingActive())) { |
1828 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1829 | callTracerParameters.append(width); |
1830 | callTracerParameters.append(height); |
1831 | callTracerParameters.append(blur); |
1832 | callTracerParameters.append(r); |
1833 | callTracerParameters.append(g); |
1834 | callTracerParameters.append(b); |
1835 | callTracerParameters.append(a); |
1836 | CallTracer::recordCanvasAction(impl, "setShadow"_s , WTFMove(callTracerParameters)); |
1837 | } |
1838 | impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(r), WTFMove(g), WTFMove(b), WTFMove(a)); |
1839 | return JSValue::encode(jsUndefined()); |
1840 | } |
1841 | |
1842 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetShadow4Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1843 | { |
1844 | UNUSED_PARAM(state); |
1845 | UNUSED_PARAM(throwScope); |
1846 | auto& impl = castedThis->wrapped(); |
1847 | auto width = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
1848 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1849 | auto height = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
1850 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1851 | auto blur = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
1852 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1853 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
1854 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1855 | auto m = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
1856 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1857 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
1858 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1859 | auto k = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(6)); |
1860 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1861 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(7)); |
1862 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1863 | if (UNLIKELY(impl.callTracingActive())) { |
1864 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1865 | callTracerParameters.append(width); |
1866 | callTracerParameters.append(height); |
1867 | callTracerParameters.append(blur); |
1868 | callTracerParameters.append(c); |
1869 | callTracerParameters.append(m); |
1870 | callTracerParameters.append(y); |
1871 | callTracerParameters.append(k); |
1872 | callTracerParameters.append(a); |
1873 | CallTracer::recordCanvasAction(impl, "setShadow"_s , WTFMove(callTracerParameters)); |
1874 | } |
1875 | impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(c), WTFMove(m), WTFMove(y), WTFMove(k), WTFMove(a)); |
1876 | return JSValue::encode(jsUndefined()); |
1877 | } |
1878 | |
1879 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetShadowOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1880 | { |
1881 | UNUSED_PARAM(state); |
1882 | UNUSED_PARAM(throwScope); |
1883 | VM& vm = state->vm(); |
1884 | UNUSED_PARAM(vm); |
1885 | size_t argsCount = std::min<size_t>(8, state->argumentCount()); |
1886 | if (argsCount == 3) { |
1887 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow1Body(state, castedThis, throwScope); |
1888 | } |
1889 | if (argsCount == 4) { |
1890 | JSValue distinguishingArg = state->uncheckedArgument(3); |
1891 | if (distinguishingArg.isUndefined()) |
1892 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow1Body(state, castedThis, throwScope); |
1893 | if (distinguishingArg.isNumber()) |
1894 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow2Body(state, castedThis, throwScope); |
1895 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow1Body(state, castedThis, throwScope); |
1896 | } |
1897 | if (argsCount == 5) { |
1898 | JSValue distinguishingArg = state->uncheckedArgument(3); |
1899 | if (distinguishingArg.isUndefined()) |
1900 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow1Body(state, castedThis, throwScope); |
1901 | if (distinguishingArg.isNumber()) |
1902 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow2Body(state, castedThis, throwScope); |
1903 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow1Body(state, castedThis, throwScope); |
1904 | } |
1905 | if (argsCount == 7) { |
1906 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow3Body(state, castedThis, throwScope); |
1907 | } |
1908 | if (argsCount == 8) { |
1909 | return jsCanvasRenderingContext2DPrototypeFunctionSetShadow4Body(state, castedThis, throwScope); |
1910 | } |
1911 | return argsCount < 3 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
1912 | } |
1913 | |
1914 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetShadow(ExecState* state) |
1915 | { |
1916 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetShadowOverloadDispatcher>(*state, "setShadow" ); |
1917 | } |
1918 | |
1919 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionClearShadowBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1920 | { |
1921 | UNUSED_PARAM(state); |
1922 | UNUSED_PARAM(throwScope); |
1923 | auto& impl = castedThis->wrapped(); |
1924 | if (UNLIKELY(impl.callTracingActive())) |
1925 | CallTracer::recordCanvasAction(impl, "clearShadow"_s ); |
1926 | impl.clearShadow(); |
1927 | return JSValue::encode(jsUndefined()); |
1928 | } |
1929 | |
1930 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClearShadow(ExecState* state) |
1931 | { |
1932 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionClearShadowBody>(*state, "clearShadow" ); |
1933 | } |
1934 | |
1935 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetPathBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1936 | { |
1937 | UNUSED_PARAM(state); |
1938 | UNUSED_PARAM(throwScope); |
1939 | auto& impl = castedThis->wrapped(); |
1940 | if (UNLIKELY(state->argumentCount() < 1)) |
1941 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1942 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "CanvasRenderingContext2D" , "setPath" , "Path2D" ); }); |
1943 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1944 | if (UNLIKELY(impl.callTracingActive())) { |
1945 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1946 | callTracerParameters.append(path); |
1947 | CallTracer::recordCanvasAction(impl, "setPath"_s , WTFMove(callTracerParameters)); |
1948 | } |
1949 | impl.setPath(*path); |
1950 | return JSValue::encode(jsUndefined()); |
1951 | } |
1952 | |
1953 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetPath(ExecState* state) |
1954 | { |
1955 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetPathBody>(*state, "setPath" ); |
1956 | } |
1957 | |
1958 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionGetPathBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1959 | { |
1960 | UNUSED_PARAM(state); |
1961 | UNUSED_PARAM(throwScope); |
1962 | auto& impl = castedThis->wrapped(); |
1963 | if (UNLIKELY(impl.callTracingActive())) |
1964 | CallTracer::recordCanvasAction(impl, "getPath"_s ); |
1965 | return JSValue::encode(toJSNewlyCreated<IDLInterface<Path2D>>(*state, *castedThis->globalObject(), impl.getPath())); |
1966 | } |
1967 | |
1968 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetPath(ExecState* state) |
1969 | { |
1970 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionGetPathBody>(*state, "getPath" ); |
1971 | } |
1972 | |
1973 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawImage1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1974 | { |
1975 | UNUSED_PARAM(state); |
1976 | UNUSED_PARAM(throwScope); |
1977 | auto& impl = castedThis->wrapped(); |
1978 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
1979 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1980 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
1981 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1982 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
1983 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1984 | if (UNLIKELY(impl.callTracingActive())) { |
1985 | Vector<RecordCanvasActionVariant> callTracerParameters; |
1986 | WTF::visit([&] (auto& value) { callTracerParameters.append(value); }, image); |
1987 | callTracerParameters.append(dx); |
1988 | callTracerParameters.append(dy); |
1989 | CallTracer::recordCanvasAction(impl, "drawImage"_s , WTFMove(callTracerParameters)); |
1990 | } |
1991 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy))); |
1992 | return JSValue::encode(jsUndefined()); |
1993 | } |
1994 | |
1995 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawImage2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1996 | { |
1997 | UNUSED_PARAM(state); |
1998 | UNUSED_PARAM(throwScope); |
1999 | auto& impl = castedThis->wrapped(); |
2000 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
2001 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2002 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2003 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2004 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2005 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2006 | auto dw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2007 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2008 | auto dh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
2009 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2010 | if (UNLIKELY(impl.callTracingActive())) { |
2011 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2012 | WTF::visit([&] (auto& value) { callTracerParameters.append(value); }, image); |
2013 | callTracerParameters.append(dx); |
2014 | callTracerParameters.append(dy); |
2015 | callTracerParameters.append(dw); |
2016 | callTracerParameters.append(dh); |
2017 | CallTracer::recordCanvasAction(impl, "drawImage"_s , WTFMove(callTracerParameters)); |
2018 | } |
2019 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh))); |
2020 | return JSValue::encode(jsUndefined()); |
2021 | } |
2022 | |
2023 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawImage3Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2024 | { |
2025 | UNUSED_PARAM(state); |
2026 | UNUSED_PARAM(throwScope); |
2027 | auto& impl = castedThis->wrapped(); |
2028 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
2029 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2030 | auto sx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2031 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2032 | auto sy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2033 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2034 | auto sw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2035 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2036 | auto sh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
2037 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2038 | auto dx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
2039 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2040 | auto dy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(6)); |
2041 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2042 | auto dw = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(7)); |
2043 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2044 | auto dh = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(8)); |
2045 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2046 | if (UNLIKELY(impl.callTracingActive())) { |
2047 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2048 | WTF::visit([&] (auto& value) { callTracerParameters.append(value); }, image); |
2049 | callTracerParameters.append(sx); |
2050 | callTracerParameters.append(sy); |
2051 | callTracerParameters.append(sw); |
2052 | callTracerParameters.append(sh); |
2053 | callTracerParameters.append(dx); |
2054 | callTracerParameters.append(dy); |
2055 | callTracerParameters.append(dw); |
2056 | callTracerParameters.append(dh); |
2057 | CallTracer::recordCanvasAction(impl, "drawImage"_s , WTFMove(callTracerParameters)); |
2058 | } |
2059 | propagateException(*state, throwScope, impl.drawImage(WTFMove(image), WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh))); |
2060 | return JSValue::encode(jsUndefined()); |
2061 | } |
2062 | |
2063 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawImageOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2064 | { |
2065 | UNUSED_PARAM(state); |
2066 | UNUSED_PARAM(throwScope); |
2067 | VM& vm = state->vm(); |
2068 | UNUSED_PARAM(vm); |
2069 | size_t argsCount = std::min<size_t>(9, state->argumentCount()); |
2070 | if (argsCount == 3) { |
2071 | return jsCanvasRenderingContext2DPrototypeFunctionDrawImage1Body(state, castedThis, throwScope); |
2072 | } |
2073 | if (argsCount == 5) { |
2074 | return jsCanvasRenderingContext2DPrototypeFunctionDrawImage2Body(state, castedThis, throwScope); |
2075 | } |
2076 | if (argsCount == 9) { |
2077 | return jsCanvasRenderingContext2DPrototypeFunctionDrawImage3Body(state, castedThis, throwScope); |
2078 | } |
2079 | return argsCount < 3 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
2080 | } |
2081 | |
2082 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawImage(ExecState* state) |
2083 | { |
2084 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionDrawImageOverloadDispatcher>(*state, "drawImage" ); |
2085 | } |
2086 | |
2087 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionBeginPathBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2088 | { |
2089 | UNUSED_PARAM(state); |
2090 | UNUSED_PARAM(throwScope); |
2091 | auto& impl = castedThis->wrapped(); |
2092 | if (UNLIKELY(impl.callTracingActive())) |
2093 | CallTracer::recordCanvasAction(impl, "beginPath"_s ); |
2094 | impl.beginPath(); |
2095 | return JSValue::encode(jsUndefined()); |
2096 | } |
2097 | |
2098 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionBeginPath(ExecState* state) |
2099 | { |
2100 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionBeginPathBody>(*state, "beginPath" ); |
2101 | } |
2102 | |
2103 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionFill1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2104 | { |
2105 | UNUSED_PARAM(state); |
2106 | UNUSED_PARAM(throwScope); |
2107 | auto& impl = castedThis->wrapped(); |
2108 | auto fillRule = state->argument(0).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 0, "fillRule" , "CanvasRenderingContext2D" , "fill" , expectedEnumerationValues<CanvasFillRule>()); }); |
2109 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2110 | if (UNLIKELY(impl.callTracingActive())) { |
2111 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2112 | callTracerParameters.append(fillRule); |
2113 | CallTracer::recordCanvasAction(impl, "fill"_s , WTFMove(callTracerParameters)); |
2114 | } |
2115 | impl.fill(WTFMove(fillRule)); |
2116 | return JSValue::encode(jsUndefined()); |
2117 | } |
2118 | |
2119 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionFill2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2120 | { |
2121 | UNUSED_PARAM(state); |
2122 | UNUSED_PARAM(throwScope); |
2123 | auto& impl = castedThis->wrapped(); |
2124 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "CanvasRenderingContext2D" , "fill" , "Path2D" ); }); |
2125 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2126 | auto fillRule = state->argument(1).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 1, "fillRule" , "CanvasRenderingContext2D" , "fill" , expectedEnumerationValues<CanvasFillRule>()); }); |
2127 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2128 | if (UNLIKELY(impl.callTracingActive())) { |
2129 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2130 | callTracerParameters.append(path); |
2131 | callTracerParameters.append(fillRule); |
2132 | CallTracer::recordCanvasAction(impl, "fill"_s , WTFMove(callTracerParameters)); |
2133 | } |
2134 | impl.fill(*path, WTFMove(fillRule)); |
2135 | return JSValue::encode(jsUndefined()); |
2136 | } |
2137 | |
2138 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionFillOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2139 | { |
2140 | UNUSED_PARAM(state); |
2141 | UNUSED_PARAM(throwScope); |
2142 | VM& vm = state->vm(); |
2143 | UNUSED_PARAM(vm); |
2144 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
2145 | if (argsCount == 0) { |
2146 | return jsCanvasRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
2147 | } |
2148 | if (argsCount == 1) { |
2149 | JSValue distinguishingArg = state->uncheckedArgument(0); |
2150 | if (distinguishingArg.isUndefined()) |
2151 | return jsCanvasRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
2152 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
2153 | return jsCanvasRenderingContext2DPrototypeFunctionFill2Body(state, castedThis, throwScope); |
2154 | return jsCanvasRenderingContext2DPrototypeFunctionFill1Body(state, castedThis, throwScope); |
2155 | } |
2156 | if (argsCount == 2) { |
2157 | return jsCanvasRenderingContext2DPrototypeFunctionFill2Body(state, castedThis, throwScope); |
2158 | } |
2159 | return throwVMTypeError(state, throwScope); |
2160 | } |
2161 | |
2162 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionFill(ExecState* state) |
2163 | { |
2164 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionFillOverloadDispatcher>(*state, "fill" ); |
2165 | } |
2166 | |
2167 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionStroke1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2168 | { |
2169 | UNUSED_PARAM(state); |
2170 | UNUSED_PARAM(throwScope); |
2171 | auto& impl = castedThis->wrapped(); |
2172 | if (UNLIKELY(impl.callTracingActive())) |
2173 | CallTracer::recordCanvasAction(impl, "stroke"_s ); |
2174 | impl.stroke(); |
2175 | return JSValue::encode(jsUndefined()); |
2176 | } |
2177 | |
2178 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionStroke2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2179 | { |
2180 | UNUSED_PARAM(state); |
2181 | UNUSED_PARAM(throwScope); |
2182 | auto& impl = castedThis->wrapped(); |
2183 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "CanvasRenderingContext2D" , "stroke" , "Path2D" ); }); |
2184 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2185 | if (UNLIKELY(impl.callTracingActive())) { |
2186 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2187 | callTracerParameters.append(path); |
2188 | CallTracer::recordCanvasAction(impl, "stroke"_s , WTFMove(callTracerParameters)); |
2189 | } |
2190 | impl.stroke(*path); |
2191 | return JSValue::encode(jsUndefined()); |
2192 | } |
2193 | |
2194 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionStrokeOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2195 | { |
2196 | UNUSED_PARAM(state); |
2197 | UNUSED_PARAM(throwScope); |
2198 | VM& vm = state->vm(); |
2199 | UNUSED_PARAM(vm); |
2200 | size_t argsCount = std::min<size_t>(1, state->argumentCount()); |
2201 | if (argsCount == 0) { |
2202 | return jsCanvasRenderingContext2DPrototypeFunctionStroke1Body(state, castedThis, throwScope); |
2203 | } |
2204 | if (argsCount == 1) { |
2205 | return jsCanvasRenderingContext2DPrototypeFunctionStroke2Body(state, castedThis, throwScope); |
2206 | } |
2207 | return throwVMTypeError(state, throwScope); |
2208 | } |
2209 | |
2210 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStroke(ExecState* state) |
2211 | { |
2212 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionStrokeOverloadDispatcher>(*state, "stroke" ); |
2213 | } |
2214 | |
2215 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionClip1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2216 | { |
2217 | UNUSED_PARAM(state); |
2218 | UNUSED_PARAM(throwScope); |
2219 | auto& impl = castedThis->wrapped(); |
2220 | auto fillRule = state->argument(0).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 0, "fillRule" , "CanvasRenderingContext2D" , "clip" , expectedEnumerationValues<CanvasFillRule>()); }); |
2221 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2222 | if (UNLIKELY(impl.callTracingActive())) { |
2223 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2224 | callTracerParameters.append(fillRule); |
2225 | CallTracer::recordCanvasAction(impl, "clip"_s , WTFMove(callTracerParameters)); |
2226 | } |
2227 | impl.clip(WTFMove(fillRule)); |
2228 | return JSValue::encode(jsUndefined()); |
2229 | } |
2230 | |
2231 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionClip2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2232 | { |
2233 | UNUSED_PARAM(state); |
2234 | UNUSED_PARAM(throwScope); |
2235 | auto& impl = castedThis->wrapped(); |
2236 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "CanvasRenderingContext2D" , "clip" , "Path2D" ); }); |
2237 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2238 | auto fillRule = state->argument(1).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 1, "fillRule" , "CanvasRenderingContext2D" , "clip" , expectedEnumerationValues<CanvasFillRule>()); }); |
2239 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2240 | if (UNLIKELY(impl.callTracingActive())) { |
2241 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2242 | callTracerParameters.append(path); |
2243 | callTracerParameters.append(fillRule); |
2244 | CallTracer::recordCanvasAction(impl, "clip"_s , WTFMove(callTracerParameters)); |
2245 | } |
2246 | impl.clip(*path, WTFMove(fillRule)); |
2247 | return JSValue::encode(jsUndefined()); |
2248 | } |
2249 | |
2250 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionClipOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2251 | { |
2252 | UNUSED_PARAM(state); |
2253 | UNUSED_PARAM(throwScope); |
2254 | VM& vm = state->vm(); |
2255 | UNUSED_PARAM(vm); |
2256 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
2257 | if (argsCount == 0) { |
2258 | return jsCanvasRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
2259 | } |
2260 | if (argsCount == 1) { |
2261 | JSValue distinguishingArg = state->uncheckedArgument(0); |
2262 | if (distinguishingArg.isUndefined()) |
2263 | return jsCanvasRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
2264 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
2265 | return jsCanvasRenderingContext2DPrototypeFunctionClip2Body(state, castedThis, throwScope); |
2266 | return jsCanvasRenderingContext2DPrototypeFunctionClip1Body(state, castedThis, throwScope); |
2267 | } |
2268 | if (argsCount == 2) { |
2269 | return jsCanvasRenderingContext2DPrototypeFunctionClip2Body(state, castedThis, throwScope); |
2270 | } |
2271 | return throwVMTypeError(state, throwScope); |
2272 | } |
2273 | |
2274 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClip(ExecState* state) |
2275 | { |
2276 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionClipOverloadDispatcher>(*state, "clip" ); |
2277 | } |
2278 | |
2279 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2280 | { |
2281 | UNUSED_PARAM(state); |
2282 | UNUSED_PARAM(throwScope); |
2283 | auto& impl = castedThis->wrapped(); |
2284 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
2285 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2286 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
2287 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2288 | auto fillRule = state->argument(2).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(2), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 2, "fillRule" , "CanvasRenderingContext2D" , "isPointInPath" , expectedEnumerationValues<CanvasFillRule>()); }); |
2289 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2290 | if (UNLIKELY(impl.callTracingActive())) { |
2291 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2292 | callTracerParameters.append(x); |
2293 | callTracerParameters.append(y); |
2294 | callTracerParameters.append(fillRule); |
2295 | CallTracer::recordCanvasAction(impl, "isPointInPath"_s , WTFMove(callTracerParameters)); |
2296 | } |
2297 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInPath(WTFMove(x), WTFMove(y), WTFMove(fillRule)))); |
2298 | } |
2299 | |
2300 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2301 | { |
2302 | UNUSED_PARAM(state); |
2303 | UNUSED_PARAM(throwScope); |
2304 | auto& impl = castedThis->wrapped(); |
2305 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "CanvasRenderingContext2D" , "isPointInPath" , "Path2D" ); }); |
2306 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2307 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
2308 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2309 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
2310 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2311 | auto fillRule = state->argument(3).isUndefined() ? CanvasFillRule::Nonzero : convert<IDLEnumeration<CanvasFillRule>>(*state, state->uncheckedArgument(3), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 3, "fillRule" , "CanvasRenderingContext2D" , "isPointInPath" , expectedEnumerationValues<CanvasFillRule>()); }); |
2312 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2313 | if (UNLIKELY(impl.callTracingActive())) { |
2314 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2315 | callTracerParameters.append(path); |
2316 | callTracerParameters.append(x); |
2317 | callTracerParameters.append(y); |
2318 | callTracerParameters.append(fillRule); |
2319 | CallTracer::recordCanvasAction(impl, "isPointInPath"_s , WTFMove(callTracerParameters)); |
2320 | } |
2321 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInPath(*path, WTFMove(x), WTFMove(y), WTFMove(fillRule)))); |
2322 | } |
2323 | |
2324 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionIsPointInPathOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2325 | { |
2326 | UNUSED_PARAM(state); |
2327 | UNUSED_PARAM(throwScope); |
2328 | VM& vm = state->vm(); |
2329 | UNUSED_PARAM(vm); |
2330 | size_t argsCount = std::min<size_t>(4, state->argumentCount()); |
2331 | if (argsCount == 2) { |
2332 | return jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
2333 | } |
2334 | if (argsCount == 3) { |
2335 | JSValue distinguishingArg = state->uncheckedArgument(0); |
2336 | if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSPath2D>(vm)) |
2337 | return jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath2Body(state, castedThis, throwScope); |
2338 | if (distinguishingArg.isNumber()) |
2339 | return jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
2340 | return jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath1Body(state, castedThis, throwScope); |
2341 | } |
2342 | if (argsCount == 4) { |
2343 | return jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath2Body(state, castedThis, throwScope); |
2344 | } |
2345 | return argsCount < 2 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
2346 | } |
2347 | |
2348 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionIsPointInPath(ExecState* state) |
2349 | { |
2350 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionIsPointInPathOverloadDispatcher>(*state, "isPointInPath" ); |
2351 | } |
2352 | |
2353 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionIsPointInStroke1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2354 | { |
2355 | UNUSED_PARAM(state); |
2356 | UNUSED_PARAM(throwScope); |
2357 | auto& impl = castedThis->wrapped(); |
2358 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
2359 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2360 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
2361 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2362 | if (UNLIKELY(impl.callTracingActive())) { |
2363 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2364 | callTracerParameters.append(x); |
2365 | callTracerParameters.append(y); |
2366 | CallTracer::recordCanvasAction(impl, "isPointInStroke"_s , WTFMove(callTracerParameters)); |
2367 | } |
2368 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInStroke(WTFMove(x), WTFMove(y)))); |
2369 | } |
2370 | |
2371 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionIsPointInStroke2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2372 | { |
2373 | UNUSED_PARAM(state); |
2374 | UNUSED_PARAM(throwScope); |
2375 | auto& impl = castedThis->wrapped(); |
2376 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "CanvasRenderingContext2D" , "isPointInStroke" , "Path2D" ); }); |
2377 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2378 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
2379 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2380 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
2381 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2382 | if (UNLIKELY(impl.callTracingActive())) { |
2383 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2384 | callTracerParameters.append(path); |
2385 | callTracerParameters.append(x); |
2386 | callTracerParameters.append(y); |
2387 | CallTracer::recordCanvasAction(impl, "isPointInStroke"_s , WTFMove(callTracerParameters)); |
2388 | } |
2389 | return JSValue::encode(toJS<IDLBoolean>(impl.isPointInStroke(*path, WTFMove(x), WTFMove(y)))); |
2390 | } |
2391 | |
2392 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionIsPointInStrokeOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2393 | { |
2394 | UNUSED_PARAM(state); |
2395 | UNUSED_PARAM(throwScope); |
2396 | VM& vm = state->vm(); |
2397 | UNUSED_PARAM(vm); |
2398 | size_t argsCount = std::min<size_t>(3, state->argumentCount()); |
2399 | if (argsCount == 2) { |
2400 | return jsCanvasRenderingContext2DPrototypeFunctionIsPointInStroke1Body(state, castedThis, throwScope); |
2401 | } |
2402 | if (argsCount == 3) { |
2403 | return jsCanvasRenderingContext2DPrototypeFunctionIsPointInStroke2Body(state, castedThis, throwScope); |
2404 | } |
2405 | return argsCount < 2 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
2406 | } |
2407 | |
2408 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionIsPointInStroke(ExecState* state) |
2409 | { |
2410 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionIsPointInStrokeOverloadDispatcher>(*state, "isPointInStroke" ); |
2411 | } |
2412 | |
2413 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionCreateLinearGradientBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2414 | { |
2415 | UNUSED_PARAM(state); |
2416 | UNUSED_PARAM(throwScope); |
2417 | auto& impl = castedThis->wrapped(); |
2418 | if (UNLIKELY(state->argumentCount() < 4)) |
2419 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2420 | auto x0 = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
2421 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2422 | auto y0 = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
2423 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2424 | auto x1 = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
2425 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2426 | auto y1 = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
2427 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2428 | if (UNLIKELY(impl.callTracingActive())) { |
2429 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2430 | callTracerParameters.append(x0); |
2431 | callTracerParameters.append(y0); |
2432 | callTracerParameters.append(x1); |
2433 | callTracerParameters.append(y1); |
2434 | CallTracer::recordCanvasAction(impl, "createLinearGradient"_s , WTFMove(callTracerParameters)); |
2435 | } |
2436 | return JSValue::encode(toJS<IDLInterface<CanvasGradient>>(*state, *castedThis->globalObject(), throwScope, impl.createLinearGradient(WTFMove(x0), WTFMove(y0), WTFMove(x1), WTFMove(y1)))); |
2437 | } |
2438 | |
2439 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateLinearGradient(ExecState* state) |
2440 | { |
2441 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionCreateLinearGradientBody>(*state, "createLinearGradient" ); |
2442 | } |
2443 | |
2444 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionCreateRadialGradientBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2445 | { |
2446 | UNUSED_PARAM(state); |
2447 | UNUSED_PARAM(throwScope); |
2448 | auto& impl = castedThis->wrapped(); |
2449 | if (UNLIKELY(state->argumentCount() < 6)) |
2450 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2451 | auto x0 = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
2452 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2453 | auto y0 = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
2454 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2455 | auto r0 = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
2456 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2457 | auto x1 = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
2458 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2459 | auto y1 = convert<IDLFloat>(*state, state->uncheckedArgument(4)); |
2460 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2461 | auto r1 = convert<IDLFloat>(*state, state->uncheckedArgument(5)); |
2462 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2463 | if (UNLIKELY(impl.callTracingActive())) { |
2464 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2465 | callTracerParameters.append(x0); |
2466 | callTracerParameters.append(y0); |
2467 | callTracerParameters.append(r0); |
2468 | callTracerParameters.append(x1); |
2469 | callTracerParameters.append(y1); |
2470 | callTracerParameters.append(r1); |
2471 | CallTracer::recordCanvasAction(impl, "createRadialGradient"_s , WTFMove(callTracerParameters)); |
2472 | } |
2473 | return JSValue::encode(toJS<IDLInterface<CanvasGradient>>(*state, *castedThis->globalObject(), throwScope, impl.createRadialGradient(WTFMove(x0), WTFMove(y0), WTFMove(r0), WTFMove(x1), WTFMove(y1), WTFMove(r1)))); |
2474 | } |
2475 | |
2476 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateRadialGradient(ExecState* state) |
2477 | { |
2478 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionCreateRadialGradientBody>(*state, "createRadialGradient" ); |
2479 | } |
2480 | |
2481 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionCreatePatternBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2482 | { |
2483 | UNUSED_PARAM(state); |
2484 | UNUSED_PARAM(throwScope); |
2485 | auto& impl = castedThis->wrapped(); |
2486 | if (UNLIKELY(state->argumentCount() < 2)) |
2487 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2488 | auto image = convert<IDLUnion<IDLInterface<HTMLImageElement>, IDLInterface<HTMLVideoElement>, IDLInterface<HTMLCanvasElement>, IDLInterface<ImageBitmap>>>(*state, state->uncheckedArgument(0)); |
2489 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2490 | auto repetition = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(1)); |
2491 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2492 | if (UNLIKELY(impl.callTracingActive())) { |
2493 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2494 | WTF::visit([&] (auto& value) { callTracerParameters.append(value); }, image); |
2495 | callTracerParameters.append(repetition); |
2496 | CallTracer::recordCanvasAction(impl, "createPattern"_s , WTFMove(callTracerParameters)); |
2497 | } |
2498 | return JSValue::encode(toJS<IDLNullable<IDLInterface<CanvasPattern>>>(*state, *castedThis->globalObject(), throwScope, impl.createPattern(WTFMove(image), WTFMove(repetition)))); |
2499 | } |
2500 | |
2501 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreatePattern(ExecState* state) |
2502 | { |
2503 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionCreatePatternBody>(*state, "createPattern" ); |
2504 | } |
2505 | |
2506 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionCreateImageData1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2507 | { |
2508 | UNUSED_PARAM(state); |
2509 | UNUSED_PARAM(throwScope); |
2510 | auto& impl = castedThis->wrapped(); |
2511 | auto sw = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
2512 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2513 | auto sh = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
2514 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2515 | if (UNLIKELY(impl.callTracingActive())) { |
2516 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2517 | callTracerParameters.append(sw); |
2518 | callTracerParameters.append(sh); |
2519 | CallTracer::recordCanvasAction(impl, "createImageData"_s , WTFMove(callTracerParameters)); |
2520 | } |
2521 | return JSValue::encode(toJS<IDLInterface<ImageData>>(*state, *castedThis->globalObject(), throwScope, impl.createImageData(WTFMove(sw), WTFMove(sh)))); |
2522 | } |
2523 | |
2524 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionCreateImageData2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2525 | { |
2526 | UNUSED_PARAM(state); |
2527 | UNUSED_PARAM(throwScope); |
2528 | auto& impl = castedThis->wrapped(); |
2529 | auto imagedata = convert<IDLInterface<ImageData>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "imagedata" , "CanvasRenderingContext2D" , "createImageData" , "ImageData" ); }); |
2530 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2531 | if (UNLIKELY(impl.callTracingActive())) { |
2532 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2533 | callTracerParameters.append(imagedata); |
2534 | CallTracer::recordCanvasAction(impl, "createImageData"_s , WTFMove(callTracerParameters)); |
2535 | } |
2536 | return JSValue::encode(toJS<IDLInterface<ImageData>>(*state, *castedThis->globalObject(), impl.createImageData(*imagedata))); |
2537 | } |
2538 | |
2539 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionCreateImageDataOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2540 | { |
2541 | UNUSED_PARAM(state); |
2542 | UNUSED_PARAM(throwScope); |
2543 | VM& vm = state->vm(); |
2544 | UNUSED_PARAM(vm); |
2545 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
2546 | if (argsCount == 1) { |
2547 | return jsCanvasRenderingContext2DPrototypeFunctionCreateImageData2Body(state, castedThis, throwScope); |
2548 | } |
2549 | if (argsCount == 2) { |
2550 | return jsCanvasRenderingContext2DPrototypeFunctionCreateImageData1Body(state, castedThis, throwScope); |
2551 | } |
2552 | return argsCount < 1 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
2553 | } |
2554 | |
2555 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateImageData(ExecState* state) |
2556 | { |
2557 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionCreateImageDataOverloadDispatcher>(*state, "createImageData" ); |
2558 | } |
2559 | |
2560 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionGetImageDataBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2561 | { |
2562 | UNUSED_PARAM(state); |
2563 | UNUSED_PARAM(throwScope); |
2564 | auto& impl = castedThis->wrapped(); |
2565 | if (UNLIKELY(state->argumentCount() < 4)) |
2566 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2567 | auto sx = convert<IDLFloat>(*state, state->uncheckedArgument(0)); |
2568 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2569 | auto sy = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
2570 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2571 | auto sw = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
2572 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2573 | auto sh = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
2574 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2575 | if (UNLIKELY(impl.callTracingActive())) { |
2576 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2577 | callTracerParameters.append(sx); |
2578 | callTracerParameters.append(sy); |
2579 | callTracerParameters.append(sw); |
2580 | callTracerParameters.append(sh); |
2581 | CallTracer::recordCanvasAction(impl, "getImageData"_s , WTFMove(callTracerParameters)); |
2582 | } |
2583 | return JSValue::encode(toJS<IDLInterface<ImageData>>(*state, *castedThis->globalObject(), throwScope, impl.getImageData(WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh)))); |
2584 | } |
2585 | |
2586 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetImageData(ExecState* state) |
2587 | { |
2588 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionGetImageDataBody>(*state, "getImageData" ); |
2589 | } |
2590 | |
2591 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionPutImageData1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2592 | { |
2593 | UNUSED_PARAM(state); |
2594 | UNUSED_PARAM(throwScope); |
2595 | auto& impl = castedThis->wrapped(); |
2596 | auto imagedata = convert<IDLInterface<ImageData>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "imagedata" , "CanvasRenderingContext2D" , "putImageData" , "ImageData" ); }); |
2597 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2598 | auto dx = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
2599 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2600 | auto dy = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
2601 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2602 | if (UNLIKELY(impl.callTracingActive())) { |
2603 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2604 | callTracerParameters.append(imagedata); |
2605 | callTracerParameters.append(dx); |
2606 | callTracerParameters.append(dy); |
2607 | CallTracer::recordCanvasAction(impl, "putImageData"_s , WTFMove(callTracerParameters)); |
2608 | } |
2609 | impl.putImageData(*imagedata, WTFMove(dx), WTFMove(dy)); |
2610 | return JSValue::encode(jsUndefined()); |
2611 | } |
2612 | |
2613 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionPutImageData2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2614 | { |
2615 | UNUSED_PARAM(state); |
2616 | UNUSED_PARAM(throwScope); |
2617 | auto& impl = castedThis->wrapped(); |
2618 | auto imagedata = convert<IDLInterface<ImageData>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "imagedata" , "CanvasRenderingContext2D" , "putImageData" , "ImageData" ); }); |
2619 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2620 | auto dx = convert<IDLFloat>(*state, state->uncheckedArgument(1)); |
2621 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2622 | auto dy = convert<IDLFloat>(*state, state->uncheckedArgument(2)); |
2623 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2624 | auto dirtyX = convert<IDLFloat>(*state, state->uncheckedArgument(3)); |
2625 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2626 | auto dirtyY = convert<IDLFloat>(*state, state->uncheckedArgument(4)); |
2627 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2628 | auto dirtyWidth = convert<IDLFloat>(*state, state->uncheckedArgument(5)); |
2629 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2630 | auto dirtyHeight = convert<IDLFloat>(*state, state->uncheckedArgument(6)); |
2631 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2632 | if (UNLIKELY(impl.callTracingActive())) { |
2633 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2634 | callTracerParameters.append(imagedata); |
2635 | callTracerParameters.append(dx); |
2636 | callTracerParameters.append(dy); |
2637 | callTracerParameters.append(dirtyX); |
2638 | callTracerParameters.append(dirtyY); |
2639 | callTracerParameters.append(dirtyWidth); |
2640 | callTracerParameters.append(dirtyHeight); |
2641 | CallTracer::recordCanvasAction(impl, "putImageData"_s , WTFMove(callTracerParameters)); |
2642 | } |
2643 | impl.putImageData(*imagedata, WTFMove(dx), WTFMove(dy), WTFMove(dirtyX), WTFMove(dirtyY), WTFMove(dirtyWidth), WTFMove(dirtyHeight)); |
2644 | return JSValue::encode(jsUndefined()); |
2645 | } |
2646 | |
2647 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionPutImageDataOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2648 | { |
2649 | UNUSED_PARAM(state); |
2650 | UNUSED_PARAM(throwScope); |
2651 | VM& vm = state->vm(); |
2652 | UNUSED_PARAM(vm); |
2653 | size_t argsCount = std::min<size_t>(7, state->argumentCount()); |
2654 | if (argsCount == 3) { |
2655 | return jsCanvasRenderingContext2DPrototypeFunctionPutImageData1Body(state, castedThis, throwScope); |
2656 | } |
2657 | if (argsCount == 7) { |
2658 | return jsCanvasRenderingContext2DPrototypeFunctionPutImageData2Body(state, castedThis, throwScope); |
2659 | } |
2660 | return argsCount < 3 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
2661 | } |
2662 | |
2663 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionPutImageData(ExecState* state) |
2664 | { |
2665 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionPutImageDataOverloadDispatcher>(*state, "putImageData" ); |
2666 | } |
2667 | |
2668 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionClosePathBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2669 | { |
2670 | UNUSED_PARAM(state); |
2671 | UNUSED_PARAM(throwScope); |
2672 | auto& impl = castedThis->wrapped(); |
2673 | if (UNLIKELY(impl.callTracingActive())) |
2674 | CallTracer::recordCanvasAction(impl, "closePath"_s ); |
2675 | impl.closePath(); |
2676 | return JSValue::encode(jsUndefined()); |
2677 | } |
2678 | |
2679 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClosePath(ExecState* state) |
2680 | { |
2681 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionClosePathBody>(*state, "closePath" ); |
2682 | } |
2683 | |
2684 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionMoveToBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2685 | { |
2686 | UNUSED_PARAM(state); |
2687 | UNUSED_PARAM(throwScope); |
2688 | auto& impl = castedThis->wrapped(); |
2689 | if (UNLIKELY(state->argumentCount() < 2)) |
2690 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2691 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2692 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2693 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2694 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2695 | if (UNLIKELY(impl.callTracingActive())) { |
2696 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2697 | callTracerParameters.append(x); |
2698 | callTracerParameters.append(y); |
2699 | CallTracer::recordCanvasAction(impl, "moveTo"_s , WTFMove(callTracerParameters)); |
2700 | } |
2701 | impl.moveTo(WTFMove(x), WTFMove(y)); |
2702 | return JSValue::encode(jsUndefined()); |
2703 | } |
2704 | |
2705 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionMoveTo(ExecState* state) |
2706 | { |
2707 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionMoveToBody>(*state, "moveTo" ); |
2708 | } |
2709 | |
2710 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionLineToBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2711 | { |
2712 | UNUSED_PARAM(state); |
2713 | UNUSED_PARAM(throwScope); |
2714 | auto& impl = castedThis->wrapped(); |
2715 | if (UNLIKELY(state->argumentCount() < 2)) |
2716 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2717 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2718 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2719 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2720 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2721 | if (UNLIKELY(impl.callTracingActive())) { |
2722 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2723 | callTracerParameters.append(x); |
2724 | callTracerParameters.append(y); |
2725 | CallTracer::recordCanvasAction(impl, "lineTo"_s , WTFMove(callTracerParameters)); |
2726 | } |
2727 | impl.lineTo(WTFMove(x), WTFMove(y)); |
2728 | return JSValue::encode(jsUndefined()); |
2729 | } |
2730 | |
2731 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionLineTo(ExecState* state) |
2732 | { |
2733 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionLineToBody>(*state, "lineTo" ); |
2734 | } |
2735 | |
2736 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionQuadraticCurveToBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2737 | { |
2738 | UNUSED_PARAM(state); |
2739 | UNUSED_PARAM(throwScope); |
2740 | auto& impl = castedThis->wrapped(); |
2741 | if (UNLIKELY(state->argumentCount() < 4)) |
2742 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2743 | auto cpx = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2744 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2745 | auto cpy = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2746 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2747 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2748 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2749 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2750 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2751 | if (UNLIKELY(impl.callTracingActive())) { |
2752 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2753 | callTracerParameters.append(cpx); |
2754 | callTracerParameters.append(cpy); |
2755 | callTracerParameters.append(x); |
2756 | callTracerParameters.append(y); |
2757 | CallTracer::recordCanvasAction(impl, "quadraticCurveTo"_s , WTFMove(callTracerParameters)); |
2758 | } |
2759 | impl.quadraticCurveTo(WTFMove(cpx), WTFMove(cpy), WTFMove(x), WTFMove(y)); |
2760 | return JSValue::encode(jsUndefined()); |
2761 | } |
2762 | |
2763 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionQuadraticCurveTo(ExecState* state) |
2764 | { |
2765 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionQuadraticCurveToBody>(*state, "quadraticCurveTo" ); |
2766 | } |
2767 | |
2768 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionBezierCurveToBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2769 | { |
2770 | UNUSED_PARAM(state); |
2771 | UNUSED_PARAM(throwScope); |
2772 | auto& impl = castedThis->wrapped(); |
2773 | if (UNLIKELY(state->argumentCount() < 6)) |
2774 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2775 | auto cp1x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2776 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2777 | auto cp1y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2778 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2779 | auto cp2x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2780 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2781 | auto cp2y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2782 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2783 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
2784 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2785 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
2786 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2787 | if (UNLIKELY(impl.callTracingActive())) { |
2788 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2789 | callTracerParameters.append(cp1x); |
2790 | callTracerParameters.append(cp1y); |
2791 | callTracerParameters.append(cp2x); |
2792 | callTracerParameters.append(cp2y); |
2793 | callTracerParameters.append(x); |
2794 | callTracerParameters.append(y); |
2795 | CallTracer::recordCanvasAction(impl, "bezierCurveTo"_s , WTFMove(callTracerParameters)); |
2796 | } |
2797 | impl.bezierCurveTo(WTFMove(cp1x), WTFMove(cp1y), WTFMove(cp2x), WTFMove(cp2y), WTFMove(x), WTFMove(y)); |
2798 | return JSValue::encode(jsUndefined()); |
2799 | } |
2800 | |
2801 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionBezierCurveTo(ExecState* state) |
2802 | { |
2803 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionBezierCurveToBody>(*state, "bezierCurveTo" ); |
2804 | } |
2805 | |
2806 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionArcToBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2807 | { |
2808 | UNUSED_PARAM(state); |
2809 | UNUSED_PARAM(throwScope); |
2810 | auto& impl = castedThis->wrapped(); |
2811 | if (UNLIKELY(state->argumentCount() < 5)) |
2812 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2813 | auto x1 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2814 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2815 | auto y1 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2816 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2817 | auto x2 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2818 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2819 | auto y2 = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2820 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2821 | auto radius = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
2822 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2823 | if (UNLIKELY(impl.callTracingActive())) { |
2824 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2825 | callTracerParameters.append(x1); |
2826 | callTracerParameters.append(y1); |
2827 | callTracerParameters.append(x2); |
2828 | callTracerParameters.append(y2); |
2829 | callTracerParameters.append(radius); |
2830 | CallTracer::recordCanvasAction(impl, "arcTo"_s , WTFMove(callTracerParameters)); |
2831 | } |
2832 | propagateException(*state, throwScope, impl.arcTo(WTFMove(x1), WTFMove(y1), WTFMove(x2), WTFMove(y2), WTFMove(radius))); |
2833 | return JSValue::encode(jsUndefined()); |
2834 | } |
2835 | |
2836 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionArcTo(ExecState* state) |
2837 | { |
2838 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionArcToBody>(*state, "arcTo" ); |
2839 | } |
2840 | |
2841 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionRectBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2842 | { |
2843 | UNUSED_PARAM(state); |
2844 | UNUSED_PARAM(throwScope); |
2845 | auto& impl = castedThis->wrapped(); |
2846 | if (UNLIKELY(state->argumentCount() < 4)) |
2847 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2848 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2849 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2850 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2851 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2852 | auto w = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2853 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2854 | auto h = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2855 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2856 | if (UNLIKELY(impl.callTracingActive())) { |
2857 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2858 | callTracerParameters.append(x); |
2859 | callTracerParameters.append(y); |
2860 | callTracerParameters.append(w); |
2861 | callTracerParameters.append(h); |
2862 | CallTracer::recordCanvasAction(impl, "rect"_s , WTFMove(callTracerParameters)); |
2863 | } |
2864 | impl.rect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
2865 | return JSValue::encode(jsUndefined()); |
2866 | } |
2867 | |
2868 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionRect(ExecState* state) |
2869 | { |
2870 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionRectBody>(*state, "rect" ); |
2871 | } |
2872 | |
2873 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionArcBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2874 | { |
2875 | UNUSED_PARAM(state); |
2876 | UNUSED_PARAM(throwScope); |
2877 | auto& impl = castedThis->wrapped(); |
2878 | if (UNLIKELY(state->argumentCount() < 5)) |
2879 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2880 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2881 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2882 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2883 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2884 | auto radius = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2885 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2886 | auto startAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2887 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2888 | auto endAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
2889 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2890 | auto anticlockwise = convert<IDLBoolean>(*state, state->argument(5)); |
2891 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2892 | if (UNLIKELY(impl.callTracingActive())) { |
2893 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2894 | callTracerParameters.append(x); |
2895 | callTracerParameters.append(y); |
2896 | callTracerParameters.append(radius); |
2897 | callTracerParameters.append(startAngle); |
2898 | callTracerParameters.append(endAngle); |
2899 | callTracerParameters.append(anticlockwise); |
2900 | CallTracer::recordCanvasAction(impl, "arc"_s , WTFMove(callTracerParameters)); |
2901 | } |
2902 | propagateException(*state, throwScope, impl.arc(WTFMove(x), WTFMove(y), WTFMove(radius), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise))); |
2903 | return JSValue::encode(jsUndefined()); |
2904 | } |
2905 | |
2906 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionArc(ExecState* state) |
2907 | { |
2908 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionArcBody>(*state, "arc" ); |
2909 | } |
2910 | |
2911 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionEllipseBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2912 | { |
2913 | UNUSED_PARAM(state); |
2914 | UNUSED_PARAM(throwScope); |
2915 | auto& impl = castedThis->wrapped(); |
2916 | if (UNLIKELY(state->argumentCount() < 7)) |
2917 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2918 | auto x = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0)); |
2919 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2920 | auto y = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(1)); |
2921 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2922 | auto radiusX = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(2)); |
2923 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2924 | auto radiusY = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(3)); |
2925 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2926 | auto rotation = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(4)); |
2927 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2928 | auto startAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(5)); |
2929 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2930 | auto endAngle = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(6)); |
2931 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2932 | auto anticlockwise = convert<IDLBoolean>(*state, state->argument(7)); |
2933 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2934 | if (UNLIKELY(impl.callTracingActive())) { |
2935 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2936 | callTracerParameters.append(x); |
2937 | callTracerParameters.append(y); |
2938 | callTracerParameters.append(radiusX); |
2939 | callTracerParameters.append(radiusY); |
2940 | callTracerParameters.append(rotation); |
2941 | callTracerParameters.append(startAngle); |
2942 | callTracerParameters.append(endAngle); |
2943 | callTracerParameters.append(anticlockwise); |
2944 | CallTracer::recordCanvasAction(impl, "ellipse"_s , WTFMove(callTracerParameters)); |
2945 | } |
2946 | propagateException(*state, throwScope, impl.ellipse(WTFMove(x), WTFMove(y), WTFMove(radiusX), WTFMove(radiusY), WTFMove(rotation), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise))); |
2947 | return JSValue::encode(jsUndefined()); |
2948 | } |
2949 | |
2950 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionEllipse(ExecState* state) |
2951 | { |
2952 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionEllipseBody>(*state, "ellipse" ); |
2953 | } |
2954 | |
2955 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetLineDashBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2956 | { |
2957 | UNUSED_PARAM(state); |
2958 | UNUSED_PARAM(throwScope); |
2959 | auto& impl = castedThis->wrapped(); |
2960 | if (UNLIKELY(state->argumentCount() < 1)) |
2961 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2962 | auto segments = convert<IDLSequence<IDLUnrestrictedFloat>>(*state, state->uncheckedArgument(0)); |
2963 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2964 | if (UNLIKELY(impl.callTracingActive())) { |
2965 | Vector<RecordCanvasActionVariant> callTracerParameters; |
2966 | callTracerParameters.append(segments); |
2967 | CallTracer::recordCanvasAction(impl, "setLineDash"_s , WTFMove(callTracerParameters)); |
2968 | } |
2969 | impl.setLineDash(WTFMove(segments)); |
2970 | return JSValue::encode(jsUndefined()); |
2971 | } |
2972 | |
2973 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineDash(ExecState* state) |
2974 | { |
2975 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetLineDashBody>(*state, "setLineDash" ); |
2976 | } |
2977 | |
2978 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionGetLineDashBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2979 | { |
2980 | UNUSED_PARAM(state); |
2981 | UNUSED_PARAM(throwScope); |
2982 | auto& impl = castedThis->wrapped(); |
2983 | if (UNLIKELY(impl.callTracingActive())) |
2984 | CallTracer::recordCanvasAction(impl, "getLineDash"_s ); |
2985 | return JSValue::encode(toJS<IDLSequence<IDLUnrestrictedFloat>>(*state, *castedThis->globalObject(), impl.getLineDash())); |
2986 | } |
2987 | |
2988 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetLineDash(ExecState* state) |
2989 | { |
2990 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionGetLineDashBody>(*state, "getLineDash" ); |
2991 | } |
2992 | |
2993 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionClearRectBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2994 | { |
2995 | UNUSED_PARAM(state); |
2996 | UNUSED_PARAM(throwScope); |
2997 | auto& impl = castedThis->wrapped(); |
2998 | if (UNLIKELY(state->argumentCount() < 4)) |
2999 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3000 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3001 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3002 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3003 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3004 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
3005 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3006 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
3007 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3008 | if (UNLIKELY(impl.callTracingActive())) { |
3009 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3010 | callTracerParameters.append(x); |
3011 | callTracerParameters.append(y); |
3012 | callTracerParameters.append(w); |
3013 | callTracerParameters.append(h); |
3014 | CallTracer::recordCanvasAction(impl, "clearRect"_s , WTFMove(callTracerParameters)); |
3015 | } |
3016 | impl.clearRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
3017 | return JSValue::encode(jsUndefined()); |
3018 | } |
3019 | |
3020 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionClearRect(ExecState* state) |
3021 | { |
3022 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionClearRectBody>(*state, "clearRect" ); |
3023 | } |
3024 | |
3025 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionFillRectBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3026 | { |
3027 | UNUSED_PARAM(state); |
3028 | UNUSED_PARAM(throwScope); |
3029 | auto& impl = castedThis->wrapped(); |
3030 | if (UNLIKELY(state->argumentCount() < 4)) |
3031 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3032 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3033 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3034 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3035 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3036 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
3037 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3038 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
3039 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3040 | if (UNLIKELY(impl.callTracingActive())) { |
3041 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3042 | callTracerParameters.append(x); |
3043 | callTracerParameters.append(y); |
3044 | callTracerParameters.append(w); |
3045 | callTracerParameters.append(h); |
3046 | CallTracer::recordCanvasAction(impl, "fillRect"_s , WTFMove(callTracerParameters)); |
3047 | } |
3048 | impl.fillRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
3049 | return JSValue::encode(jsUndefined()); |
3050 | } |
3051 | |
3052 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionFillRect(ExecState* state) |
3053 | { |
3054 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionFillRectBody>(*state, "fillRect" ); |
3055 | } |
3056 | |
3057 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionStrokeRectBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3058 | { |
3059 | UNUSED_PARAM(state); |
3060 | UNUSED_PARAM(throwScope); |
3061 | auto& impl = castedThis->wrapped(); |
3062 | if (UNLIKELY(state->argumentCount() < 4)) |
3063 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3064 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3065 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3066 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3067 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3068 | auto w = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
3069 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3070 | auto h = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
3071 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3072 | if (UNLIKELY(impl.callTracingActive())) { |
3073 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3074 | callTracerParameters.append(x); |
3075 | callTracerParameters.append(y); |
3076 | callTracerParameters.append(w); |
3077 | callTracerParameters.append(h); |
3078 | CallTracer::recordCanvasAction(impl, "strokeRect"_s , WTFMove(callTracerParameters)); |
3079 | } |
3080 | impl.strokeRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); |
3081 | return JSValue::encode(jsUndefined()); |
3082 | } |
3083 | |
3084 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStrokeRect(ExecState* state) |
3085 | { |
3086 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionStrokeRectBody>(*state, "strokeRect" ); |
3087 | } |
3088 | |
3089 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSaveBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3090 | { |
3091 | UNUSED_PARAM(state); |
3092 | UNUSED_PARAM(throwScope); |
3093 | auto& impl = castedThis->wrapped(); |
3094 | if (UNLIKELY(impl.callTracingActive())) |
3095 | CallTracer::recordCanvasAction(impl, "save"_s ); |
3096 | impl.save(); |
3097 | return JSValue::encode(jsUndefined()); |
3098 | } |
3099 | |
3100 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSave(ExecState* state) |
3101 | { |
3102 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSaveBody>(*state, "save" ); |
3103 | } |
3104 | |
3105 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionRestoreBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3106 | { |
3107 | UNUSED_PARAM(state); |
3108 | UNUSED_PARAM(throwScope); |
3109 | auto& impl = castedThis->wrapped(); |
3110 | if (UNLIKELY(impl.callTracingActive())) |
3111 | CallTracer::recordCanvasAction(impl, "restore"_s ); |
3112 | impl.restore(); |
3113 | return JSValue::encode(jsUndefined()); |
3114 | } |
3115 | |
3116 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionRestore(ExecState* state) |
3117 | { |
3118 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionRestoreBody>(*state, "restore" ); |
3119 | } |
3120 | |
3121 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionFillTextBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3122 | { |
3123 | UNUSED_PARAM(state); |
3124 | UNUSED_PARAM(throwScope); |
3125 | auto& impl = castedThis->wrapped(); |
3126 | if (UNLIKELY(state->argumentCount() < 3)) |
3127 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3128 | auto text = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
3129 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3130 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3131 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3132 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
3133 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3134 | auto maxWidth = state->argument(3).isUndefined() ? Optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : Optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3))); |
3135 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3136 | if (UNLIKELY(impl.callTracingActive())) { |
3137 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3138 | callTracerParameters.append(text); |
3139 | callTracerParameters.append(x); |
3140 | callTracerParameters.append(y); |
3141 | if (maxWidth) |
3142 | callTracerParameters.append(*maxWidth); |
3143 | CallTracer::recordCanvasAction(impl, "fillText"_s , WTFMove(callTracerParameters)); |
3144 | } |
3145 | impl.fillText(WTFMove(text), WTFMove(x), WTFMove(y), WTFMove(maxWidth)); |
3146 | return JSValue::encode(jsUndefined()); |
3147 | } |
3148 | |
3149 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionFillText(ExecState* state) |
3150 | { |
3151 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionFillTextBody>(*state, "fillText" ); |
3152 | } |
3153 | |
3154 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionStrokeTextBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3155 | { |
3156 | UNUSED_PARAM(state); |
3157 | UNUSED_PARAM(throwScope); |
3158 | auto& impl = castedThis->wrapped(); |
3159 | if (UNLIKELY(state->argumentCount() < 3)) |
3160 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3161 | auto text = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
3162 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3163 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3164 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3165 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
3166 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3167 | auto maxWidth = state->argument(3).isUndefined() ? Optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : Optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3))); |
3168 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3169 | if (UNLIKELY(impl.callTracingActive())) { |
3170 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3171 | callTracerParameters.append(text); |
3172 | callTracerParameters.append(x); |
3173 | callTracerParameters.append(y); |
3174 | if (maxWidth) |
3175 | callTracerParameters.append(*maxWidth); |
3176 | CallTracer::recordCanvasAction(impl, "strokeText"_s , WTFMove(callTracerParameters)); |
3177 | } |
3178 | impl.strokeText(WTFMove(text), WTFMove(x), WTFMove(y), WTFMove(maxWidth)); |
3179 | return JSValue::encode(jsUndefined()); |
3180 | } |
3181 | |
3182 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStrokeText(ExecState* state) |
3183 | { |
3184 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionStrokeTextBody>(*state, "strokeText" ); |
3185 | } |
3186 | |
3187 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionMeasureTextBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3188 | { |
3189 | UNUSED_PARAM(state); |
3190 | UNUSED_PARAM(throwScope); |
3191 | auto& impl = castedThis->wrapped(); |
3192 | if (UNLIKELY(state->argumentCount() < 1)) |
3193 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3194 | auto text = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
3195 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3196 | if (UNLIKELY(impl.callTracingActive())) { |
3197 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3198 | callTracerParameters.append(text); |
3199 | CallTracer::recordCanvasAction(impl, "measureText"_s , WTFMove(callTracerParameters)); |
3200 | } |
3201 | return JSValue::encode(toJS<IDLInterface<TextMetrics>>(*state, *castedThis->globalObject(), impl.measureText(WTFMove(text)))); |
3202 | } |
3203 | |
3204 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionMeasureText(ExecState* state) |
3205 | { |
3206 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionMeasureTextBody>(*state, "measureText" ); |
3207 | } |
3208 | |
3209 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionScaleBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3210 | { |
3211 | UNUSED_PARAM(state); |
3212 | UNUSED_PARAM(throwScope); |
3213 | auto& impl = castedThis->wrapped(); |
3214 | if (UNLIKELY(state->argumentCount() < 2)) |
3215 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3216 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3217 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3218 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3219 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3220 | if (UNLIKELY(impl.callTracingActive())) { |
3221 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3222 | callTracerParameters.append(x); |
3223 | callTracerParameters.append(y); |
3224 | CallTracer::recordCanvasAction(impl, "scale"_s , WTFMove(callTracerParameters)); |
3225 | } |
3226 | impl.scale(WTFMove(x), WTFMove(y)); |
3227 | return JSValue::encode(jsUndefined()); |
3228 | } |
3229 | |
3230 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionScale(ExecState* state) |
3231 | { |
3232 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionScaleBody>(*state, "scale" ); |
3233 | } |
3234 | |
3235 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionRotateBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3236 | { |
3237 | UNUSED_PARAM(state); |
3238 | UNUSED_PARAM(throwScope); |
3239 | auto& impl = castedThis->wrapped(); |
3240 | if (UNLIKELY(state->argumentCount() < 1)) |
3241 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3242 | auto angle = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3243 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3244 | if (UNLIKELY(impl.callTracingActive())) { |
3245 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3246 | callTracerParameters.append(angle); |
3247 | CallTracer::recordCanvasAction(impl, "rotate"_s , WTFMove(callTracerParameters)); |
3248 | } |
3249 | impl.rotate(WTFMove(angle)); |
3250 | return JSValue::encode(jsUndefined()); |
3251 | } |
3252 | |
3253 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionRotate(ExecState* state) |
3254 | { |
3255 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionRotateBody>(*state, "rotate" ); |
3256 | } |
3257 | |
3258 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionTranslateBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3259 | { |
3260 | UNUSED_PARAM(state); |
3261 | UNUSED_PARAM(throwScope); |
3262 | auto& impl = castedThis->wrapped(); |
3263 | if (UNLIKELY(state->argumentCount() < 2)) |
3264 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3265 | auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3266 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3267 | auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3268 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3269 | if (UNLIKELY(impl.callTracingActive())) { |
3270 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3271 | callTracerParameters.append(x); |
3272 | callTracerParameters.append(y); |
3273 | CallTracer::recordCanvasAction(impl, "translate"_s , WTFMove(callTracerParameters)); |
3274 | } |
3275 | impl.translate(WTFMove(x), WTFMove(y)); |
3276 | return JSValue::encode(jsUndefined()); |
3277 | } |
3278 | |
3279 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionTranslate(ExecState* state) |
3280 | { |
3281 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionTranslateBody>(*state, "translate" ); |
3282 | } |
3283 | |
3284 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionTransformBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3285 | { |
3286 | UNUSED_PARAM(state); |
3287 | UNUSED_PARAM(throwScope); |
3288 | auto& impl = castedThis->wrapped(); |
3289 | if (UNLIKELY(state->argumentCount() < 6)) |
3290 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
3291 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3292 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3293 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3294 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3295 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
3296 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3297 | auto d = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
3298 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3299 | auto e = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
3300 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3301 | auto f = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
3302 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3303 | if (UNLIKELY(impl.callTracingActive())) { |
3304 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3305 | callTracerParameters.append(a); |
3306 | callTracerParameters.append(b); |
3307 | callTracerParameters.append(c); |
3308 | callTracerParameters.append(d); |
3309 | callTracerParameters.append(e); |
3310 | callTracerParameters.append(f); |
3311 | CallTracer::recordCanvasAction(impl, "transform"_s , WTFMove(callTracerParameters)); |
3312 | } |
3313 | impl.transform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); |
3314 | return JSValue::encode(jsUndefined()); |
3315 | } |
3316 | |
3317 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionTransform(ExecState* state) |
3318 | { |
3319 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionTransformBody>(*state, "transform" ); |
3320 | } |
3321 | |
3322 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionGetTransformBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3323 | { |
3324 | UNUSED_PARAM(state); |
3325 | UNUSED_PARAM(throwScope); |
3326 | auto& impl = castedThis->wrapped(); |
3327 | if (UNLIKELY(impl.callTracingActive())) |
3328 | CallTracer::recordCanvasAction(impl, "getTransform"_s ); |
3329 | return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMMatrix>>(*state, *castedThis->globalObject(), impl.getTransform())); |
3330 | } |
3331 | |
3332 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetTransform(ExecState* state) |
3333 | { |
3334 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionGetTransformBody>(*state, "getTransform" ); |
3335 | } |
3336 | |
3337 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetTransform1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3338 | { |
3339 | UNUSED_PARAM(state); |
3340 | UNUSED_PARAM(throwScope); |
3341 | auto& impl = castedThis->wrapped(); |
3342 | auto a = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0)); |
3343 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3344 | auto b = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1)); |
3345 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3346 | auto c = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2)); |
3347 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3348 | auto d = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(3)); |
3349 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3350 | auto e = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)); |
3351 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3352 | auto f = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(5)); |
3353 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3354 | if (UNLIKELY(impl.callTracingActive())) { |
3355 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3356 | callTracerParameters.append(a); |
3357 | callTracerParameters.append(b); |
3358 | callTracerParameters.append(c); |
3359 | callTracerParameters.append(d); |
3360 | callTracerParameters.append(e); |
3361 | callTracerParameters.append(f); |
3362 | CallTracer::recordCanvasAction(impl, "setTransform"_s , WTFMove(callTracerParameters)); |
3363 | } |
3364 | impl.setTransform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); |
3365 | return JSValue::encode(jsUndefined()); |
3366 | } |
3367 | |
3368 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetTransform2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3369 | { |
3370 | UNUSED_PARAM(state); |
3371 | UNUSED_PARAM(throwScope); |
3372 | auto& impl = castedThis->wrapped(); |
3373 | auto transform = convert<IDLDictionary<DOMMatrix2DInit>>(*state, state->argument(0)); |
3374 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3375 | if (UNLIKELY(impl.callTracingActive())) { |
3376 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3377 | callTracerParameters.append(transform); |
3378 | CallTracer::recordCanvasAction(impl, "setTransform"_s , WTFMove(callTracerParameters)); |
3379 | } |
3380 | propagateException(*state, throwScope, impl.setTransform(WTFMove(transform))); |
3381 | return JSValue::encode(jsUndefined()); |
3382 | } |
3383 | |
3384 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionSetTransformOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3385 | { |
3386 | UNUSED_PARAM(state); |
3387 | UNUSED_PARAM(throwScope); |
3388 | VM& vm = state->vm(); |
3389 | UNUSED_PARAM(vm); |
3390 | size_t argsCount = std::min<size_t>(6, state->argumentCount()); |
3391 | if (argsCount == 0) { |
3392 | return jsCanvasRenderingContext2DPrototypeFunctionSetTransform2Body(state, castedThis, throwScope); |
3393 | } |
3394 | if (argsCount == 1) { |
3395 | return jsCanvasRenderingContext2DPrototypeFunctionSetTransform2Body(state, castedThis, throwScope); |
3396 | } |
3397 | if (argsCount == 6) { |
3398 | return jsCanvasRenderingContext2DPrototypeFunctionSetTransform1Body(state, castedThis, throwScope); |
3399 | } |
3400 | return throwVMTypeError(state, throwScope); |
3401 | } |
3402 | |
3403 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetTransform(ExecState* state) |
3404 | { |
3405 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionSetTransformOverloadDispatcher>(*state, "setTransform" ); |
3406 | } |
3407 | |
3408 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionResetTransformBody(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3409 | { |
3410 | UNUSED_PARAM(state); |
3411 | UNUSED_PARAM(throwScope); |
3412 | auto& impl = castedThis->wrapped(); |
3413 | if (UNLIKELY(impl.callTracingActive())) |
3414 | CallTracer::recordCanvasAction(impl, "resetTransform"_s ); |
3415 | impl.resetTransform(); |
3416 | return JSValue::encode(jsUndefined()); |
3417 | } |
3418 | |
3419 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionResetTransform(ExecState* state) |
3420 | { |
3421 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionResetTransformBody>(*state, "resetTransform" ); |
3422 | } |
3423 | |
3424 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeeded1Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3425 | { |
3426 | UNUSED_PARAM(state); |
3427 | UNUSED_PARAM(throwScope); |
3428 | auto& impl = castedThis->wrapped(); |
3429 | auto element = convert<IDLInterface<Element>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "element" , "CanvasRenderingContext2D" , "drawFocusIfNeeded" , "Element" ); }); |
3430 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3431 | if (UNLIKELY(impl.callTracingActive())) { |
3432 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3433 | callTracerParameters.append(element); |
3434 | CallTracer::recordCanvasAction(impl, "drawFocusIfNeeded"_s , WTFMove(callTracerParameters)); |
3435 | } |
3436 | impl.drawFocusIfNeeded(*element); |
3437 | return JSValue::encode(jsUndefined()); |
3438 | } |
3439 | |
3440 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeeded2Body(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3441 | { |
3442 | UNUSED_PARAM(state); |
3443 | UNUSED_PARAM(throwScope); |
3444 | auto& impl = castedThis->wrapped(); |
3445 | auto path = convert<IDLInterface<Path2D>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "path" , "CanvasRenderingContext2D" , "drawFocusIfNeeded" , "Path2D" ); }); |
3446 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3447 | auto element = convert<IDLInterface<Element>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "element" , "CanvasRenderingContext2D" , "drawFocusIfNeeded" , "Element" ); }); |
3448 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
3449 | if (UNLIKELY(impl.callTracingActive())) { |
3450 | Vector<RecordCanvasActionVariant> callTracerParameters; |
3451 | callTracerParameters.append(path); |
3452 | callTracerParameters.append(element); |
3453 | CallTracer::recordCanvasAction(impl, "drawFocusIfNeeded"_s , WTFMove(callTracerParameters)); |
3454 | } |
3455 | impl.drawFocusIfNeeded(*path, *element); |
3456 | return JSValue::encode(jsUndefined()); |
3457 | } |
3458 | |
3459 | static inline JSC::EncodedJSValue jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeededOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSCanvasRenderingContext2D>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
3460 | { |
3461 | UNUSED_PARAM(state); |
3462 | UNUSED_PARAM(throwScope); |
3463 | VM& vm = state->vm(); |
3464 | UNUSED_PARAM(vm); |
3465 | size_t argsCount = std::min<size_t>(2, state->argumentCount()); |
3466 | if (argsCount == 1) { |
3467 | return jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeeded1Body(state, castedThis, throwScope); |
3468 | } |
3469 | if (argsCount == 2) { |
3470 | return jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeeded2Body(state, castedThis, throwScope); |
3471 | } |
3472 | return argsCount < 1 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
3473 | } |
3474 | |
3475 | EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeeded(ExecState* state) |
3476 | { |
3477 | return IDLOperation<JSCanvasRenderingContext2D>::call<jsCanvasRenderingContext2DPrototypeFunctionDrawFocusIfNeededOverloadDispatcher>(*state, "drawFocusIfNeeded" ); |
3478 | } |
3479 | |
3480 | void JSCanvasRenderingContext2D::visitChildren(JSCell* cell, SlotVisitor& visitor) |
3481 | { |
3482 | auto* thisObject = jsCast<JSCanvasRenderingContext2D*>(cell); |
3483 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
3484 | Base::visitChildren(thisObject, visitor); |
3485 | thisObject->visitAdditionalChildren(visitor); |
3486 | } |
3487 | |
3488 | void JSCanvasRenderingContext2D::visitOutputConstraints(JSCell* cell, SlotVisitor& visitor) |
3489 | { |
3490 | auto* thisObject = jsCast<JSCanvasRenderingContext2D*>(cell); |
3491 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
3492 | Base::visitOutputConstraints(thisObject, visitor); |
3493 | thisObject->visitAdditionalChildren(visitor); |
3494 | } |
3495 | |
3496 | void JSCanvasRenderingContext2D::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
3497 | { |
3498 | auto* thisObject = jsCast<JSCanvasRenderingContext2D*>(cell); |
3499 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
3500 | if (thisObject->scriptExecutionContext()) |
3501 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
3502 | Base::heapSnapshot(cell, builder); |
3503 | } |
3504 | |
3505 | void JSCanvasRenderingContext2DOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
3506 | { |
3507 | auto* jsCanvasRenderingContext2D = static_cast<JSCanvasRenderingContext2D*>(handle.slot()->asCell()); |
3508 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
3509 | uncacheWrapper(world, &jsCanvasRenderingContext2D->wrapped(), jsCanvasRenderingContext2D); |
3510 | } |
3511 | |
3512 | #if ENABLE(BINDING_INTEGRITY) |
3513 | #if PLATFORM(WIN) |
3514 | #pragma warning(disable: 4483) |
3515 | extern "C" { extern void (*const __identifier("??_7CanvasRenderingContext2D@WebCore@@6B@" )[])(); } |
3516 | #else |
3517 | extern "C" { extern void* _ZTVN7WebCore24CanvasRenderingContext2DE[]; } |
3518 | #endif |
3519 | #endif |
3520 | |
3521 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<CanvasRenderingContext2D>&& impl) |
3522 | { |
3523 | |
3524 | #if ENABLE(BINDING_INTEGRITY) |
3525 | void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
3526 | #if PLATFORM(WIN) |
3527 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7CanvasRenderingContext2D@WebCore@@6B@" )); |
3528 | #else |
3529 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore24CanvasRenderingContext2DE[2]); |
3530 | #endif |
3531 | |
3532 | // If this fails CanvasRenderingContext2D does not have a vtable, so you need to add the |
3533 | // ImplementationLacksVTable attribute to the interface definition |
3534 | static_assert(std::is_polymorphic<CanvasRenderingContext2D>::value, "CanvasRenderingContext2D is not polymorphic" ); |
3535 | |
3536 | // If you hit this assertion you either have a use after free bug, or |
3537 | // CanvasRenderingContext2D has subclasses. If CanvasRenderingContext2D has subclasses that get passed |
3538 | // to toJS() we currently require CanvasRenderingContext2D you to opt out of binding hardening |
3539 | // by adding the SkipVTableValidation attribute to the interface IDL definition |
3540 | RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
3541 | #endif |
3542 | return createWrapper<CanvasRenderingContext2D>(globalObject, WTFMove(impl)); |
3543 | } |
3544 | |
3545 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, CanvasRenderingContext2D& impl) |
3546 | { |
3547 | return wrap(state, globalObject, impl); |
3548 | } |
3549 | |
3550 | CanvasRenderingContext2D* JSCanvasRenderingContext2D::toWrapped(JSC::VM& vm, JSC::JSValue value) |
3551 | { |
3552 | if (auto* wrapper = jsDynamicCast<JSCanvasRenderingContext2D*>(vm, value)) |
3553 | return &wrapper->wrapped(); |
3554 | return nullptr; |
3555 | } |
3556 | |
3557 | } |
3558 | |