summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/StackingContext.h
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-07-19 15:18:20 +0100
committerAndreas Kling <kling@serenityos.org>2022-07-21 16:36:08 +0200
commit75e0b21940e8e285b77874d4c08ac6b9b1eaa177 (patch)
tree03a0e00db047cd5e53c3b98f9f9ffad9a6ead380 /Userland/Libraries/LibWeb/Painting/StackingContext.h
parent01a3f72d3918854141269badf9f00d9348aa8410 (diff)
downloadserenity-75e0b21940e8e285b77874d4c08ac6b9b1eaa177.zip
LibWeb: Store calculated transformation matrix on the StackingContext
This is mainly so we can easily read that matrix later, but also has the benefit of only calculating the matrix once, instead of every time we paint. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting/StackingContext.h')
-rw-r--r--Userland/Libraries/LibWeb/Painting/StackingContext.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.h b/Userland/Libraries/LibWeb/Painting/StackingContext.h
index 9b26eef0fd..13e9d677f6 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.h
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.h
@@ -34,19 +34,22 @@ public:
void paint(PaintContext&) const;
Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const;
+ Gfx::FloatMatrix4x4 const& transform_matrix() const { return m_transform; }
+ Gfx::AffineTransform affine_transform_matrix() const;
+
void dump(int indent = 0) const;
void sort();
private:
Layout::Box& m_box;
+ Gfx::FloatMatrix4x4 m_transform;
StackingContext* const m_parent { nullptr };
Vector<StackingContext*> m_children;
void paint_internal(PaintContext&) const;
Gfx::FloatMatrix4x4 get_transformation_matrix(CSS::Transformation const& transformation) const;
Gfx::FloatMatrix4x4 combine_transformations(Vector<CSS::Transformation> const& transformations) const;
- Gfx::AffineTransform combine_transformations_2d(Vector<CSS::Transformation> const& transformations) const;
Gfx::FloatPoint transform_origin() const;
};