mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
bfd354492e
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. :^)
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Geometry/DOMPointReadOnly.h>
|
|
|
|
namespace Web::Geometry {
|
|
|
|
// https://drafts.fxtf.org/geometry/#DOMPoint
|
|
class DOMPoint final : public DOMPointReadOnly {
|
|
WEB_PLATFORM_OBJECT(DOMPoint, DOMPointReadOnly);
|
|
JS_DECLARE_ALLOCATOR(DOMPoint);
|
|
|
|
public:
|
|
static JS::NonnullGCPtr<DOMPoint> construct_impl(JS::Realm&, double x = 0, double y = 0, double z = 0, double w = 1);
|
|
|
|
static JS::NonnullGCPtr<DOMPoint> from_point(JS::VM&, DOMPointInit const&);
|
|
|
|
virtual ~DOMPoint() override;
|
|
|
|
double x() const { return m_x; }
|
|
double y() const { return m_y; }
|
|
double z() const { return m_z; }
|
|
double w() const { return m_w; }
|
|
|
|
void set_x(double x) { m_x = x; }
|
|
void set_y(double y) { m_y = y; }
|
|
void set_z(double z) { m_z = z; }
|
|
void set_w(double w) { m_w = w; }
|
|
|
|
private:
|
|
DOMPoint(JS::Realm&, double x, double y, double z, double w);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
};
|
|
|
|
}
|