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

Unified Diff: include/core/SkMatrix44.h

Issue 2085653003: Enable flattening and unflattening of SkColorSpace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Save 12 floats instead of 16 Created 4 years, 6 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
Index: include/core/SkMatrix44.h
diff --git a/include/core/SkMatrix44.h b/include/core/SkMatrix44.h
index d64d4b7074055e489ed673ffa75c31bc9d869bf7..bcf7a03760526b1ef9f648b5810e7985746cda95 100644
--- a/include/core/SkMatrix44.h
+++ b/include/core/SkMatrix44.h
@@ -287,6 +287,11 @@ public:
void asRowMajorf(float[]) const;
void asRowMajord(double[]) const;
+ /** Efficiently reads 12 matrix entries, ignoring the last col.
+ * This is typically useful when we know the last col is (0, 0, 0, 1).
+ */
+ void as4x3ColMajorf(float[]) 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
@@ -312,6 +317,10 @@ public:
SkMScalar m20, SkMScalar m21, SkMScalar m22);
void set3x3ColMajorf(const float[]);
+ /* This sets the top-left of the matrix and clears the
+ * perspective components (with [3][3] set to 1). */
reed1 2016/06/21 20:45:01 Lets make these private helpers at first. Not sure
msarett 2016/06/21 21:47:45 sgtm, done.
+ void set4x3ColMajorf(const float[]);
+
void setTranslate(SkMScalar dx, SkMScalar dy, SkMScalar dz);
void preTranslate(SkMScalar dx, SkMScalar dy, SkMScalar dz);
void postTranslate(SkMScalar dx, SkMScalar dy, SkMScalar dz);

Powered by Google App Engine
This is Rietveld 408576698