mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 21:34:59 +00:00

With this change, we now have ~1200 CellAllocators across both LibJS and LibWeb in a normal WebContent instance. This gives us a minimum heap size of 4.7 MiB in the scenario where we only have one cell allocated per type. Of course, in practice there will be many more of each type, so the effective overhead is quite a bit smaller than that in practice. I left a few types unconverted to this mechanism because I got tired of doing this. :^)
38 lines
933 B
C++
38 lines
933 B
C++
/*
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
|
#include <LibWeb/SVG/AttributeParser.h>
|
|
#include <LibWeb/SVG/SVGGeometryElement.h>
|
|
|
|
namespace Web::SVG {
|
|
|
|
class SVGPathElement final : public SVGGeometryElement {
|
|
WEB_PLATFORM_OBJECT(SVGPathElement, SVGGeometryElement);
|
|
JS_DECLARE_ALLOCATOR(SVGPathElement);
|
|
|
|
public:
|
|
virtual ~SVGPathElement() override = default;
|
|
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override;
|
|
|
|
virtual Gfx::Path& get_path() override;
|
|
|
|
private:
|
|
SVGPathElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
Vector<PathInstruction> m_instructions;
|
|
Optional<Gfx::Path> m_path;
|
|
};
|
|
|
|
Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction>);
|
|
|
|
}
|