aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc
diff options
context:
space:
mode:
Diffstat (limited to 'src/javascript/jsc')
-rw-r--r--src/javascript/jsc/bindings/Blob.h8
-rw-r--r--src/javascript/jsc/bindings/headers-handwritten.h2
-rw-r--r--src/javascript/jsc/bindings/webcore/CanvasImageSource.h15
-rw-r--r--src/javascript/jsc/bindings/webcore/DOMMatrix.h46
-rw-r--r--src/javascript/jsc/bindings/webcore/OffscreenCanvasRenderingContext2D.h60
5 files changed, 129 insertions, 2 deletions
diff --git a/src/javascript/jsc/bindings/Blob.h b/src/javascript/jsc/bindings/Blob.h
new file mode 100644
index 000000000..b6840415d
--- /dev/null
+++ b/src/javascript/jsc/bindings/Blob.h
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "root.h"
+
+namespace WebCore {
+using Blob = Bun__Blob;
+
+} \ No newline at end of file
diff --git a/src/javascript/jsc/bindings/headers-handwritten.h b/src/javascript/jsc/bindings/headers-handwritten.h
index a190d694a..b9c5f04cc 100644
--- a/src/javascript/jsc/bindings/headers-handwritten.h
+++ b/src/javascript/jsc/bindings/headers-handwritten.h
@@ -176,6 +176,8 @@ typedef struct {
uint64_t _value;
} Bun__ArrayBuffer;
+typedef struct Bun__Blob Bun__Blob;
+
#ifndef STRING_POINTER
#define STRING_POINTER
typedef struct StringPointer {
diff --git a/src/javascript/jsc/bindings/webcore/CanvasImageSource.h b/src/javascript/jsc/bindings/webcore/CanvasImageSource.h
new file mode 100644
index 000000000..465542e72
--- /dev/null
+++ b/src/javascript/jsc/bindings/webcore/CanvasImageSource.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "root.h"
+#include "include/core/SkImage.h"
+
+namespace WebCore {
+
+class CanvasImageSource : public RefCounted<CanvasImageSource> {
+ WTF_MAKE_ISO_ALLOCATED(CanvasImageSource);
+
+public:
+ m_blob* WebCore::Blob;
+};
+
+} // namespace WebCore \ No newline at end of file
diff --git a/src/javascript/jsc/bindings/webcore/DOMMatrix.h b/src/javascript/jsc/bindings/webcore/DOMMatrix.h
new file mode 100644
index 000000000..168db3d3b
--- /dev/null
+++ b/src/javascript/jsc/bindings/webcore/DOMMatrix.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "DOMMatrix2DInit.h"
+
+namespace WebCore {
+
+struct DOMMatrixInit : DOMMatrix2DInit {
+ double m13 { 0 };
+ double m14 { 0 };
+ double m23 { 0 };
+ double m24 { 0 };
+ double m31 { 0 };
+ double m32 { 0 };
+ double m33 { 1 };
+ double m34 { 0 };
+ double m43 { 0 };
+ double m44 { 1 };
+ std::optional<bool> is2D;
+};
+
+} // namespace WebCore
diff --git a/src/javascript/jsc/bindings/webcore/OffscreenCanvasRenderingContext2D.h b/src/javascript/jsc/bindings/webcore/OffscreenCanvasRenderingContext2D.h
index cdf5fa78a..3d6edaf16 100644
--- a/src/javascript/jsc/bindings/webcore/OffscreenCanvasRenderingContext2D.h
+++ b/src/javascript/jsc/bindings/webcore/OffscreenCanvasRenderingContext2D.h
@@ -7,6 +7,19 @@
#include "CanvasRenderingContext2DSettings.h"
#include "CanvasDirection.h"
#include "CanvasPath.h"
+#include "CanvasTextAlign.h"
+#include "CanvasLineCap.h"
+#include "CanvasLineJoin.h"
+#include "CanvasGradient.h"
+#include "CanvasPattern.h"
+#include "CanvasTextBaseline.h"
+#include "ImageSmoothingQuality.h"
+#include "CanvasFillRule.h"
+#include "ImageData.h"
+#include "CanvasImageSource.h"
+
+#include "include/core/SKPaint.h"
+#include "include/core/SKColor.h"
namespace WebCore {
@@ -154,8 +167,6 @@ public:
void setPath(Path2D&);
Ref<Path2D> getPath() const;
- void setUsesDisplayListDrawing(bool flag) { m_usesDisplayListDrawing = flag; };
-
String font() const { return state().fontString(); }
CanvasTextAlign textAlign() const { return state().canvasTextAlign(); }
@@ -168,10 +179,55 @@ public:
void setDirection(Direction);
private:
+ using LineCap = SKPaint::Cap;
+ using LineJoin = SKPaint::Join;
+ using CanvasStyle = SKPaint::Style;
+ using Color = SKColor;
+
+ struct State final {
+ State();
+
+ String unparsedStrokeColor;
+ String unparsedFillColor;
+ CanvasStyle strokeStyle;
+ CanvasStyle fillStyle;
+ double lineWidth;
+ LineCap lineCap;
+ LineJoin lineJoin;
+ double miterLimit;
+ FloatSize shadowOffset;
+ float shadowBlur;
+ Color shadowColor;
+ double globalAlpha;
+ CompositeOperator globalComposite;
+ SkBlendMode globalBlend;
+ // AffineTransform transform;
+ bool hasInvertibleTransform;
+ Vector<double> lineDash;
+ double lineDashOffset;
+ bool imageSmoothingEnabled;
+ ImageSmoothingQuality imageSmoothingQuality;
+ TextAlign textAlign;
+ TextBaseline textBaseline;
+ Direction direction;
+
+ String unparsedFont;
+ FontProxy font;
+
+ CanvasLineCap canvasLineCap() const;
+ CanvasLineJoin canvasLineJoin() const;
+ CanvasTextAlign canvasTextAlign() const;
+ CanvasTextBaseline canvasTextBaseline() const;
+ String fontString() const;
+ String globalCompositeOperationString() const;
+ String shadowColorString() const;
+ };
+ State state() const { return m_state; }
bool isOffscreen2d() const { return true; }
// const FontProxy* fontProxy() final;
Ref<OffscreenCanvas> m_canvas;
+ State m_state;
};
} // namespace WebCore