summaryrefslogtreecommitdiff
path: root/libs/hwui/Matrix.h
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-06-23 17:47:49 -0700
committer Romain Guy <romainguy@google.com> 2010-06-23 17:47:49 -0700
commitf6a11b8a9e25ff9861bbba19251bea84d8a5daf2 (patch)
treec44f214f59f2206de152585d97b23e2bfaa1b3b0 /libs/hwui/Matrix.h
parentbb9524b6bdddc7ac77d8628daa8b366b8a7be4a4 (diff)
Add support for transformations.
This change adds partial support for the following transforms: - scale() - translate() - rotate() - setMatrix() - getMatrix() The transform is stored in a snapshot and saved/restored as needed. The transform is currently not applied to the clip rect and is not mapped to the vertex shader. Change-Id: Id48993453311200804149917d0c126a4d0471226
Diffstat (limited to 'libs/hwui/Matrix.h')
-rw-r--r--libs/hwui/Matrix.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/hwui/Matrix.h b/libs/hwui/Matrix.h
index 51014a9e6e08..80f3fd6ad06d 100644
--- a/libs/hwui/Matrix.h
+++ b/libs/hwui/Matrix.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_MATRIX_H
#define ANDROID_MATRIX_H
+#include <SkMatrix.h>
+
namespace android {
///////////////////////////////////////////////////////////////////////////////
@@ -37,10 +39,15 @@ public:
load(v);
}
+ Matrix4(const SkMatrix& v) {
+ load(v);
+ }
+
void loadIdentity();
void load(const float* v);
void load(const Matrix4& v);
+ void load(const SkMatrix& v);
void loadTranslate(float x, float y, float z);
void loadScale(float sx, float sy, float sz);
@@ -74,10 +81,11 @@ public:
}
void copyTo(float* v) const;
+ void copyTo(SkMatrix& v) const;
void dump() const;
-//private:
+private:
inline float get(int i, int j) const {
return mMat[i * 4 + j];
}