summaryrefslogtreecommitdiff
path: root/glamor/glamor_dash.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-01-26 17:29:48 -0800
committerEric Anholt <eric@anholt.net>2016-01-29 18:13:09 -0800
commit07f0d90e4a8b05ef968b1ef47acda7c9f4580340 (patch)
tree8520e378f2c0952fbc2f824286b6cb0dbfbe8ffc /glamor/glamor_dash.c
parent0dbce65b08f4812dcaa4b77cd37aebac334c47a2 (diff)
glamor: Simplify the pixmap box looping.
We had a double loop across h and w, and passed the current x and y out to callers who then used w to multiply/add to an index. Instead, just single loop across w * h. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'glamor/glamor_dash.c')
-rw-r--r--glamor/glamor_dash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/glamor/glamor_dash.c b/glamor/glamor_dash.c
index 101228e40..a6a11c1a2 100644
--- a/glamor/glamor_dash.c
+++ b/glamor/glamor_dash.c
@@ -205,16 +205,16 @@ glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog,
{
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
- int box_x, box_y;
+ int box_index;
int off_x, off_y;
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE,
+ glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE,
prog->matrix_uniform, &off_x, &off_y);
while (nbox--) {