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

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

Issue 2591363002: Adding drawable to CRD andorid and iOS gl rendering pipeline. (Closed)
Patch Set: More like GetZIndex. 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.h
diff --git a/remoting/client/display/gl_cursor.h b/remoting/client/display/gl_cursor.h
index eec03e84dad274886f275e64abaebab84265f359..07997e064b649ed363044e84989cad06b3f437c3 100644
--- a/remoting/client/display/gl_cursor.h
+++ b/remoting/client/display/gl_cursor.h
@@ -10,6 +10,9 @@
#include <memory>
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
+#include "remoting/client/display/drawable.h"
namespace remoting {
@@ -17,14 +20,14 @@ namespace protocol {
class CursorShapeInfo;
} // namespace protocol
-class GlCanvas;
+class Canvas;
class GlRenderLayer;
// This class draws the cursor on the canvas.
-class GlCursor {
+class GlCursor : public Drawable {
public:
GlCursor();
- ~GlCursor();
+ ~GlCursor() override;
void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape);
@@ -35,12 +38,11 @@ class GlCursor {
// Draw() will do nothing if cursor is not visible.
void SetCursorVisible(bool visible);
- // 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 Draw();
+ // Drawable implementation.
+ void SetCanvas(base::WeakPtr<Canvas> canvas) override;
+ bool Draw() override;
+ int GetZIndex() override;
+ base::WeakPtr<Drawable> GetWeakPtr() override;
private:
void SetCurrentCursorShape(bool size_changed);
@@ -59,6 +61,9 @@ class GlCursor {
float cursor_x_ = 0;
float cursor_y_ = 0;
+ base::ThreadChecker thread_checker_;
+ base::WeakPtrFactory<Drawable> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GlCursor);
};

Powered by Google App Engine
This is Rietveld 408576698