OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_CLIENT_DISPLAY_CANVAS_H_ | 5 #ifndef REMOTING_CLIENT_DISPLAY_CANVAS_H_ |
6 #define REMOTING_CLIENT_DISPLAY_CANVAS_H_ | 6 #define REMOTING_CLIENT_DISPLAY_CANVAS_H_ |
7 | 7 |
8 #include <array> | 8 #include <array> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // | 30 // |
31 // | m0, m1, m2, | | x | | 31 // | m0, m1, m2, | | x | |
32 // | m3, m4, m5, | * | y | | 32 // | m3, m4, m5, | * | y | |
33 // | m6, m7, m8 | | 1 | | 33 // | m6, m7, m8 | | 1 | |
34 // | 34 // |
35 // For a typical transformation matrix such that m1=m3=m6=m7=0 and m8=1, m0 | 35 // For a typical transformation matrix such that m1=m3=m6=m7=0 and m8=1, m0 |
36 // and m4 defines the scaling factor of the canvas and m2 and m5 defines the | 36 // and m4 defines the scaling factor of the canvas and m2 and m5 defines the |
37 // offset of the upper-left corner in pixel. | 37 // offset of the upper-left corner in pixel. |
38 virtual void SetTransformationMatrix(const std::array<float, 9>& matrix) = 0; | 38 virtual void SetTransformationMatrix(const std::array<float, 9>& matrix) = 0; |
39 | 39 |
40 // Sets the size of the view in pixels. | 40 // Sets the size of the view in pixels such that it fills up the the whole |
| 41 // viewport. |
| 42 // Note that this only affects the transformation matrix. It doesn't affect |
| 43 // how the viewport is rendered on the screen. |
41 virtual void SetViewSize(int width, int height) = 0; | 44 virtual void SetViewSize(int width, int height) = 0; |
42 | 45 |
43 // Draws the texture on the canvas. Nothing will happen if | 46 // Draws the texture on the canvas. Nothing will happen if |
44 // SetNormalizedTransformation() has not been called. | 47 // SetNormalizedTransformation() has not been called. |
45 // vertex_buffer: reference to the 2x4x2 float vertex buffer. | 48 // vertex_buffer: reference to the 2x4x2 float vertex buffer. |
46 // [ four (x, y) position of the texture vertices in pixel | 49 // [ four (x, y) position of the texture vertices in pixel |
47 // with respect to the canvas, | 50 // with respect to the canvas, |
48 // four (x, y) position of the vertices in percentage | 51 // four (x, y) position of the vertices in percentage |
49 // defining the visible area of the texture ] | 52 // defining the visible area of the texture ] |
50 // alpha_multiplier: Will be multiplied with the alpha channel of the texture. | 53 // alpha_multiplier: Will be multiplied with the alpha channel of the texture. |
(...skipping 14 matching lines...) Expand all Loading... |
65 // Intended to be given to a Drawable to draw onto. | 68 // Intended to be given to a Drawable to draw onto. |
66 virtual base::WeakPtr<Canvas> GetWeakPtr() = 0; | 69 virtual base::WeakPtr<Canvas> GetWeakPtr() = 0; |
67 | 70 |
68 private: | 71 private: |
69 DISALLOW_COPY_AND_ASSIGN(Canvas); | 72 DISALLOW_COPY_AND_ASSIGN(Canvas); |
70 }; | 73 }; |
71 | 74 |
72 } // namespace remoting | 75 } // namespace remoting |
73 | 76 |
74 #endif // REMOTING_CLIENT_DISPLAY_CANVAS_H_ | 77 #endif // REMOTING_CLIENT_DISPLAY_CANVAS_H_ |
OLD | NEW |