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

Side by Side Diff: remoting/client/gl_math.cc

Issue 2614443003: Moving the GL implementation details into a sub folder for client display. (Closed)
Patch Set: Adding deps restriction on r/c/display; Moving sys_opengl.h Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « remoting/client/gl_math.h ('k') | remoting/client/gl_render_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/client/gl_math.h"
6
7 #include <sstream>
8
9 namespace remoting {
10
11 void TransposeTransformationMatrix(std::array<float, 9>* matrix) {
12 // | ??, m1, m2, | | ??, m3, m6 |
13 // | m3, ??, m5, | -> | m1, ??, m7 |
14 // | m6, m7, ?? | | m2, m5, ?? |
15 std::swap((*matrix)[1], (*matrix)[3]);
16 std::swap((*matrix)[2], (*matrix)[6]);
17 std::swap((*matrix)[5], (*matrix)[7]);
18 }
19
20 void FillRectangleVertexPositions(float left,
21 float top,
22 float width,
23 float height,
24 std::array<float, 8>* positions) {
25 (*positions)[0] = left;
26 (*positions)[1] = top;
27
28 (*positions)[2] = left;
29 (*positions)[3] = top + height;
30
31 (*positions)[4] = left + width;
32 (*positions)[5] = top;
33
34 (*positions)[6] = left + width;
35 (*positions)[7] = top + height;
36 }
37
38 std::string MatrixToString(const float* mat, int num_rows, int num_cols) {
39 std::ostringstream outstream;
40 outstream << "[\n";
41 for (int i = 0; i < num_rows; i++) {
42 for (int j = 0; j < num_cols; j++) {
43 outstream << mat[i * num_cols + j] << ", ";
44 }
45 outstream << "\n";
46 }
47 outstream << "]";
48 return outstream.str();
49 }
50
51 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/gl_math.h ('k') | remoting/client/gl_render_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698