diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-18 15:14:00 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-18 15:14:00 +0000 |
commit | 551b400377ddc5eb1e89b8b5827a42e810c8d23d (patch) | |
tree | 4e407fb65a39987482cb1a159945662de0981fcb /src/sna/gen5_render.c | |
parent | d96a226cc59c641c10153ae3a086a5138c852423 (diff) |
sna/video: Amalgamate the computation of source vs dest offsets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen5_render.c')
-rw-r--r-- | src/sna/gen5_render.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 7f0e8fb5..3a9fd8c1 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1668,7 +1668,7 @@ gen5_render_video(struct sna *sna, PixmapPtr pixmap) { struct sna_composite_op tmp; - int nbox, dxo, dyo, pix_xoff, pix_yoff; + int nbox, pix_xoff, pix_yoff; float src_scale_x, src_scale_y; struct sna_pixmap *priv; BoxPtr box; @@ -1722,9 +1722,6 @@ gen5_render_video(struct sna *sna, pix_yoff = 0; #endif - dxo = dstRegion->extents.x1 + dx; - dyo = dstRegion->extents.y1 + dy; - /* Use normalized texture coordinates */ src_scale_x = ((float)src_w / frame->width) / (float)drw_w; src_scale_y = ((float)src_h / frame->height) / (float)drw_h; @@ -1742,16 +1739,16 @@ gen5_render_video(struct sna *sna, gen5_get_rectangles(sna, &tmp, 1, gen5_video_bind_surfaces); OUT_VERTEX(r.x2, r.y2); - OUT_VERTEX_F((box->x2 - dxo) * src_scale_x); - OUT_VERTEX_F((box->y2 - dyo) * src_scale_y); + OUT_VERTEX_F((box->x2 - dx) * src_scale_x); + OUT_VERTEX_F((box->y2 - dy) * src_scale_y); OUT_VERTEX(r.x1, r.y2); - OUT_VERTEX_F((box->x1 - dxo) * src_scale_x); - OUT_VERTEX_F((box->y2 - dyo) * src_scale_y); + OUT_VERTEX_F((box->x1 - dx) * src_scale_x); + OUT_VERTEX_F((box->y2 - dy) * src_scale_y); OUT_VERTEX(r.x1, r.y1); - OUT_VERTEX_F((box->x1 - dxo) * src_scale_x); - OUT_VERTEX_F((box->y1 - dyo) * src_scale_y); + OUT_VERTEX_F((box->x1 - dx) * src_scale_x); + OUT_VERTEX_F((box->y1 - dy) * src_scale_y); if (!DAMAGE_IS_ALL(priv->gpu_damage)) { sna_damage_add_box(&priv->gpu_damage, &r); |