Index: remoting/client/gl_desktop.h |
diff --git a/remoting/client/gl_desktop.h b/remoting/client/gl_desktop.h |
index 143a063a22721ec3b9d441e29aa693981c56a31d..748c306f07d2913828ecf6789a93d428eeabd5ec 100644 |
--- a/remoting/client/gl_desktop.h |
+++ b/remoting/client/gl_desktop.h |
@@ -9,6 +9,8 @@ |
#include <vector> |
#include "base/macros.h" |
+#include "base/memory/weak_ptr.h" |
+#include "remoting/client/gl_drawable.h" |
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
namespace webrtc { |
@@ -20,10 +22,10 @@ namespace remoting { |
class GlCanvas; |
// This class draws the desktop on the canvas. |
-class GlDesktop { |
+class GlDesktop : public GlDrawable { |
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(GlCanvas* canvas) override; |
// Draws the desktop on the canvas. |
- void Draw(); |
+ bool Draw() override; |
+ base::WeakPtr<GlDrawable> GetWeakPtr() override; |
private: |
struct GlDesktopTextureContainer; |
@@ -46,6 +49,7 @@ class GlDesktop { |
webrtc::DesktopSize last_desktop_size_; |
int max_texture_size_ = 0; |
GlCanvas* canvas_ = nullptr; |
+ base::WeakPtrFactory<GlDrawable> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(GlDesktop); |
}; |