Skip to content

Commit

Permalink
Merge branch 'feat/path_2d' of https://github.com/openwebf/webf into …
Browse files Browse the repository at this point in the history
…feat/path_2d
  • Loading branch information
jwxbond committed Nov 9, 2024
2 parents b3fa334 + 3408d45 commit ea7ba71
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ if (${WEBF_JS_ENGINE} MATCHES "quickjs")
out/qjs_union_double_sequencedouble.cc
out/qjs_unionhtml_image_elementhtml_canvas_element.cc
out/qjs_union_dom_stringcanvas_gradient.cc
out/qjs_union_sequencedoubledom_matrix_init.cc
out/qjs_union_sequencedoubledom_matrixdom_matrix_init.cc
out/qjs_union_doubledom_point_init.cc
out/canvas_types.cc
out/qjs_html_button_element.cc
Expand Down
4 changes: 2 additions & 2 deletions bridge/core/geometry/dom_matrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace webf {

DOMMatrix* DOMMatrix::Create(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state) {
return MakeGarbageCollected<DOMMatrix>(context, init, exception_state);
}
Expand All @@ -21,7 +21,7 @@ DOMMatrix::DOMMatrix(webf::ExecutingContext* context, webf::ExceptionState& exce
DOMMatrixReadOnly(context, exception_state) {}

DOMMatrix::DOMMatrix(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state)
: DOMMatrixReadOnly(context, init, exception_state) {}

Expand Down
2 changes: 1 addition & 1 deletion bridge/core/geometry/dom_matrix.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import {DOMMatrixInit} from "./dom_matrix_init";
import {DOMMatrixReadOnly} from "./dom_matrix_read_only";

interface DOMMatrix extends DOMMatrixReadOnly {
new(init?: number[] | DOMMatrixInit): DOMMatrix;
new(init?: number[] | DOMMatrix | DOMMatrixInit): DOMMatrix;
}
4 changes: 2 additions & 2 deletions bridge/core/geometry/dom_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DOMMatrix : public DOMMatrixReadOnly {
public:
using ImplType = DOMMatrix*;
static DOMMatrix* Create(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state);
static DOMMatrix* Create(ExecutingContext* context,
ExceptionState& exception_state);
Expand All @@ -24,7 +24,7 @@ class DOMMatrix : public DOMMatrixReadOnly {
explicit DOMMatrix(ExecutingContext* context,
ExceptionState& exception_state);
explicit DOMMatrix(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state);
explicit DOMMatrix(ExecutingContext* context,
NativeBindingObject* native_binding_object);
Expand Down
11 changes: 9 additions & 2 deletions bridge/core/geometry/dom_matrix_read_only.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace webf {
DOMMatrixReadOnly* DOMMatrixReadOnly::Create(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state) {
return MakeGarbageCollected<DOMMatrixReadOnly>(context, init, exception_state);
}
Expand Down Expand Up @@ -44,7 +44,7 @@ DOMMatrix* DOMMatrixReadOnly::fromMatrix(ExecutingContext* context,
}

DOMMatrixReadOnly::DOMMatrixReadOnly(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state)
: BindingObject(context->ctx()) {

Expand All @@ -54,6 +54,13 @@ DOMMatrixReadOnly::DOMMatrixReadOnly(ExecutingContext* context,
GetExecutingContext()->dartMethodPtr()->createBindingObject(GetExecutingContext()->isDedicated(),
GetExecutingContext()->contextId(), bindingObject(),
CreateBindingObjectType::kCreateDOMMatrix, arguments, 1);
} else if(init->IsDOMMatrix()) {
auto domMatrix = init->GetAsDOMMatrix();
NativeValue arguments[1];
arguments[0] = NativeValueConverter<NativeTypePointer<DOMMatrix>>::ToNativeValue(init->GetAsDOMMatrix());
GetExecutingContext()->dartMethodPtr()->createBindingObject(GetExecutingContext()->isDedicated(),
GetExecutingContext()->contextId(), bindingObject(),
CreateBindingObjectType::kCreateDOMMatrix, arguments, 1);
} else if (init->IsDOMMatrixInit()) {
std::vector<double> domMatrixInitVectorDouble;
auto domMatrixInit = init->GetAsDOMMatrixInit();
Expand Down
2 changes: 1 addition & 1 deletion bridge/core/geometry/dom_matrix_read_only.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ interface DOMMatrixReadOnly {
// fromFloat32Array(): StaticMethod<DOMMatrix>;
// fromFloat64Array(): StaticMethod<DOMMatrix>;
fromMatrix(matrix: DOMMatrix): StaticMethod<DOMMatrix>;
new(init?: number[] | DOMMatrixInit): DOMMatrixReadOnly;
new(init?: number[] | DOMMatrix | DOMMatrixInit): DOMMatrixReadOnly;
}
6 changes: 3 additions & 3 deletions bridge/core/geometry/dom_matrix_read_only.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "bindings/qjs/script_wrappable.h"
#include "core/binding_object.h"
#include "qjs_dom_matrix_init.h"
#include "qjs_union_sequencedoubledom_matrix_init.h"
#include "qjs_union_sequencedoubledom_matrixdom_matrix_init.h"

namespace webf {

Expand All @@ -21,15 +21,15 @@ class DOMMatrixReadOnly : public BindingObject {
public:
using ImplType = DOMMatrixReadOnly*;
static DOMMatrixReadOnly* Create(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state);
static DOMMatrixReadOnly* Create(ExecutingContext* context,
ExceptionState& exception_state);
static DOMMatrix* fromMatrix(ExecutingContext* context, DOMMatrixReadOnly* matrix, ExceptionState& exception_state);

DOMMatrixReadOnly() = delete;
explicit DOMMatrixReadOnly(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixDOMMatrixInit>& init,
ExceptionState& exception_state);
explicit DOMMatrixReadOnly(ExecutingContext* context, ExceptionState& exception_state);

Expand Down

0 comments on commit ea7ba71

Please sign in to comment.