diff options
author | 2014-03-12 17:03:00 +0000 | |
---|---|---|
committer | 2014-03-12 17:03:01 +0000 | |
commit | d84133af441caed8102b2da79cdb6f50673b80cb (patch) | |
tree | 6931fea39553febd45825a262334590c58e1432c /libs/hwui/Matrix.cpp | |
parent | 9d50ea90f7072a7fa87d022663f2d25b906ed2ad (diff) | |
parent | b79a3e301a8d89b9e1b1f6f3d7fd6aa56610a6f0 (diff) |
Merge "Fix orthographic shadows projection, simplify shadow reordering"
Diffstat (limited to 'libs/hwui/Matrix.cpp')
-rw-r--r-- | libs/hwui/Matrix.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp index 3d6188a0ddfa..f06106b14ee7 100644 --- a/libs/hwui/Matrix.cpp +++ b/libs/hwui/Matrix.cpp @@ -385,9 +385,14 @@ void Matrix4::loadOrtho(float left, float right, float bottom, float top, float mType = kTypeTranslate | kTypeScale | kTypeRectToRect; } +float Matrix4::mapZ(const Vector3& orig) const { + // duplicates logic for mapPoint3d's z coordinate + return orig.x * data[2] + orig.y * data[6] + orig.z * data[kScaleZ] + data[kTranslateZ]; +} + void Matrix4::mapPoint3d(Vector3& vec) const { //TODO: optimize simple case - Vector3 orig(vec); + const Vector3 orig(vec); vec.x = orig.x * data[kScaleX] + orig.y * data[kSkewX] + orig.z * data[8] + data[kTranslateX]; vec.y = orig.x * data[kSkewY] + orig.y * data[kScaleY] + orig.z * data[9] + data[kTranslateY]; vec.z = orig.x * data[2] + orig.y * data[6] + orig.z * data[kScaleZ] + data[kTranslateZ]; |