[gtk/ngl-cleanups] ngl: Small cleanup
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ngl-cleanups] ngl: Small cleanup
- Date: Sun, 14 Mar 2021 05:00:18 +0000 (UTC)
commit 2248ab8add5ec2e7d14019a01e1e9727ec1b5f6c
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 13 23:58:19 2021 -0500
ngl: Small cleanup
We don't need to have an extra program variable
in the visit_text_node function.
gsk/ngl/gsknglrenderjob.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 1a5a98faab..bbfb7a98cc 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -2643,7 +2643,6 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
GskNglCommandBatch *batch;
int x_position = 0;
GskNglGlyphKey lookup;
- GskNglProgram *program;
guint last_texture = 0;
GskNglDrawVertex *vertices;
guint used = 0;
@@ -2652,8 +2651,6 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
if (num_glyphs == 0)
return;
- program = CHOOSE_PROGRAM (job, coloring);
-
/* If the font has color glyphs, we don't need to recolor anything.
* We tell the shader by setting the color to vec4(-1).
*/
@@ -2665,7 +2662,7 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
lookup.font = (PangoFont *)font;
lookup.scale = (guint) (text_scale * 1024);
- gsk_ngl_render_job_begin_draw (job, program);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (coloring));
batch = gsk_ngl_command_queue_get_batch (job->command_queue);
vertices = gsk_ngl_command_queue_add_n_vertices (job->command_queue, num_glyphs);
@@ -2713,7 +2710,7 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
batch->draw.vbo_offset = vbo_offset;
}
- gsk_ngl_program_set_uniform_texture (program,
+ gsk_ngl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
GL_TEXTURE0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]