summaryrefslogtreecommitdiff
path: root/glamor/glamor_glyphblt.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_glyphblt.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_glyphblt.c')
-rw-r--r--glamor/glamor_glyphblt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/glamor/glamor_glyphblt.c b/glamor/glamor_glyphblt.c
index 1791f6dca..b21aa068e 100644
--- a/glamor/glamor_glyphblt.c
+++ b/glamor/glamor_glyphblt.c
@@ -48,7 +48,7 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
glamor_pixmap_private *pixmap_priv;
glamor_program *prog;
RegionPtr clip = gc->pCompositeClip;
- int box_x, box_y;
+ int box_index;
pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
@@ -67,7 +67,7 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
start_x += drawable->x;
y += drawable->y;
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int x;
int n;
int num_points, max_points;
@@ -75,7 +75,7 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
int off_x, off_y;
char *vbo_offset;
- glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE,
+ glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE,
prog->matrix_uniform, &off_x, &off_y);
max_points = 500;
@@ -169,7 +169,7 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
int bitmap_stride = bitmap->devKind;
glamor_program *prog;
RegionPtr clip = gc->pCompositeClip;
- int box_x, box_y;
+ int box_index;
int yy, xx;
int num_points;
INT16 *points = NULL;
@@ -220,8 +220,8 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
glamor_put_vbo_space(screen);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
- glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE,
+ glamor_pixmap_loop(pixmap_priv, box_index) {
+ glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE,
prog->matrix_uniform, NULL, NULL);
glDrawArrays(GL_POINTS, 0, num_points);