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

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

Issue 2591363002: Adding drawable to CRD andorid and iOS gl rendering pipeline. (Closed)
Patch Set: More like GetZIndex. 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_cursor_feedback.cc
diff --git a/remoting/client/display/gl_cursor_feedback.cc b/remoting/client/display/gl_cursor_feedback.cc
index 41736aed0193c7700b2fff1081c0f58973ff7ffa..978042117db3902971d25044c4bf6f436a941313 100644
--- a/remoting/client/display/gl_cursor_feedback.cc
+++ b/remoting/client/display/gl_cursor_feedback.cc
@@ -9,7 +9,7 @@
#include <array>
#include "base/logging.h"
-#include "remoting/client/display/gl_canvas.h"
+#include "remoting/client/display/canvas.h"
#include "remoting/client/display/gl_cursor_feedback_texture.h"
#include "remoting/client/display/gl_math.h"
#include "remoting/client/display/gl_render_layer.h"
@@ -43,11 +43,11 @@ float GetExpansionCoefficient(float progress) {
namespace remoting {
-GlCursorFeedback::GlCursorFeedback() {}
+GlCursorFeedback::GlCursorFeedback() : weak_factory_(this) {}
GlCursorFeedback::~GlCursorFeedback() {}
-void GlCursorFeedback::SetCanvas(GlCanvas* canvas) {
+void GlCursorFeedback::SetCanvas(base::WeakPtr<Canvas> canvas) {
if (!canvas) {
layer_.reset();
return;
@@ -67,6 +67,7 @@ void GlCursorFeedback::StartAnimation(float x, float y, float diameter) {
}
bool GlCursorFeedback::Draw() {
+ DCHECK(thread_checker_.CalledOnValidThread());
if (!layer_ || animation_start_time_.is_null()) {
return false;
}
@@ -89,4 +90,13 @@ bool GlCursorFeedback::Draw() {
return true;
}
+int GlCursorFeedback::GetZIndex() {
+ return Drawable::ZIndex::CURSOR_FEEDBACK;
+}
+
+base::WeakPtr<Drawable> GlCursorFeedback::GetWeakPtr() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ return weak_factory_.GetWeakPtr();
+}
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698