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

Unified Diff: remoting/client/gl_cursor.h

Issue 2591363002: Adding drawable to CRD andorid and iOS gl rendering pipeline. (Closed)
Patch Set: Minor cleanup of an unused const. Created 4 years 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/gl_cursor.h
diff --git a/remoting/client/gl_cursor.h b/remoting/client/gl_cursor.h
index 365b2c23d7bf4242d78cdf295243c0c5fed58067..c1b5d3adc2cabf24b517f7e97efe4480d8ccccf9 100644
--- a/remoting/client/gl_cursor.h
+++ b/remoting/client/gl_cursor.h
@@ -10,6 +10,8 @@
#include <memory>
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "remoting/client/gl_drawable.h"
namespace remoting {
@@ -21,10 +23,10 @@ class GlCanvas;
class GlRenderLayer;
// This class draws the cursor on the canvas.
-class GlCursor {
+class GlCursor : public GlDrawable {
public:
GlCursor();
- ~GlCursor();
+ ~GlCursor() override;
void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape);
@@ -38,9 +40,10 @@ class GlCursor {
// Sets the canvas on which the cursor will be drawn. Resumes the current
// state of the cursor to the context of the new canvas.
// If |canvas| is nullptr, nothing will happen when calling Draw().
- void SetCanvas(GlCanvas* canvas);
+ void SetCanvas(GlCanvas* canvas) override;
- void Draw();
+ bool Draw() override;
+ base::WeakPtr<GlDrawable> GetWeakPtr() override;
private:
void SetCurrentCursorShape(bool size_changed);
@@ -59,6 +62,8 @@ class GlCursor {
float cursor_x_ = 0;
float cursor_y_ = 0;
+ base::WeakPtrFactory<GlDrawable> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GlCursor);
};

Powered by Google App Engine
This is Rietveld 408576698