I'm reading official Android OpenGL ES 2.0 tutorial, and I noticed something. The code in the tutorial multiplies rotation matrix into the view-projection matrix like this:
Matrix.multiplyMM(mMVPMatrix, 0, mRotationMatrix, 0, mMVPMatrix, 0);
But, the documentation for this method specifies that the result matrix, and either of operands should not overlap, or the result is undefined:
Multiply two 4x4 matrices together and store the result in a third 4x4 matrix. In matrix notation: result = lhs x rhs. Due to the way matrix multiplication works, the result matrix will have the same effect as first multiplying by the rhs matrix, then multiplying by the lhs matrix. This is the opposite of what you might expect. The same float array may be passed for result, lhs, and/or rhs. However, the result element values are undefined if the result elements overlap either the lhs or rhs elements.
So, if we use offsets, we can store result, lhs and rhs in the same array, but they should not overlap. But, in the call from the tutorial, result and the rhs overlap, and offset of zero is used.
Am I reading something wrong, or is Googles tutorial wrong?