| 21 | |
| 22 | namespace tgfx { |
| 23 | std::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 | |
| 39 | void FilterProgram::onReleaseGPU() { |
| 40 | auto gl = GLFunctions::Get(getContext()); |
nothing calls this directly
no test coverage detected