ShadowPainting.h 704 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/Color.h>
  8. #include <LibWeb/Forward.h>
  9. #include <LibWeb/Painting/PaintContext.h>
  10. namespace Web::Painting {
  11. enum class ShadowPlacement {
  12. Outer,
  13. Inner,
  14. };
  15. struct ShadowData {
  16. Gfx::Color color;
  17. CSSPixels offset_x;
  18. CSSPixels offset_y;
  19. CSSPixels blur_radius;
  20. CSSPixels spread_distance;
  21. ShadowPlacement placement;
  22. };
  23. void paint_box_shadow(PaintContext&, CSSPixelRect const&, BorderRadiiData const&, Vector<ShadowData> const&);
  24. void paint_text_shadow(PaintContext&, Layout::LineBoxFragment const&, Vector<ShadowData> const&);
  25. }