aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar vollick@chromium.org <vollick@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-19 21:02:06 +0000
committerGravatar vollick@chromium.org <vollick@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-19 21:02:06 +0000
commitf11cf9ff885c81e29f55283174ca34ce2fc5fd23 (patch)
treeabc3cbbe3f4ed4e97b40e0fb2836d92c229b5345 /include
parent8a1cdaece7e1d009befb84f21bb82370025bf4d6 (diff)
Add SkMatrix44::setColMajord, etc.
We have accessors for efficiently getting the matirx data, and it would be nice if we had similar methods for setting the matrix entries. Review URL: https://codereview.appspot.com/6851063 git-svn-id: http://skia.googlecode.com/svn/trunk@6494 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/utils/SkMatrix44.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h
index a046a079df..e1de7c72a2 100644
--- a/include/utils/SkMatrix44.h
+++ b/include/utils/SkMatrix44.h
@@ -126,11 +126,26 @@ public:
this->set(row, col, SkDoubleToMScalar(value));
}
+ /** These methods allow one to efficiently read matrix entries into an
+ * array. The given array must have room for exactly 16 entries. Whenever
+ * possible, they will try to use memcpy rather than an entry-by-entry
+ * copy.
+ */
void asColMajorf(float[]) const;
void asColMajord(double[]) const;
void asRowMajorf(float[]) const;
void asRowMajord(double[]) const;
+ /** These methods allow one to efficiently set all matrix entries from an
+ * array. The given array must have room for exactly 16 entries. Whenever
+ * possible, they will try to use memcpy rather than an entry-by-entry
+ * copy.
+ */
+ void setColMajorf(const float[]);
+ void setColMajord(const double[]);
+ void setRowMajorf(const float[]);
+ void setRowMajord(const double[]);
+
bool isIdentity() const;
void setIdentity();
void reset() { this->setIdentity();}