BoxShadowCache.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "../../Include/RmlUi/Core/CallbackTexture.h"
  3. #include "../../Include/RmlUi/Core/Geometry.h"
  4. #include "../../Include/RmlUi/Core/Types.h"
  5. namespace Rml {
  6. namespace Style {
  7. class ComputedValues;
  8. }
  9. struct BoxShadowGeometryInfo;
  10. struct BoxShadowRenderable : NonCopyMoveable {
  11. BoxShadowRenderable(const BoxShadowGeometryInfo& geometry_info);
  12. ~BoxShadowRenderable();
  13. CallbackTexture texture;
  14. Geometry geometry;
  15. Geometry background_border_geometry;
  16. const BoxShadowGeometryInfo& cache_key;
  17. };
  18. class BoxShadowCache {
  19. public:
  20. static void Initialize();
  21. static void Shutdown();
  22. /// Returns a handle to BoxShadow renderable matching the element's style - creates new data if none is found.
  23. /// @param[in] element Element for which to calculate and cache the box shadow.
  24. /// @param[in] computed The computed style values of the element.
  25. /// @return A handle to the BoxShadow data, with automatic reference counting.
  26. static SharedPtr<BoxShadowRenderable> GetHandle(Element* element, const Style::ComputedValues& computed);
  27. };
  28. } // namespace Rml