summaryrefslogtreecommitdiffstats
path: root/dom/svg/SVGPathData.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/svg/SVGPathData.h')
-rw-r--r--dom/svg/SVGPathData.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/dom/svg/SVGPathData.h b/dom/svg/SVGPathData.h
index 4aa60de3cb..e06e669706 100644
--- a/dom/svg/SVGPathData.h
+++ b/dom/svg/SVGPathData.h
@@ -17,13 +17,13 @@
#include "mozilla/gfx/Types.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/RefPtr.h"
+#include "mozilla/ServoStyleConsts.h"
#include "nsTArray.h"
#include <string.h>
namespace mozilla {
-struct StylePathCommand;
struct SVGMark;
enum class StyleStrokeLinecap : uint8_t;
@@ -190,14 +190,22 @@ class SVGPathData {
Span<const StylePathCommand> aPath);
/**
- * This function tries to build the path from an array of StylePathCommand,
+ * This function tries to build the path from an array of GenericShapeCommand,
* which is generated by cbindgen from Rust (see ServoStyleConsts.h).
* Basically, this is a variant of the above BuildPath() functions.
+ * Note: |StylePathCommand| doesn't accept percentage values, so its |aBasis|
+ * is empty by default.
*/
static already_AddRefed<Path> BuildPath(
Span<const StylePathCommand> aPath, PathBuilder* aBuilder,
StyleStrokeLinecap aStrokeLineCap, Float aStrokeWidth,
- const gfx::Point& aOffset = gfx::Point(), float aZoomFactor = 1.0);
+ const CSSSize& aBasis = {}, const gfx::Point& aOffset = gfx::Point(),
+ float aZoomFactor = 1.0);
+ static already_AddRefed<Path> BuildPath(
+ Span<const StyleShapeCommand> aShape, PathBuilder* aBuilder,
+ StyleStrokeLinecap aStrokeLineCap, Float aStrokeWidth,
+ const CSSSize& aBasis, const gfx::Point& aOffset = gfx::Point(),
+ float aZoomFactor = 1.0);
const_iterator begin() const { return mData.Elements(); }
const_iterator end() const { return mData.Elements() + mData.Length(); }