[gtk/ngl-less-shaders: 4/13] ngl: Some more cleanups
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ngl-less-shaders: 4/13] ngl: Some more cleanups
- Date: Sun, 14 Mar 2021 16:35:59 +0000 (UTC)
commit 15b1172f326dc87051c6ad978ddd2d6c395728c7
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 13 14:36:03 2021 -0500
ngl: Some more cleanups
Rewrite gsk_ngl_render_job_visit_text_node to be
more compact.
gsk/ngl/gsknglrenderjob.c | 60 ++++++-----------------------------------------
1 file changed, 7 insertions(+), 53 deletions(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 6b28515d66..4ee39ca36b 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -2756,59 +2756,13 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
glyph_x2 = glyph_x + glyph->ink_rect.width;
glyph_y2 = glyph_y + glyph->ink_rect.height;
- vertices[base+0].position[0] = glyph_x;
- vertices[base+0].position[1] = glyph_y;
- vertices[base+0].uv[0] = tx;
- vertices[base+0].uv[1] = ty;
- vertices[base+0].color[0] = c.red;
- vertices[base+0].color[1] = c.green;
- vertices[base+0].color[2] = c.blue;
- vertices[base+0].color[3] = c.alpha;
-
- vertices[base+1].position[0] = glyph_x;
- vertices[base+1].position[1] = glyph_y2;
- vertices[base+1].uv[0] = tx;
- vertices[base+1].uv[1] = ty2;
- vertices[base+1].color[0] = c.red;
- vertices[base+1].color[1] = c.green;
- vertices[base+1].color[2] = c.blue;
- vertices[base+1].color[3] = c.alpha;
-
- vertices[base+2].position[0] = glyph_x2;
- vertices[base+2].position[1] = glyph_y;
- vertices[base+2].uv[0] = tx2;
- vertices[base+2].uv[1] = ty;
- vertices[base+2].color[0] = c.red;
- vertices[base+2].color[1] = c.green;
- vertices[base+2].color[2] = c.blue;
- vertices[base+2].color[3] = c.alpha;
-
- vertices[base+3].position[0] = glyph_x2;
- vertices[base+3].position[1] = glyph_y2;
- vertices[base+3].uv[0] = tx2;
- vertices[base+3].uv[1] = ty2;
- vertices[base+3].color[0] = c.red;
- vertices[base+3].color[1] = c.green;
- vertices[base+3].color[2] = c.blue;
- vertices[base+3].color[3] = c.alpha;
-
- vertices[base+4].position[0] = glyph_x;
- vertices[base+4].position[1] = glyph_y2;
- vertices[base+4].uv[0] = tx;
- vertices[base+4].uv[1] = ty2;
- vertices[base+4].color[0] = c.red;
- vertices[base+4].color[1] = c.green;
- vertices[base+4].color[2] = c.blue;
- vertices[base+4].color[3] = c.alpha;
-
- vertices[base+5].position[0] = glyph_x2;
- vertices[base+5].position[1] = glyph_y;
- vertices[base+5].uv[0] = tx2;
- vertices[base+5].uv[1] = ty;
- vertices[base+5].color[0] = c.red;
- vertices[base+5].color[1] = c.green;
- vertices[base+5].color[2] = c.blue;
- vertices[base+5].color[3] = c.alpha;
+ vertices[base+0] = (GskNglDrawVertex) { { glyph_x, glyph_y }, { tx, ty }, { c.red, c.green,
c.blue, c.alpha } };
+ vertices[base+1] = (GskNglDrawVertex) { { glyph_x, glyph_y2 }, { tx, ty2 }, { c.red, c.green,
c.blue, c.alpha } };
+ vertices[base+2] = (GskNglDrawVertex) { { glyph_x2, glyph_y }, { tx2, ty }, { c.red, c.green,
c.blue, c.alpha } };
+
+ vertices[base+3] = (GskNglDrawVertex) { { glyph_x2, glyph_y2 }, { tx2, ty2 }, { c.red, c.green,
c.blue, c.alpha } };
+ vertices[base+4] = (GskNglDrawVertex) { { glyph_x, glyph_y2 }, { tx, ty2 }, { c.red, c.green,
c.blue, c.alpha } };
+ vertices[base+5] = (GskNglDrawVertex) { { glyph_x2, glyph_y }, { tx2, ty }, { c.red, c.green,
c.blue, c.alpha } };
batch->draw.vbo_count += GSK_NGL_N_VERTICES;
used++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]