On 01/09/2015 01:42 PM, Giulio Camuffo wrote:
Just a nitpick below:

+WL_EXPORT pixman_box32_t
+weston_matrix_transform_rect(struct weston_matrix *matrix,
+                            pixman_box32_t rect)

The function name doesn't imply it returns an axis aligned bounding
box. Maybe something like "weston_matrix_rect_to_transformed_aabb"
would be better?

I think that is implied pretty well by the return type, since that return type cannot possibly contain anything other than an axis-aligned box.

But it may be useful to indicate this is returning a bounding box and not some other rectangle. Another useful transform is an area-preserving one (the resulting rectangle has the same area and center as transformed quadrilateral).

That said, it has been very common for people to transform to a bounding box first and name this function "transform rectangle". When they realize they need the other function it is then often called "transform area". So this naming fits what many other libraries do.
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to