ViewportPaintable.h 952 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Painting/PaintableBox.h>
  8. namespace Web::Painting {
  9. class ViewportPaintable final : public PaintableWithLines {
  10. JS_CELL(ViewportPaintable, PaintableWithLines);
  11. public:
  12. static JS::NonnullGCPtr<ViewportPaintable> create(Layout::Viewport const&);
  13. virtual ~ViewportPaintable() override;
  14. void paint_all_phases(PaintContext&);
  15. void build_stacking_context_tree_if_needed();
  16. HashMap<PaintableBox const*, RefPtr<ScrollFrame>> scroll_state;
  17. void assign_scroll_frames();
  18. void refresh_scroll_state();
  19. HashMap<PaintableBox const*, RefPtr<ClipFrame>> clip_state;
  20. void assign_clip_frames();
  21. void refresh_clip_state();
  22. void resolve_paint_only_properties();
  23. private:
  24. void build_stacking_context_tree();
  25. explicit ViewportPaintable(Layout::Viewport const&);
  26. };
  27. }