From 4ba9be2882d9f1567809edb0a31fcdf11320d41f Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 20 Apr 2015 21:25:25 +0200 Subject: randrproto xkeyboard-config fontconfig libX11 libXdmcp libXmu pixman xkbcomp xserver mesa git update 20 Apr 2015 xserver commit b1029716e41e252f149b82124a149da180607c96 xkeyboard-config commit 7d00bcc2d9c3944bbdfcbe472ee3299729dc7687 libX11 commit 748d47e69f5c12d8557d56a8a8ec166588da7b93 libXdmcp commit b10f382e3aa2e86cd5a2bc27d6758da55f0ab1f6 xkbcomp commit 1ae525b3d236b59e6437b2b5433d460e18370973 pixman commit 58e21d3e45c5227c2ca9ac00cf044f22a7975180 randrproto commit 98da0d6e48b7d124d6788ea568e9f9e3dc204322 libXmu commit 4459e6940fe3fdf26a8d5d4c71989498bc400a62 fontconfig commit 07be485a0a84995ce69bf60e3b1bb22cb35f6b0e mesa commit c1485f4b7d044724b3dbc1011f3c3a8a53132010 --- xorg-server/glamor/glamor_transfer.c | 57 +++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 20 deletions(-) (limited to 'xorg-server/glamor/glamor_transfer.c') diff --git a/xorg-server/glamor/glamor_transfer.c b/xorg-server/glamor/glamor_transfer.c index 891415565..aa5e8616e 100644 --- a/xorg-server/glamor/glamor_transfer.c +++ b/xorg-server/glamor/glamor_transfer.c @@ -73,7 +73,9 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glamor_make_current(glamor_priv); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glPixelStorei(GL_UNPACK_ROW_LENGTH, byte_stride / bytes_per_pixel); + + if (glamor_priv->has_unpack_subimage) + glPixelStorei(GL_UNPACK_ROW_LENGTH, byte_stride / bytes_per_pixel); glamor_pixmap_loop(priv, box_x, box_y) { BoxPtr box = glamor_pixmap_box_at(priv, box_x, box_y); @@ -92,25 +94,34 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, int y1 = MAX(boxes->y1 + dy_dst, box->y1); int y2 = MIN(boxes->y2 + dy_dst, box->y2); + size_t ofs = (y1 - dy_dst + dy_src) * byte_stride; + ofs += (x1 - dx_dst + dx_src) * bytes_per_pixel; + boxes++; if (x2 <= x1 || y2 <= y1) continue; - glPixelStorei(GL_UNPACK_SKIP_ROWS, y1 - dy_dst + dy_src); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1 - dx_dst + dx_src); - - glTexSubImage2D(GL_TEXTURE_2D, 0, - x1 - box->x1, y1 - box->y1, - x2 - x1, y2 - y1, - format, type, - bits); + if (glamor_priv->has_unpack_subimage || + x2 - x1 == byte_stride / bytes_per_pixel) { + glTexSubImage2D(GL_TEXTURE_2D, 0, + x1 - box->x1, y1 - box->y1, + x2 - x1, y2 - y1, + format, type, + bits + ofs); + } else { + for (; y1 < y2; y1++, ofs += byte_stride) + glTexSubImage2D(GL_TEXTURE_2D, 0, + x1 - box->x1, y1 - box->y1, + x2 - x1, 1, + format, type, + bits + ofs); + } } } - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + if (glamor_priv->has_unpack_subimage) + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); } /* @@ -166,7 +177,8 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glamor_make_current(glamor_priv); glPixelStorei(GL_PACK_ALIGNMENT, 4); - glPixelStorei(GL_PACK_ROW_LENGTH, byte_stride / bytes_per_pixel); + if (glamor_priv->has_pack_subimage) + glPixelStorei(GL_PACK_ROW_LENGTH, byte_stride / bytes_per_pixel); glamor_pixmap_loop(priv, box_x, box_y) { BoxPtr box = glamor_pixmap_box_at(priv, box_x, box_y); @@ -174,7 +186,7 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, BoxPtr boxes = in_boxes; int nbox = in_nbox; - glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->fb); + glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb); while (nbox--) { @@ -183,20 +195,25 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, int x2 = MIN(boxes->x2 + dx_src, box->x2); int y1 = MAX(boxes->y1 + dy_src, box->y1); int y2 = MIN(boxes->y2 + dy_src, box->y2); + size_t ofs = (y1 - dy_src + dy_dst) * byte_stride; + ofs += (x1 - dx_src + dx_dst) * bytes_per_pixel; boxes++; if (x2 <= x1 || y2 <= y1) continue; - glPixelStorei(GL_PACK_SKIP_PIXELS, x1 - dx_src + dx_dst); - glPixelStorei(GL_PACK_SKIP_ROWS, y1 - dy_src + dy_dst); - glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, format, type, bits); + if (glamor_priv->has_pack_subimage || + x2 - x1 == byte_stride / bytes_per_pixel) { + glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, format, type, bits + ofs); + } else { + for (; y1 < y2; y1++, ofs += byte_stride) + glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, 1, format, type, bits + ofs); + } } } - glPixelStorei(GL_PACK_ROW_LENGTH, 0); - glPixelStorei(GL_PACK_SKIP_ROWS, 0); - glPixelStorei(GL_PACK_SKIP_PIXELS, 0); + if (glamor_priv->has_pack_subimage) + glPixelStorei(GL_PACK_ROW_LENGTH, 0); } /* -- cgit v1.2.3