diff options
author | Keith Packard <keithp@keithp.com> | 2014-08-17 14:09:57 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-09-12 21:59:20 -0700 |
commit | fef05ed53f0598bc4ff4ab52e27c820b98e50188 (patch) | |
tree | ede4063861f6e0fd429ac8aaa9acfe60ae47bf4e | |
parent | 52a817ca62719b961d41f76183fc6da69495ef31 (diff) |
glamor: Use float matrix for render transformationsrender-float-transform
Now that the core X server exposes pixman_f_transform matrices in each
picture with a transform, use those instead of the fixed point matrices.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | glamor/glamor_render.c | 17 | ||||
-rw-r--r-- | glamor/glamor_utils.h | 20 |
2 files changed, 6 insertions, 31 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 2386f2e2e..03a7b63a3 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -790,7 +790,7 @@ combine_pict_format(PictFormatShort * des, const PictFormatShort src, static void glamor_set_normalize_tcoords_generic(glamor_pixmap_private *priv, int repeat_type, - float *matrix, + double *matrix, float xscale, float yscale, int x1, int y1, int x2, int y2, float *texcoords, @@ -1164,8 +1164,7 @@ glamor_composite_with_shader(CARD8 op, int source_x_off, source_y_off; int mask_x_off, mask_y_off; PictFormatShort saved_source_format = 0; - float src_matrix[9], mask_matrix[9]; - float *psrc_matrix = NULL, *pmask_matrix = NULL; + double *psrc_matrix = NULL, *pmask_matrix = NULL; int nrect_max; Bool ret = FALSE; glamor_composite_shader *shader = NULL, *shader_ca = NULL; @@ -1210,10 +1209,8 @@ glamor_composite_with_shader(CARD8 op, glamor_get_drawable_deltas(source->pDrawable, source_pixmap, &source_x_off, &source_y_off); pixmap_priv_get_scale(source_pixmap_priv, &src_xscale, &src_yscale); - if (source->transform) { - psrc_matrix = src_matrix; - glamor_picture_get_matrixf(source, psrc_matrix); - } + if (source->transform) + psrc_matrix = &(PictureTransformFloat(source)->m[0][0]); } if (glamor_priv->has_mask_coords) { @@ -1221,10 +1218,8 @@ glamor_composite_with_shader(CARD8 op, glamor_get_drawable_deltas(mask->pDrawable, mask_pixmap, &mask_x_off, &mask_y_off); pixmap_priv_get_scale(mask_pixmap_priv, &mask_xscale, &mask_yscale); - if (mask->transform) { - pmask_matrix = mask_matrix; - glamor_picture_get_matrixf(mask, pmask_matrix); - } + if (mask->transform) + pmask_matrix = &(PictureTransformFloat(mask)->m[0][0]); } nrect_max = MIN(nrect, GLAMOR_COMPOSITE_VBO_VERT_CNT / 4); diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h index c15d17ca3..29f221f4b 100644 --- a/glamor/glamor_utils.h +++ b/glamor/glamor_utils.h @@ -91,26 +91,6 @@ } \ } while(0) -#define xFixedToFloat(_val_) ((float)xFixedToInt(_val_) \ - + ((float)xFixedFrac(_val_) / 65536.0)) - -#define glamor_picture_get_matrixf(_picture_, _matrix_) \ - do { \ - int _i_; \ - if ((_picture_)->transform) \ - { \ - for(_i_ = 0; _i_ < 3; _i_++) \ - { \ - (_matrix_)[_i_ * 3 + 0] = \ - xFixedToFloat((_picture_)->transform->matrix[_i_][0]); \ - (_matrix_)[_i_ * 3 + 1] = \ - xFixedToFloat((_picture_)->transform->matrix[_i_][1]); \ - (_matrix_)[_i_ * 3 + 2] = \ - xFixedToFloat((_picture_)->transform->matrix[_i_][2]); \ - } \ - } \ - } while(0) - #define fmod(x, w) (x - w * floor((float)x/w)) #define fmodulus(x, w, c) do {c = fmod(x, w); \ |