| 801 | |
| 802 | |
| 803 | std::shared_ptr<Image> Window::loadImage(const std::string& filename) { |
| 804 | const auto& it = internal->imageCache.find(filename); |
| 805 | if (it != internal->imageCache.end()) |
| 806 | return it->second; |
| 807 | |
| 808 | // Load image |
| 809 | std::shared_ptr<Image> image; |
| 810 | try { |
| 811 | image = std::make_shared<Image>(); |
| 812 | image->loadFile(filename, vg); |
| 813 | } |
| 814 | catch (Exception& e) { |
| 815 | WARN("%s", e.what()); |
| 816 | image = NULL; |
| 817 | } |
| 818 | internal->imageCache[filename] = image; |
| 819 | return image; |
| 820 | } |
| 821 | |
| 822 | |
| 823 | bool& Window::fbDirtyOnSubpixelChange() { |