Simply the matrix calculation for zooming
authorNeil Roberts <neil@linux.intel.com>
Fri, 25 Apr 2014 12:19:37 +0000 (13:19 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 25 Apr 2014 22:18:37 +0000 (15:18 -0700)
commit1e40a7ec7ae25ed8cdc570df9e8f2b2d863ce83d
tree438d52ce1b666491a5278cfc83a3366d06ed8113
parenta69dc01a6e585a5346323022c6d5e920d800979d
Simply the matrix calculation for zooming

In order to apply the zoom transformation to the output matrix, Weston was
doing the following:

• Create a temporary matrix to hold the translation
• Invert the translation matrix using weston_matrix_invert into
  another temporary matrix
• Scale that matrix by the scale factor
• Multiply the current matrix with the temporary matrix

Using weston_matrix_invert to invert a translation matrix is over the top.
Instead we can just negate the values we pass to weston_matrix_translate.
Matrix multiplication is associative so creating a temporary matrix to hold the
scale and translation transform should be equivalent to just applying them
directly to the output matrix.
src/compositor.c