Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: include/utils/SkMatrix44.h

Issue 25484006: Add perspective support to SkMatrix44 initializers. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Switch SkMatrix inputs to SkScalar and be more careful about scalar comparisons Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/utils/SkMatrix44.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/utils/SkMatrix44.h
diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h
index 6e85bb56f4bc2841852c30d4def5841a0ca26bd2..9282770588773d9628ca7d433376b405e6bac354 100644
--- a/include/utils/SkMatrix44.h
+++ b/include/utils/SkMatrix44.h
@@ -137,6 +137,14 @@ public:
return !(other == *this);
}
+ /* When converting from SkMatrix44 to SkMatrix, the third row and
+ * column is dropped. When converting from SkMatrix to SkMatrix44
+ * the third row and column remain as identity:
+ * [ a b c ] [ a b 0 c ]
+ * [ d e f ] -> [ d e 0 f ]
+ * [ g h i ] [ 0 0 1 0 ]
+ * [ g h 0 i ]
+ */
SkMatrix44(const SkMatrix&);
SkMatrix44& operator=(const SkMatrix& src);
operator SkMatrix() const;
@@ -259,6 +267,8 @@ public:
void setRowMajor(const SkMScalar data[]) { this->setRowMajord(data); }
#endif
+ /* This sets the top-left of the matrix and clears the translation and
+ * perspective components (with [3][3] set to 1). */
void set3x3(SkMScalar m00, SkMScalar m01, SkMScalar m02,
SkMScalar m10, SkMScalar m11, SkMScalar m12,
SkMScalar m20, SkMScalar m21, SkMScalar m22);
« no previous file with comments | « no previous file | src/utils/SkMatrix44.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698