pixman: Branch 'master' - 2 commits
Siarhei Siamashka
siamashka at kemper.freedesktop.org
Sun Jan 16 12:41:45 PST 2011
pixman/pixman-fast-path.h | 8 ++++----
pixman/pixman-matrix.c | 3 ++-
2 files changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 55bbccf84e475b2e3c4536606cd08c946c041fd0
Author: Siarhei Siamashka <siarhei.siamashka at nokia.com>
Date: Mon Jan 10 18:29:33 2011 +0200
Make 'fast_composite_scaled_nearest_*' less suspicious
Taking address of a variable and then using it as an array looks suspicious
to static code analyzers. So change it into an array with 1 element to make
them happy. Both old and new variants of this code are correct because 'vx'
and 'unit_x' arguments are set to 0 and it means that the called scanline
function can only access a single element of 'zero' buffer.
diff --git a/pixman/pixman-fast-path.h b/pixman/pixman-fast-path.h
index d98cfbf..b829030 100644
--- a/pixman/pixman-fast-path.h
+++ b/pixman/pixman-fast-path.h
@@ -346,16 +346,16 @@ fast_composite_scaled_nearest ## scale_func_name (pixman_implementation_t *imp,
} \
else if (PIXMAN_REPEAT_ ## repeat_mode == PIXMAN_REPEAT_NONE) \
{ \
- static src_type_t zero = 0; \
+ static src_type_t zero[1] = { 0 }; \
if (y < 0 || y >= src_image->bits.height) \
{ \
- scanline_func (dst, &zero, left_pad + width + right_pad, 0, 0, 0); \
+ scanline_func (dst, zero, left_pad + width + right_pad, 0, 0, 0); \
continue; \
} \
src = src_first_line + src_stride * y; \
if (left_pad > 0) \
{ \
- scanline_func (dst, &zero, left_pad, 0, 0, 0); \
+ scanline_func (dst, zero, left_pad, 0, 0, 0); \
} \
if (width > 0) \
{ \
@@ -363,7 +363,7 @@ fast_composite_scaled_nearest ## scale_func_name (pixman_implementation_t *imp,
} \
if (right_pad > 0) \
{ \
- scanline_func (dst + left_pad + width, &zero, right_pad, 0, 0, 0); \
+ scanline_func (dst + left_pad + width, zero, right_pad, 0, 0, 0); \
} \
} \
else \
commit ae70b38d40a587e29dc5e0dfe6250693598beca7
Author: Siarhei Siamashka <siarhei.siamashka at nokia.com>
Date: Mon Jan 10 18:09:16 2011 +0200
Bugfix for a corner case in 'pixman_transform_is_inverse'
When 'pixman_transform_multiply' fails, the result of multiplication just
could not have been identity matrix (one of the values in the resulting
matrix can't be represented as 16.16 fixed point value). So it is safe
to return FALSE.
diff --git a/pixman/pixman-matrix.c b/pixman/pixman-matrix.c
index abdfa05..f2f67ab 100644
--- a/pixman/pixman-matrix.c
+++ b/pixman/pixman-matrix.c
@@ -425,7 +425,8 @@ pixman_transform_is_inverse (const struct pixman_transform *a,
{
struct pixman_transform t;
- pixman_transform_multiply (&t, a, b);
+ if (!pixman_transform_multiply (&t, a, b))
+ return FALSE;
return pixman_transform_is_identity (&t);
}
More information about the xorg-commit
mailing list