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_OPENGL_GL_RENDER_LAYER_H_ | 5 #ifndef REMOTING_CLIENT_OPENGL_GL_RENDER_LAYER_H_ |
6 #define REMOTING_CLIENT_OPENGL_GL_RENDER_LAYER_H_ | 6 #define REMOTING_CLIENT_OPENGL_GL_RENDER_LAYER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
10 #include "remoting/client/sys_opengl.h" | 10 #include "remoting/client/sys_opengl.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // x_upperright, y_upperright, x_lowerright, y_lowerright ] | 43 // x_upperright, y_upperright, x_lowerright, y_lowerright ] |
44 void SetVertexPositions(const std::array<float, 8>& positions); | 44 void SetVertexPositions(const std::array<float, 8>& positions); |
45 | 45 |
46 // Sets the visible area of the texture. The default values are (0, 0), | 46 // Sets the visible area of the texture. The default values are (0, 0), |
47 // (0, 1), (1, 0), (1, 1), i.e. showing the whole texture. | 47 // (0, 1), (1, 0), (1, 1), i.e. showing the whole texture. |
48 // positions: [ x_upperleft, y_upperleft, x_lowerleft, y_lowerleft, | 48 // positions: [ x_upperleft, y_upperleft, x_lowerleft, y_lowerleft, |
49 // x_upperright, y_upperright, x_lowerright, y_lowerright ] | 49 // x_upperright, y_upperright, x_lowerright, y_lowerright ] |
50 void SetTextureVisibleArea(const std::array<float, 8>& positions); | 50 void SetTextureVisibleArea(const std::array<float, 8>& positions); |
51 | 51 |
52 // Draws the texture on the canvas. Texture must be set before calling Draw(). | 52 // Draws the texture on the canvas. Texture must be set before calling Draw(). |
53 void Draw(); | 53 void Draw(float alpha_multiplier); |
54 | 54 |
55 private: | 55 private: |
56 int texture_id_; | 56 int texture_id_; |
57 GlCanvas* canvas_; | 57 GlCanvas* canvas_; |
58 | 58 |
59 GLuint texture_handle_; | 59 GLuint texture_handle_; |
60 GLuint buffer_handle_; | 60 GLuint buffer_handle_; |
61 | 61 |
62 // true IFF the texture is already set by calling SetTexture(). | 62 // true IFF the texture is already set by calling SetTexture(). |
63 bool texture_set_ = false; | 63 bool texture_set_ = false; |
64 | 64 |
65 // Used in OpenGL ES 2 context which doesn't support GL_UNPACK_ROW_LENGTH to | 65 // Used in OpenGL ES 2 context which doesn't support GL_UNPACK_ROW_LENGTH to |
66 // tightly pack dirty regions before sending them to GPU. | 66 // tightly pack dirty regions before sending them to GPU. |
67 std::unique_ptr<uint8_t[]> update_buffer_; | 67 std::unique_ptr<uint8_t[]> update_buffer_; |
68 int update_buffer_size_ = 0; | 68 int update_buffer_size_ = 0; |
69 | 69 |
70 base::ThreadChecker thread_checker_; | 70 base::ThreadChecker thread_checker_; |
71 DISALLOW_COPY_AND_ASSIGN(GlRenderLayer); | 71 DISALLOW_COPY_AND_ASSIGN(GlRenderLayer); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace remoting | 74 } // namespace remoting |
75 #endif // REMOTING_CLIENT_OPENGL_GL_RENDER_LAYER_H_ | 75 #endif // REMOTING_CLIENT_OPENGL_GL_RENDER_LAYER_H_ |
OLD | NEW |