ladybird/Libraries/LibHTML/Layout/LayoutDocument.h
Andreas Kling 54bd322881 LibHTML: Mark image bitmaps outside the visible viewport as volatile
When the visible viewport rect changes, we walk the layout tree and
check where each LayoutImage is in relation to the viewport rect.
Images outside have their bitmaps marked as volatile.

Note that the bitmaps are managed by ImageDecoder objects. If a bitmap
is purged by the kernel while volatile, we construct a new ImageDecoder
next time we need pixels for the image.
2019-12-18 21:19:04 +01:00

22 lines
699 B
C++

#pragma once
#include <LibHTML/DOM/Document.h>
#include <LibHTML/Layout/LayoutBlock.h>
class LayoutDocument final : public LayoutBlock {
public:
explicit LayoutDocument(const Document&, NonnullRefPtr<StyleProperties>);
virtual ~LayoutDocument() override;
const Document& node() const { return static_cast<const Document&>(*LayoutNode::node()); }
virtual const char* class_name() const override { return "LayoutDocument"; }
virtual void layout() override;
const LayoutRange& selection() const { return m_selection; }
LayoutRange& selection() { return m_selection; }
void did_set_viewport_rect(Badge<Frame>, const Rect&);
private:
LayoutRange m_selection;
};