From f6a11b8a9e25ff9861bbba19251bea84d8a5daf2 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 23 Jun 2010 17:47:49 -0700 Subject: 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 --- libs/hwui/Matrix.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libs/hwui/Matrix.h') 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 + 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]; } -- cgit v1.2.3-59-g8ed1b