MCPcopy Create free account
hub / github.com/VCVRack/Rack / load

Method load

src/window/Svg.cpp:100–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99
100std::shared_ptr<Svg> Svg::load(const std::string& filename) {
101 const auto& pair = svgCache.find(filename);
102 if (pair != svgCache.end())
103 return pair->second;
104
105 // Load svg
106 std::shared_ptr<Svg> svg;
107 try {
108 svg = std::make_shared<Svg>();
109 svg->loadFile(filename);
110 }
111 catch (Exception& e) {
112 WARN("%s", e.what());
113 svg = NULL;
114 }
115 svgCache[filename] = svg;
116 return svg;
117}
118
119
120static NVGcolor getNVGColor(uint32_t color) {

Callers 2

waitMethod · 0.45
waitMethod · 0.45

Calls 2

whatMethod · 0.80
loadFileMethod · 0.45

Tested by

no test coverage detected