mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:22:45 +00:00 
			
		
		
		
	 54bd322881
			
		
	
	
		54bd322881
		
	
	
	
	
		
			
			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.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			699 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			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;
 | |
| };
 |