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

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

Issue 2591363002: Adding drawable to CRD andorid and iOS gl rendering pipeline. (Closed)
Patch Set: Cleanup and adding interfaces based on review feedback.: 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_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);
};

Powered by Google App Engine
This is Rietveld 408576698