Chromium Code Reviews| 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..35232036e8c8b87cbc82db2b0a641b9052b7038f 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,10 @@ 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 |
|
joedow
2017/01/10 22:01:55
nit: Add period to end of comment.
|
| + void SetCanvas(base::WeakPtr<Canvas> canvas) override; |
| + bool Draw() override; |
| + base::WeakPtr<Drawable> GetWeakPtr() override; |
| private: |
| void SetCurrentCursorShape(bool size_changed); |
| @@ -59,6 +60,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); |
| }; |