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

Unified Diff: remoting/client/gl_math.cc

Issue 2175963002: [Chromoting] Implement GlRenderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implements full transpose Created 4 years, 5 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 | « remoting/client/gl_math.h ('k') | remoting/client/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/gl_math.cc
diff --git a/remoting/client/gl_math.cc b/remoting/client/gl_math.cc
index b223ff367344ee5d63becbc75c2940840c04a704..85f33693cdd7993da1a60778b4b6b156ce38b25a 100644
--- a/remoting/client/gl_math.cc
+++ b/remoting/client/gl_math.cc
@@ -8,15 +8,21 @@
namespace {
-// | m0, m1, m2, | | Scale_x 0 Offset_x |
-// | m3, m4, m5, | = | 0 Scale_y Offset_y |
+// | m0, m1, m2, | | Scale_x Skew_x Offset_x |
+// | m3, m4, m5, | = | Skew_y Scale_y Offset_y |
// | m6, m7, m8 | | 0 0 1 |
const int kXScaleKey = 0;
-const int kYScaleKey = 4;
+const int kXSkewKey = 1;
const int kXOffsetKey = 2;
+
+const int kYSkewKey = 3;
+const int kYScaleKey = 4;
const int kYOffsetKey = 5;
+const int kXOffsetTransposedKey = 6;
+const int kYOffsetTransposedKey = 7;
+
} // namespace
namespace remoting {
@@ -32,6 +38,12 @@ void NormalizeTransformationMatrix(int view_width,
(*matrix)[kYOffsetKey] /= view_height;
}
+void TransposeTransformationMatrix(std::array<float, 9>* matrix) {
+ std::swap((*matrix)[kXOffsetKey], (*matrix)[kXOffsetTransposedKey]);
+ std::swap((*matrix)[kYOffsetKey], (*matrix)[kYOffsetTransposedKey]);
+ std::swap((*matrix)[kXSkewKey], (*matrix)[kYSkewKey]);
+}
+
void FillRectangleVertexPositions(float left,
float top,
float width,
« no previous file with comments | « remoting/client/gl_math.h ('k') | remoting/client/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698