MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / render

Method render

plugins/single_plugins/invert.cpp:106–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 }
105
106 void render(wf::auxilliary_buffer_t& source, const wf::render_buffer_t& destination)
107 {
108 static const float vertexData[] = {
109 -1.0f, -1.0f,
110 1.0f, -1.0f,
111 1.0f, 1.0f,
112 -1.0f, 1.0f
113 };
114
115 static const float coordData[] = {
116 0.0f, 0.0f,
117 1.0f, 0.0f,
118 1.0f, 1.0f,
119 0.0f, 1.0f
120 };
121
122 wf::gles::run_in_context([&]
123 {
124 wf::gles::bind_render_buffer(destination);
125 program.use(wf::TEXTURE_TYPE_RGBA);
126 GL_CALL(glBindTexture(GL_TEXTURE_2D, wf::gles_texture_t::from_aux(source).tex_id));
127 GL_CALL(glActiveTexture(GL_TEXTURE0));
128
129 program.attrib_pointer("position", 2, 0, vertexData);
130 program.attrib_pointer("uvPosition", 2, 0, coordData);
131 program.uniform1i("preserve_hue", preserve_hue);
132
133 GL_CALL(glDisable(GL_BLEND));
134 GL_CALL(glDrawArrays(GL_TRIANGLE_FAN, 0, 4));
135 GL_CALL(glEnable(GL_BLEND));
136 GL_CALL(glBindTexture(GL_TEXTURE_2D, 0));
137
138 program.deactivate();
139 });
140 }
141
142 void fini() override
143 {

Callers

nothing calls this directly

Calls 5

run_in_contextFunction · 0.85
useMethod · 0.80
attrib_pointerMethod · 0.80
uniform1iMethod · 0.80
deactivateMethod · 0.45

Tested by

no test coverage detected