MCPcopy Create free account
hub / github.com/Tencent/tgfx / Wrap

Method Wrap

src/gpu/resources/RuntimeProgramWrapper.cpp:23–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22namespace tgfx {
23std::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
31const RuntimeProgram* RuntimeProgramWrapper::Unwrap(const Program* program) {
32 return static_cast<const RuntimeProgramWrapper*>(program)->runtimeProgram.get();

Callers

nothing calls this directly

Calls 1

getContextMethod · 0.45

Tested by

no test coverage detected