compositor: reduce the number of triangles
authorPekka Paalanen <ppaalanen@gmail.com>
Tue, 4 Sep 2012 10:55:42 +0000 (13:55 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 4 Sep 2012 20:15:29 +0000 (16:15 -0400)
commit85a46671dbaa738f38407074c90353011ea9c982
tree7cabe67669a5d1448a14f71a9196250cc520f887
parentc73bd54b586ab13b2e70b450669d4ea3a3fee608
compositor: reduce the number of triangles

The intersection of two rectangles is guaranteed to be convex. Therefore
we do not need a center vertex for the triangle fan, we can simply use
the whatever first vertex the intersection polygon has. This reduces the
number of triangles, while still painting the exact same area.

While at it, emit_vertex() nested function is factored into the
for-loop, since that is the only calling site left.

Comments are updated to reflect the changes, and some unrelated comment
fixes are in repaint_region().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Rob Clark <rob.clark@linaro.org>
src/compositor.c