[PATCH 1/2] matrix: track transform type

Bill Spitzak spitzak at gmail.com
Mon Jan 28 15:41:09 PST 2013


This is very very useful, however the proposed set is not really correct:

>> +enum weston_matrix_transform_type {
>> +	WESTON_MATRIX_TRANSFORM_TRANSLATE	= (1 << 0),
>> +	WESTON_MATRIX_TRANSFORM_SCALE		= (1 << 1),
>> +	WESTON_MATRIX_TRANSFORM_ROTATE		= (1 << 2),
>> +	WESTON_MATRIX_TRANSFORM_OTHER		= (1 << 3),
>> +};

These either have misleading names or are not really useful (translate 
will probably be true in all cases, things that can do rotate can 
usually do skew, does scale include reflections, etc).

Useful things to know about the current transform (a,b,c,d,x,y are the 
2x3 affine matrix):

  - Are x and y integers?

  - If it is a 90 degree rotation or reflection (meaning either b and c 
are zero, or a and d are zero).

  - No scaling: abs(ad-bc) == 1.

  - No perspective (third column of 3x3 matrix is 0, 0, 1).



More information about the wayland-devel mailing list