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

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

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.cc
diff --git a/remoting/client/display/gl_desktop.cc b/remoting/client/display/gl_desktop.cc
index e033d54b36a588e207ac45ed50060a0801e1f867..28f9c5eaa6688269bb1b428d87630e1761763396 100644
--- a/remoting/client/display/gl_desktop.cc
+++ b/remoting/client/display/gl_desktop.cc
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
-#include "remoting/client/display/gl_canvas.h"
+#include "remoting/client/display/canvas.h"
#include "remoting/client/display/gl_math.h"
#include "remoting/client/display/gl_render_layer.h"
#include "remoting/client/display/gl_texture_ids.h"
@@ -57,11 +57,13 @@ struct GlDesktop::GlDesktopTextureContainer {
webrtc::DesktopRect rect;
};
-GlDesktop::GlDesktop() {}
+GlDesktop::GlDesktop() : weak_factory_(this) {
+ SetZIndex(DrawableZIndex::DESKTOP);
+}
GlDesktop::~GlDesktop() {}
-void GlDesktop::SetCanvas(GlCanvas* canvas) {
+void GlDesktop::SetCanvas(Canvas* canvas) {
last_desktop_size_.set(0, 0);
textures_.clear();
canvas_ = canvas;
@@ -83,12 +85,13 @@ void GlDesktop::SetVideoFrame(const webrtc::DesktopFrame& frame) {
}
}
-void GlDesktop::Draw() {
+bool GlDesktop::Draw() {
if (!textures_.empty() && !last_desktop_size_.is_empty()) {
for (std::unique_ptr<GlDesktopTextureContainer>& texture : textures_) {
texture->layer->Draw(1.0f);
}
}
+ return false;
}
void GlDesktop::ReallocateTextures(const webrtc::DesktopSize& size) {
@@ -124,4 +127,8 @@ void GlDesktop::ReallocateTextures(const webrtc::DesktopSize& size) {
}
}
+base::WeakPtr<Drawable> GlDesktop::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698