| 24 | thread_local std::shared_ptr<tgfx::GLDevice> cachedDevice = nullptr; |
| 25 | |
| 26 | std::shared_ptr<tgfx::GLDevice> DevicePool::Make() { |
| 27 | auto device = cachedDevice; |
| 28 | if (device == nullptr) { |
| 29 | device = tgfx::GLDevice::Make(); |
| 30 | cachedDevice = device; |
| 31 | } |
| 32 | return device; |
| 33 | } |
| 34 | } // namespace tgfx |