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

Unified Diff: remoting/client/gl_cursor_feedback.h

Issue 2148743005: [Remoting Android] Cursor & Cursor Feedback for OpenGL Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's Feedback 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_cursor.cc ('k') | remoting/client/gl_cursor_feedback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/gl_cursor_feedback.h
diff --git a/remoting/client/gl_cursor_feedback.h b/remoting/client/gl_cursor_feedback.h
new file mode 100644
index 0000000000000000000000000000000000000000..8850a999151c3388d5c8a65a4de6fcb20795fdc8
--- /dev/null
+++ b/remoting/client/gl_cursor_feedback.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_
+#define REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/time/time.h"
+
+namespace remoting {
+
+class GlCanvas;
+class GlRenderLayer;
+
+// This class draws the cursor feedback on the canvas.
+class GlCursorFeedback {
+ public:
+ GlCursorFeedback();
+ ~GlCursorFeedback();
+
+ // Sets the canvas on which the cursor feedback will be drawn. Resumes the
+ // feedback texture to the context of the new canvas.
+ // If |canvas| is nullptr, nothing will happen when calling Draw().
+ void SetCanvas(GlCanvas* canvas);
+
+ void StartAnimation(float normalized_x,
+ float normalized_y,
+ float normalized_width,
+ float normalized_height);
+
+ // Returns true if animation is not finished, false otherwise. Does nothing
+ // if the animation has stopped.
+ bool Draw();
+
+ private:
+ std::unique_ptr<GlRenderLayer> layer_;
+ float max_width_ = 0;
+ float max_height_ = 0;
+ float cursor_x_ = 0;
+ float cursor_y_ = 0;
+ base::TimeTicks animation_start_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(GlCursorFeedback);
+};
+
+} // namespace remoting
+#endif // REMOTING_CLIENT_OPENGL_GL_CURSOR_FEEDBACK_H_
« no previous file with comments | « remoting/client/gl_cursor.cc ('k') | remoting/client/gl_cursor_feedback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698