MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / init

Method init

gui/gui_icons.cpp:64–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void GDREGuiIcons::init() {
65 MutexLock lock(init_lock);
66 if (initialized) {
67 return;
68 }
69 // We have to initialize the svg renderer first because the `svg` module is initialized after the `gdsdecomp` module (alphabetical order).
70 Vector<float> scales = { 1.0 };
71 auto fallback_scale = ThemeDB::get_singleton()->get_fallback_base_scale();
72 if (!scales.has(fallback_scale)) {
73 scales.push_back(fallback_scale);
74 }
75 for (float scale : scales) {
76 // Initialize all icons for this scale (lock already held)
77 if (!icons.has(scale)) {
78 for (int i = 0; i < gdre_icons_count; i++) {
79 icons[scale][gdre_icons_names[i]] = generate_icon(i, scale);
80 }
81 }
82 }
83
84 initialized = true;
85}
86
87void GDREGuiIcons::init_for_scale(float scale) {
88 MutexLock lock(init_lock);

Callers 1

test_case_startMethod · 0.45

Calls 2

generate_iconFunction · 0.85
push_backMethod · 0.80

Tested by 1

test_case_startMethod · 0.36