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_CURSOR_FEEDBACK_H_ | 5 #ifndef REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_ |
6 #define REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_ | 6 #define REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 10 matching lines...) Expand all Loading... |
21 class GlCursorFeedback { | 21 class GlCursorFeedback { |
22 public: | 22 public: |
23 GlCursorFeedback(); | 23 GlCursorFeedback(); |
24 ~GlCursorFeedback(); | 24 ~GlCursorFeedback(); |
25 | 25 |
26 // Sets the canvas on which the cursor feedback will be drawn. Resumes the | 26 // Sets the canvas on which the cursor feedback will be drawn. Resumes the |
27 // feedback texture to the context of the new canvas. | 27 // feedback texture to the context of the new canvas. |
28 // If |canvas| is nullptr, nothing will happen when calling Draw(). | 28 // If |canvas| is nullptr, nothing will happen when calling Draw(). |
29 void SetCanvas(GlCanvas* canvas); | 29 void SetCanvas(GlCanvas* canvas); |
30 | 30 |
31 void StartAnimation(int x, int y, float diameter); | 31 void StartAnimation(float x, float y, float diameter); |
32 | 32 |
33 // Returns true if animation is not finished, false otherwise. Does nothing | 33 // Returns true if animation is not finished, false otherwise. Does nothing |
34 // if the animation has stopped. | 34 // if the animation has stopped. |
35 bool Draw(); | 35 bool Draw(); |
36 | 36 |
37 private: | 37 private: |
38 std::unique_ptr<GlRenderLayer> layer_; | 38 std::unique_ptr<GlRenderLayer> layer_; |
39 float max_diameter_ = 0; | 39 float max_diameter_ = 0; |
40 float cursor_x_ = 0; | 40 float cursor_x_ = 0; |
41 float cursor_y_ = 0; | 41 float cursor_y_ = 0; |
42 base::TimeTicks animation_start_time_; | 42 base::TimeTicks animation_start_time_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(GlCursorFeedback); | 44 DISALLOW_COPY_AND_ASSIGN(GlCursorFeedback); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace remoting | 47 } // namespace remoting |
48 #endif // REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_ | 48 #endif // REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_ |
OLD | NEW |