Loading libs/hwui/Matrix.cpp +32 −4 Original line number Diff line number Diff line Loading @@ -203,6 +203,34 @@ void Matrix4::copyTo(SkMatrix& v) const { } void Matrix4::loadInverse(const Matrix4& v) { // Fast case for common translation matrices if (v.isPureTranslate()) { // Reset the matrix // Unnamed fields are never written to except by // loadIdentity(), they don't need to be reset data[kScaleX] = 1.0f; data[kSkewX] = 0.0f; data[kScaleY] = 1.0f; data[kSkewY] = 0.0f; data[kScaleZ] = 1.0f; data[kPerspective0] = 0.0f; data[kPerspective1] = 0.0f; data[kPerspective2] = 1.0f; // No need to deal with kTranslateZ because isPureTranslate() // only returns true when the kTranslateZ component is 0 data[kTranslateX] = -v.data[kTranslateX]; data[kTranslateY] = -v.data[kTranslateY]; data[kTranslateZ] = 0.0f; // A "pure translate" matrix can be identity or translation mType = v.getType(); return; } double scale = 1.0 / (v.data[kScaleX] * ((double) v.data[kScaleY] * v.data[kPerspective2] - (double) v.data[kTranslateY] * v.data[kPerspective1]) + Loading Loading
libs/hwui/Matrix.cpp +32 −4 Original line number Diff line number Diff line Loading @@ -203,6 +203,34 @@ void Matrix4::copyTo(SkMatrix& v) const { } void Matrix4::loadInverse(const Matrix4& v) { // Fast case for common translation matrices if (v.isPureTranslate()) { // Reset the matrix // Unnamed fields are never written to except by // loadIdentity(), they don't need to be reset data[kScaleX] = 1.0f; data[kSkewX] = 0.0f; data[kScaleY] = 1.0f; data[kSkewY] = 0.0f; data[kScaleZ] = 1.0f; data[kPerspective0] = 0.0f; data[kPerspective1] = 0.0f; data[kPerspective2] = 1.0f; // No need to deal with kTranslateZ because isPureTranslate() // only returns true when the kTranslateZ component is 0 data[kTranslateX] = -v.data[kTranslateX]; data[kTranslateY] = -v.data[kTranslateY]; data[kTranslateZ] = 0.0f; // A "pure translate" matrix can be identity or translation mType = v.getType(); return; } double scale = 1.0 / (v.data[kScaleX] * ((double) v.data[kScaleY] * v.data[kPerspective2] - (double) v.data[kTranslateY] * v.data[kPerspective1]) + Loading