BordersData.h 901 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibGfx/Color.h>
  9. #include <LibWeb/CSS/ComputedValues.h>
  10. #include <LibWeb/CSS/Enums.h>
  11. #include <LibWeb/PixelUnits.h>
  12. namespace Web::Painting {
  13. struct BorderDataDevicePixels {
  14. public:
  15. Color color { Color::Transparent };
  16. CSS::LineStyle line_style { CSS::LineStyle::None };
  17. DevicePixels width { 0 };
  18. };
  19. struct BordersDataDevicePixels {
  20. BorderDataDevicePixels top;
  21. BorderDataDevicePixels right;
  22. BorderDataDevicePixels bottom;
  23. BorderDataDevicePixels left;
  24. };
  25. struct BordersData {
  26. CSS::BorderData top;
  27. CSS::BorderData right;
  28. CSS::BorderData bottom;
  29. CSS::BorderData left;
  30. BordersDataDevicePixels to_device_pixels(PaintContext const& context) const;
  31. };
  32. }