| 21 | |
| 22 | namespace tgfx { |
| 23 | std::shared_ptr<Program> RuntimeProgramWrapper::Wrap(std::unique_ptr<RuntimeProgram> program) { |
| 24 | if (program == nullptr) { |
| 25 | return nullptr; |
| 26 | } |
| 27 | auto context = program->getContext(); |
| 28 | return Resource::AddToCache(context, new RuntimeProgramWrapper(std::move(program))); |
| 29 | } |
| 30 | |
| 31 | const RuntimeProgram* RuntimeProgramWrapper::Unwrap(const Program* program) { |
| 32 | return static_cast<const RuntimeProgramWrapper*>(program)->runtimeProgram.get(); |
nothing calls this directly
no test coverage detected