diff options
author | Junyan He <junyan.he@linux.intel.com> | 2012-06-04 03:18:40 +0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-12-18 11:23:52 -0800 |
commit | 0b0391765f3ca0192b00f4970c9453934d529397 (patch) | |
tree | 6f9913848046a9d6d34f7ab301d33106a3159140 /glamor/glamor_utils.h | |
parent | bd180be619c2ef469ca40cf95023340c59960540 (diff) |
Add macro of vertex setting for triangle stripe
Add macro of vertex setting for triangle stripe draw,
and make the code clear.
Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Diffstat (limited to 'glamor/glamor_utils.h')
-rw-r--r-- | glamor/glamor_utils.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h index 18f7f3b10..dfe8e568f 100644 --- a/glamor/glamor_utils.h +++ b/glamor/glamor_utils.h @@ -481,6 +481,25 @@ tx2, ty2, yInverted, vertices); \ } while(0) +#define glamor_set_normalize_tcoords_tri_stripe(xscale, yscale, \ + x1, y1, x2, y2, \ + yInverted, vertices) \ + do { \ + (vertices)[0] = t_from_x_coord_x(xscale, x1); \ + (vertices)[2] = t_from_x_coord_x(xscale, x2); \ + (vertices)[6] = (vertices)[2]; \ + (vertices)[4] = (vertices)[0]; \ + if (yInverted) { \ + (vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \ + (vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \ + } \ + else { \ + (vertices)[1] = t_from_x_coord_y(yscale, y1); \ + (vertices)[7] = t_from_x_coord_y(yscale, y2); \ + } \ + (vertices)[3] = (vertices)[1]; \ + (vertices)[5] = (vertices)[7]; \ + } while(0) #define glamor_set_tcoords(width, height, x1, y1, x2, y2, \ yInverted, vertices) \ @@ -501,6 +520,24 @@ (vertices)[7] = (vertices)[5]; \ } while(0) +#define glamor_set_tcoords_tri_strip(width, height, x1, y1, x2, y2, \ + yInverted, vertices) \ + do { \ + (vertices)[0] = (x1); \ + (vertices)[2] = (x2); \ + (vertices)[6] = (vertices)[2]; \ + (vertices)[4] = (vertices)[0]; \ + if (yInverted) { \ + (vertices)[1] = (y1); \ + (vertices)[7] = (y2); \ + } \ + else { \ + (vertices)[1] = height - (y2); \ + (vertices)[7] = height - (y1); \ + } \ + (vertices)[3] = (vertices)[1]; \ + (vertices)[5] = (vertices)[7]; \ + } while(0) #define glamor_set_normalize_vcoords(priv, xscale, yscale, \ x1, y1, x2, y2, \ @@ -524,6 +561,26 @@ (vertices)[7] = (vertices)[5]; \ } while(0) +#define glamor_set_normalize_vcoords_tri_strip(xscale, yscale, \ + x1, y1, x2, y2, \ + yInverted, vertices) \ + do { \ + (vertices)[0] = v_from_x_coord_x(xscale, x1); \ + (vertices)[2] = v_from_x_coord_x(xscale, x2); \ + (vertices)[6] = (vertices)[2]; \ + (vertices)[4] = (vertices)[0]; \ + if (yInverted) { \ + (vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \ + (vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \ + } \ + else { \ + (vertices)[1] = v_from_x_coord_y(yscale, y1); \ + (vertices)[7] = v_from_x_coord_y(yscale, y2); \ + } \ + (vertices)[3] = (vertices)[1]; \ + (vertices)[5] = (vertices)[7]; \ + } while(0) + #define glamor_set_normalize_pt(xscale, yscale, x, y, \ yInverted, pt) \ do { \ |