ladybird/Userland/Libraries/LibWeb/Painting/ClipFrame.h
Aliaksandr Kalenik dc0d5da086 LibWeb: Remove ViewportPaintable::refresh_clip_frames()
After d0da377767 clip frame state is no
longer depends on scroll state, so it could be calculated only once for
each layout invalidation.
2024-08-15 09:45:07 +02:00

31 lines
804 B
C++

/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Painting/BorderRadiiData.h>
#include <LibWeb/Painting/ScrollFrame.h>
#include <LibWeb/PixelUnits.h>
namespace Web::Painting {
struct ClipRectWithScrollFrame {
CSSPixelRect rect;
BorderRadiiData corner_radii;
RefPtr<ScrollFrame const> enclosing_scroll_frame;
};
struct ClipFrame : public RefCounted<ClipFrame> {
Vector<ClipRectWithScrollFrame> const& clip_rects() const { return m_clip_rects; }
void add_clip_rect(CSSPixelRect rect, BorderRadiiData radii, RefPtr<ScrollFrame const> enclosing_scroll_frame);
CSSPixelRect clip_rect_for_hit_testing() const;
private:
Vector<ClipRectWithScrollFrame> m_clip_rects;
};
}