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

Method Make

test/src/utils/FilterProgram.cpp:23–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22namespace tgfx {
23std::unique_ptr<FilterProgram> FilterProgram::Make(Context* context, const std::string& vertex,
24 const std::string& fragment) {
25 auto gl = GLFunctions::Get(context);
26 auto program = CreateGLProgram(context, vertex, fragment);
27 if (program == 0) {
28 return nullptr;
29 }
30 auto filterProgram = std::unique_ptr<FilterProgram>(new FilterProgram(context));
31 filterProgram->program = program;
32 if (gl->bindVertexArray != nullptr) {
33 gl->genVertexArrays(1, &filterProgram->vertexArray);
34 }
35 gl->genBuffers(1, &filterProgram->vertexBuffer);
36 return filterProgram;
37}
38
39void FilterProgram::onReleaseGPU() {
40 auto gl = GLFunctions::Get(getContext());

Callers

nothing calls this directly

Calls 1

CreateGLProgramFunction · 0.85

Tested by

no test coverage detected