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

Unified Diff: remoting/client/display/gl_cursor_feedback.h

Issue 2591363002: Adding drawable to CRD andorid and iOS gl rendering pipeline. (Closed)
Patch Set: Changing a bunch of nits. 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 side-by-side diff with in-line comments
Download patch
Index: remoting/client/display/gl_cursor_feedback.h
diff --git a/remoting/client/display/gl_cursor_feedback.h b/remoting/client/display/gl_cursor_feedback.h
index 230b5239e3568e027b3851237e8cab2a78e845eb..c1f36272079e25fea1b267a3b035d4cca95c5065 100644
--- a/remoting/client/display/gl_cursor_feedback.h
+++ b/remoting/client/display/gl_cursor_feedback.h
@@ -10,29 +10,28 @@
#include <memory>
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
+#include "remoting/client/display/drawable.h"
namespace remoting {
-class GlCanvas;
+class Canvas;
class GlRenderLayer;
// This class draws the cursor feedback on the canvas.
-class GlCursorFeedback {
+class GlCursorFeedback : public Drawable {
public:
GlCursorFeedback();
- ~GlCursorFeedback();
+ ~GlCursorFeedback() override;
- // 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 SetCanvas(Canvas* canvas) override;
void StartAnimation(float x, float y, float diameter);
- // Returns true if animation is not finished, false otherwise. Does nothing
- // if the animation has stopped.
- bool Draw();
+ bool Draw() override;
+
+ base::WeakPtr<Drawable> GetWeakPtr() override;
private:
std::unique_ptr<GlRenderLayer> layer_;
@@ -41,6 +40,7 @@ class GlCursorFeedback {
float cursor_y_ = 0;
base::TimeTicks animation_start_time_;
+ base::WeakPtrFactory<Drawable> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(GlCursorFeedback);
};

Powered by Google App Engine
This is Rietveld 408576698