[weston] rpi-renderer: don't pass a box to pixman_region32_contains_point()

Submitted by Derek Foreman on Nov. 21, 2014, 6:31 p.m.

Details

Message ID 1416594664-6522-1-git-send-email-derekf@osg.samsung.com
State Accepted
Commit d5e2187519830ce8f56705205d79840a5e32e3ad
Headers show

Not browsing as part of any series.

Commit Message

Derek Foreman Nov. 21, 2014, 6:31 p.m.
We don't care which box contained the point, so don't pass one in.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
---

Had thought I'd already sent this one up a while back, but can't find
it in patchwork or on the list...

 src/rpi-renderer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c
index c222eb6..9585be6 100644
--- a/src/rpi-renderer.c
+++ b/src/rpi-renderer.c
@@ -337,8 +337,7 @@  apply_opaque_region(struct wl_shm_buffer *buffer,
 	for (y = 0; y < height; y++) {
 		for (x = 0; x < width; x++) {
 			int i = y * stride / 4 + x;
-			pixman_box32_t box;
-			if (pixman_region32_contains_point (opaque_region, x, y, &box)) {
+			if (pixman_region32_contains_point (opaque_region, x, y, NULL)) {
 				dst[i] = src[i] | 0xff000000;
 			} else {
 				dst[i] = src[i];

Comments

On Fri, Nov 21, 2014 at 12:31:04PM -0600, Derek Foreman wrote:
> We don't care which box contained the point, so don't pass one in.
> 
> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
> ---
> 
> Had thought I'd already sent this one up a while back, but can't find
> it in patchwork or on the list...
> 
>  src/rpi-renderer.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c
> index c222eb6..9585be6 100644
> --- a/src/rpi-renderer.c
> +++ b/src/rpi-renderer.c
> @@ -337,8 +337,7 @@ apply_opaque_region(struct wl_shm_buffer *buffer,
>  	for (y = 0; y < height; y++) {
>  		for (x = 0; x < width; x++) {
>  			int i = y * stride / 4 + x;
> -			pixman_box32_t box;
> -			if (pixman_region32_contains_point (opaque_region, x, y, &box)) {
> +			if (pixman_region32_contains_point (opaque_region, x, y, NULL)) {
>  				dst[i] = src[i] | 0xff000000;
>  			} else {
>  				dst[i] = src[i];

The &box param to pixman_region32_contains_point() is a return value
from the function, and ignored when set to NULL.  In weston,
apply_opaque_region() doesn't use box at all after retrieving it from
pixman so should be dropped.  Yes, LGTM.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>

> -- 
> 2.1.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
On Fri, 21 Nov 2014 13:20:22 -0800
Bryce Harrington <bryce@osg.samsung.com> wrote:

> On Fri, Nov 21, 2014 at 12:31:04PM -0600, Derek Foreman wrote:
> > We don't care which box contained the point, so don't pass one in.
> > 
> > Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
> > ---
> > 
> > Had thought I'd already sent this one up a while back, but can't find
> > it in patchwork or on the list...
> > 
> >  src/rpi-renderer.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c
> > index c222eb6..9585be6 100644
> > --- a/src/rpi-renderer.c
> > +++ b/src/rpi-renderer.c
> > @@ -337,8 +337,7 @@ apply_opaque_region(struct wl_shm_buffer *buffer,
> >  	for (y = 0; y < height; y++) {
> >  		for (x = 0; x < width; x++) {
> >  			int i = y * stride / 4 + x;
> > -			pixman_box32_t box;
> > -			if (pixman_region32_contains_point (opaque_region, x, y, &box)) {
> > +			if (pixman_region32_contains_point (opaque_region, x, y, NULL)) {
> >  				dst[i] = src[i] | 0xff000000;
> >  			} else {
> >  				dst[i] = src[i];
> 
> The &box param to pixman_region32_contains_point() is a return value
> from the function, and ignored when set to NULL.  In weston,
> apply_opaque_region() doesn't use box at all after retrieving it from
> pixman so should be dropped.  Yes, LGTM.
> 
> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>

Pushed, thanks,
pq