aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar vollick@chromium.org <vollick@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-14 21:33:55 +0000
committerGravatar vollick@chromium.org <vollick@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-14 21:33:55 +0000
commit9b21c25e742d6a8b69bee8b049e79877f93b5936 (patch)
tree2bf4ad739aa9646c60bba74ff6e880b5d60add42 /src/utils
parent57cff8dbdfb32b3fea426519a4fdc05f13be69d9 (diff)
Add SkMatrix44::setTranspose
It turned out that adding getDouble(...) and setDouble(...) made this change easier, so I've included that in this cl as well. Review URL: https://codereview.appspot.com/6845048 git-svn-id: http://skia.googlecode.com/svn/trunk@6424 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkMatrix44.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils/SkMatrix44.cpp b/src/utils/SkMatrix44.cpp
index abef0b33bb..0e7ad167c2 100644
--- a/src/utils/SkMatrix44.cpp
+++ b/src/utils/SkMatrix44.cpp
@@ -323,6 +323,17 @@ bool SkMatrix44::invert(SkMatrix44* inverse) const {
///////////////////////////////////////////////////////////////////////////////
+void SkMatrix44::transpose() {
+ SkTSwap(fMat[0][1], fMat[1][0]);
+ SkTSwap(fMat[0][2], fMat[2][0]);
+ SkTSwap(fMat[0][3], fMat[3][0]);
+ SkTSwap(fMat[1][2], fMat[2][1]);
+ SkTSwap(fMat[1][3], fMat[3][1]);
+ SkTSwap(fMat[2][3], fMat[3][2]);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
void SkMatrix44::mapScalars(const SkScalar src[4], SkScalar dst[4]) const {
SkScalar result[4];
for (int i = 0; i < 4; i++) {