SVGPathElement.h 926 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. JS_DECLARE_ALLOCATOR(SVGPathElement);
  15. public:
  16. virtual ~SVGPathElement() override = default;
  17. virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override;
  18. virtual Gfx::Path get_path(CSSPixelSize viewport_size) override;
  19. private:
  20. SVGPathElement(DOM::Document&, DOM::QualifiedName);
  21. virtual void initialize(JS::Realm&) override;
  22. Vector<PathInstruction> m_instructions;
  23. };
  24. Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction>);
  25. }