Commit f880b6d4 authored by Frediano Ziglio's avatar Frediano Ziglio

spice-widget-egl: Declare and initialise "tex" and "verts" shortly

Just syntax change.
Reduce code to initialise these matrices.
Signed-off-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
Acked-by: default avatarVictor Toso <victortoso@redhat.com>
parent 902cf95e
Pipeline #50561 passed with stage
in 4 minutes and 20 seconds
...@@ -489,33 +489,19 @@ client_draw_rect_tex(SpiceDisplay *display, ...@@ -489,33 +489,19 @@ client_draw_rect_tex(SpiceDisplay *display,
float x, float y, float w, float h, float x, float y, float w, float h,
float tx, float ty, float tw, float th) float tx, float ty, float tw, float th)
{ {
float verts[4][4]; GLfloat tex[4][2] = {
float tex[4][2]; { tx, ty },
{ tx + tw, ty },
verts[0][0] = x; { tx, ty + th },
verts[0][1] = y; { tx + tw, ty + th },
verts[0][2] = 0.0; };
verts[0][3] = 1.0;
tex[0][0] = tx; GLfloat verts[4][4] = {
tex[0][1] = ty; { x, y, 0.0, 1.0 },
verts[1][0] = x + w; { x + w, y, 0.0, 1.0 },
verts[1][1] = y; { x, y + h, 0.0, 1.0 },
verts[1][2] = 0.0; { x + w, y + h, 0.0, 1.0 },
verts[1][3] = 1.0; };
tex[1][0] = tx + tw;
tex[1][1] = ty;
verts[2][0] = x;
verts[2][1] = y + h;
verts[2][2] = 0.0;
verts[2][3] = 1.0;
tex[2][0] = tx;
tex[2][1] = ty + th;
verts[3][0] = x + w;
verts[3][1] = y + h;
verts[3][2] = 0.0;
verts[3][3] = 1.0;
tex[3][0] = tx + tw;
tex[3][1] = ty + th;
draw_rect_from_arrays(display, verts, tex); draw_rect_from_arrays(display, verts, tex);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment