Explorar el Código

LibWeb: Stub CanvasRenderingContext2D.clip

This is primarily required by Google Maps Street View, but the map view
works without this.
Luke Wilde hace 3 años
padre
commit
89c4e011e4

+ 5 - 0
Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp

@@ -726,6 +726,11 @@ void CanvasRenderingContext2D::reset_transform()
     m_drawing_state.transform = {};
 }
 
+void CanvasRenderingContext2D::clip()
+{
+    // FIXME: Implement.
+}
+
 // https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument
 DOM::ExceptionOr<CanvasImageSourceUsability> check_usability_of_image(CanvasImageSource const& image)
 {

+ 1 - 0
Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h

@@ -101,6 +101,7 @@ public:
     void transform(double a, double b, double c, double d, double e, double f);
     void set_transform(double a, double b, double c, double d, double e, double f);
     void reset_transform();
+    void clip();
 
 private:
     explicit CanvasRenderingContext2D(HTMLCanvasElement&);

+ 5 - 0
Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.idl

@@ -60,4 +60,9 @@ interface CanvasRenderingContext2D {
     undefined setTransform(double a, double b, double c, double d, double e, double f);
     undefined resetTransform();
 
+    // undefined clip(optional CanvasFillRule fillRule = "nonzero");
+    // undefined clip(Path2D path, optional CanvasFillRule fillRule = "nonzero");
+    // FIXME: Replace this with the two definitions above.
+    undefined clip();
+
 };