[Spice-devel] [PATCH 2/3] gl: use correct pixman accessor for image data
Christophe Fergeau
cfergeau at redhat.com
Thu Apr 7 09:05:41 PDT 2011
Commit 774e5bd36f4 changed
- dest->source.pixmap.x_image->data +
+ (uint8_t *)pixman_image_get_stride(dest->source.pixmap.pixman_image) +
The correct accessor to use is pixman_image_get_data. Thanks to gcc
4.6 for warning about a "different size" int to pointer conversion.
---
client/x11/red_drawable.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/client/x11/red_drawable.cpp b/client/x11/red_drawable.cpp
index e7151ed..19dcd92 100644
--- a/client/x11/red_drawable.cpp
+++ b/client/x11/red_drawable.cpp
@@ -353,7 +353,7 @@ static inline void copy_to_pixmap_from_gltexture(const RedDrawable_p* dest,
while (height > 0) {
glReadPixels(src_x, y - height, area.right - area.left, 1,
GL_BGRA, GL_UNSIGNED_BYTE,
- (uint8_t *)pixman_image_get_stride(dest->source.pixmap.pixman_image) +
+ (uint8_t *)pixman_image_get_data(dest->source.pixmap.pixman_image) +
(area.left + offset.x) * 4 +
(area.top + offset.y + height - 1) *
pixman_image_get_stride(dest->source.pixmap.pixman_image));
--
1.7.4.2
More information about the Spice-devel
mailing list