2011/9/1 Christian König <deathsim...@vodafone.de>:
> Am Donnerstag, den 01.09.2011, 13:28 -0400 schrieb Younes Manton:
>> 2011/9/1 Christian König <deathsim...@vodafone.de>:
>> > This gets mplayers menu overlay working.
>>
>> > +   if (destination_rect) {
>> > +      res_tmpl.width0 = abs(destination_rect->x0-destination_rect->x1);
>> > +      res_tmpl.height0 = abs(destination_rect->y0-destination_rect->y1);
>> > +   } else {
>> > +      res_tmpl.width0 = vlsurface->surface->texture->width0;
>> > +      res_tmpl.height0 = vlsurface->surface->texture->height0;
>> > +   }
>> ....
>> > +static inline struct pipe_video_rect *
>> > +RectToPipe(const VdpRect *src, struct pipe_video_rect *dst)
>> > +{
>> > +   if (src) {
>> > +      dst->x = MIN2(src->x1, src->x0);
>> > +      dst->y = MIN2(src->y1, src->y0);
>> > +      dst->w = abs(src->x1 - src->x0);
>> > +      dst->h = abs(src->y1 - src->y0);
>> > +      return dst;
>> > +   }
>> > +   return NULL;
>> > +}
>>
>> VdpRect is guaranteed to have x0 <= x1 and y0 <= y1 (i.e. 0 is
>> top/left [inclusive], 1 is bottom/right [exclusive]) according to the
>> reference, so we don't have to use MIN2 or abs and we can simplify
>> these calculations.
> Nope, according to the docs it's possible to flip the image by reversing
> x0/x1 and y0/y1. I haven't implemented it, but it should be supported at
> some time.

True, for source rects, but not destination rects as far as I can see,
so the first one can be explicitly simplified.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to