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

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

Issue 2591363002: Adding drawable to CRD andorid and iOS gl rendering pipeline. (Closed)
Patch Set: Trying to fix android. 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.cc
diff --git a/remoting/client/display/gl_cursor.cc b/remoting/client/display/gl_cursor.cc
index 4a4c55a1824ef50cd2cb5fd971ef1b4ba6271a49..1668bda9e9129139c39e4c4b48bf8b8b8a433229 100644
--- a/remoting/client/display/gl_cursor.cc
+++ b/remoting/client/display/gl_cursor.cc
@@ -18,7 +18,9 @@ namespace {
const int kDefaultCursorDataSize = 32 * 32 * GlRenderLayer::kBytesPerPixel;
} // namespace
-GlCursor::GlCursor() {}
+GlCursor::GlCursor() : weak_factory_(this) {
+ SetZIndex(DrawableZIndex::CURSOR);
+}
GlCursor::~GlCursor() {}
@@ -68,7 +70,7 @@ void GlCursor::SetCursorVisible(bool visible) {
visible_ = visible;
}
-void GlCursor::SetCanvas(GlCanvas* canvas) {
+void GlCursor::SetCanvas(Canvas* canvas) {
if (!canvas) {
layer_.reset();
return;
@@ -80,10 +82,11 @@ void GlCursor::SetCanvas(GlCanvas* canvas) {
SetCursorPosition(cursor_x_, cursor_y_);
}
-void GlCursor::Draw() {
+bool GlCursor::Draw() {
if (layer_ && current_cursor_data_ && visible_) {
layer_->Draw(1.f);
}
+ return false;
}
void GlCursor::SetCurrentCursorShape(bool size_changed) {
@@ -98,4 +101,8 @@ void GlCursor::SetCurrentCursorShape(bool size_changed) {
}
}
+base::WeakPtr<Drawable> GlCursor::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
joedow 2017/01/10 00:19:44 Maybe I missed the conclusion of this discussion f
nicholss 2017/01/10 16:58:34 That was not for this class.
joedow 2017/01/10 18:49:27 I thought it was for all classes which expose a We
Yuwei 2017/01/10 19:36:10 As discussed offline, these Drawables are supposed
nicholss 2017/01/10 21:43:10 Acknowledged.
+}
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698