2025-08-07 12:44:31 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include "ResourceDisplay.hpp"
|
|
|
|
|
#include <include/core/SkImage.h>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <modules/svg/include/SkSVGDOM.h>
|
|
|
|
|
|
|
|
|
|
class SvgResourceDisplay : public ResourceDisplay {
|
|
|
|
|
public:
|
|
|
|
|
virtual void update(World& w) override;
|
2026-02-19 15:21:47 +03:00
|
|
|
virtual bool load(ResourceManager& rMan, const std::string& fileName, const std::shared_ptr<std::string>& fileData) override;
|
2025-08-07 12:44:31 +03:00
|
|
|
virtual bool update_draw() const override;
|
|
|
|
|
virtual void draw(SkCanvas* canvas, const DrawData& drawData, const SkRect& imRect) override;
|
|
|
|
|
virtual Vector2f get_dimensions() const override;
|
|
|
|
|
virtual float get_dimension_scale() const override;
|
2025-10-09 16:56:05 +03:00
|
|
|
virtual Type get_type() const override;
|
2025-08-07 12:44:31 +03:00
|
|
|
private:
|
|
|
|
|
sk_sp<SkSVGDOM> svgDom;
|
|
|
|
|
bool mustUpdateDraw = false;
|
|
|
|
|
SkSize svgRootSize;
|
|
|
|
|
};
|