| Index: remoting/client/display/gl_desktop.h
|
| diff --git a/remoting/client/display/gl_desktop.h b/remoting/client/display/gl_desktop.h
|
| index d43247c52b11a429b34f3edb4c79cafc566aa2a1..2249ffa53b66d1a3812624f889fd94e6a5d1c04f 100644
|
| --- a/remoting/client/display/gl_desktop.h
|
| +++ b/remoting/client/display/gl_desktop.h
|
| @@ -9,6 +9,8 @@
|
| #include <vector>
|
|
|
| #include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "remoting/client/display/drawable.h"
|
| #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
|
|
|
| namespace webrtc {
|
| @@ -17,13 +19,13 @@ class DesktopFrame;
|
|
|
| namespace remoting {
|
|
|
| -class GlCanvas;
|
| +class Canvas;
|
|
|
| // This class draws the desktop on the canvas.
|
| -class GlDesktop {
|
| +class GlDesktop : public Drawable {
|
| public:
|
| GlDesktop();
|
| - virtual ~GlDesktop();
|
| + ~GlDesktop() override;
|
|
|
| // |frame| can be either a full frame or updated regions only frame.
|
| void SetVideoFrame(const webrtc::DesktopFrame& frame);
|
| @@ -31,10 +33,11 @@ class GlDesktop {
|
| // Sets the canvas on which the desktop will be drawn. Caller must feed a
|
| // full desktop frame after calling this function.
|
| // If |canvas| is nullptr, nothing will happen when calling Draw().
|
| - void SetCanvas(GlCanvas* canvas);
|
| + void SetCanvas(Canvas* canvas) override;
|
|
|
| // Draws the desktop on the canvas.
|
| - void Draw();
|
| + bool Draw() override;
|
| + base::WeakPtr<Drawable> GetWeakPtr() override;
|
|
|
| private:
|
| struct GlDesktopTextureContainer;
|
| @@ -45,7 +48,8 @@ class GlDesktop {
|
|
|
| webrtc::DesktopSize last_desktop_size_;
|
| int max_texture_size_ = 0;
|
| - GlCanvas* canvas_ = nullptr;
|
| + Canvas* canvas_ = nullptr;
|
| + base::WeakPtrFactory<Drawable> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(GlDesktop);
|
| };
|
|
|