SVGPathElement.h 922 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/Bitmap.h>
  8. #include <LibWeb/HTML/HTMLElement.h>
  9. #include <LibWeb/SVG/AttributeParser.h>
  10. #include <LibWeb/SVG/SVGGeometryElement.h>
  11. namespace Web::SVG {
  12. class SVGPathElement final : public SVGGeometryElement {
  13. WEB_PLATFORM_OBJECT(SVGPathElement, SVGGeometryElement);
  14. public:
  15. virtual ~SVGPathElement() override = default;
  16. virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
  17. virtual Gfx::Path& get_path() override;
  18. private:
  19. SVGPathElement(DOM::Document&, DOM::QualifiedName);
  20. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  21. Vector<PathInstruction> m_instructions;
  22. Optional<Gfx::Path> m_path;
  23. };
  24. Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction>);
  25. }