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

Unified Diff: remoting/client/display/gl_cursor.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.cc
diff --git a/remoting/client/display/gl_cursor.cc b/remoting/client/display/gl_cursor.cc
index 4a4c55a1824ef50cd2cb5fd971ef1b4ba6271a49..113de2566533260551eaa8a19fdf55053f091cd8 100644
--- a/remoting/client/display/gl_cursor.cc
+++ b/remoting/client/display/gl_cursor.cc
@@ -18,7 +18,7 @@ namespace {
const int kDefaultCursorDataSize = 32 * 32 * GlRenderLayer::kBytesPerPixel;
} // namespace
-GlCursor::GlCursor() {}
+GlCursor::GlCursor() : weak_factory_(this) {}
GlCursor::~GlCursor() {}
@@ -68,7 +68,7 @@ void GlCursor::SetCursorVisible(bool visible) {
visible_ = visible;
}
-void GlCursor::SetCanvas(GlCanvas* canvas) {
+void GlCursor::SetCanvas(base::WeakPtr<Canvas> canvas) {
if (!canvas) {
layer_.reset();
return;
@@ -80,10 +80,16 @@ void GlCursor::SetCanvas(GlCanvas* canvas) {
SetCursorPosition(cursor_x_, cursor_y_);
}
-void GlCursor::Draw() {
+bool GlCursor::Draw() {
+ DCHECK(thread_checker_.CalledOnValidThread());
if (layer_ && current_cursor_data_ && visible_) {
layer_->Draw(1.f);
}
+ return false;
+}
+
+int GlCursor::GetZIndex() {
+ return Drawable::ZIndex::CURSOR;
}
void GlCursor::SetCurrentCursorShape(bool size_changed) {
@@ -98,4 +104,9 @@ void GlCursor::SetCurrentCursorShape(bool size_changed) {
}
}
+base::WeakPtr<Drawable> GlCursor::GetWeakPtr() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ return weak_factory_.GetWeakPtr();
+}
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698