Index: ui/ozone/platform/dri/dri_cursor.cc |
diff --git a/ui/ozone/platform/dri/dri_cursor.cc b/ui/ozone/platform/dri/dri_cursor.cc |
index a7b5fba7109768f8d15dec3fb71d24f1fad1b615..a6fe5fe0f71f8f8091cf1f1788d30410430df571 100644 |
--- a/ui/ozone/platform/dri/dri_cursor.cc |
+++ b/ui/ozone/platform/dri/dri_cursor.cc |
@@ -27,23 +27,32 @@ void DriCursor::SetCursor(gfx::AcceleratedWidget widget, |
PlatformCursor platform_cursor) { |
scoped_refptr<BitmapCursorOzone> cursor = |
BitmapCursorFactoryOzone::GetBitmapCursor(platform_cursor); |
- if (cursor_ == cursor) |
+ if (cursor_ == cursor || cursor_window_ != widget) |
return; |
cursor_ = cursor; |
- if (cursor_.get()) |
+ ShowCursor(); |
+} |
+ |
+void DriCursor::ShowCursor() { |
+ if (cursor_.get()) |
hardware_->SetHardwareCursor(cursor_window_, |
cursor_->bitmaps(), |
bitmap_location(), |
cursor_->frame_delay_ms()); |
else |
- UnsetCursor(cursor_window_); |
+ HideCursor(); |
+} |
+ |
+void DriCursor::HideCursor() { |
+ hardware_->SetHardwareCursor( |
+ cursor_window_, std::vector<SkBitmap>(), gfx::Point(), 0); |
} |
void DriCursor::MoveCursorTo(gfx::AcceleratedWidget widget, |
const gfx::PointF& location) { |
if (widget != cursor_window_) |
- UnsetCursor(cursor_window_); |
+ HideCursor(); |
cursor_window_ = widget; |
cursor_location_ = location; |
@@ -77,9 +86,4 @@ gfx::Point DriCursor::bitmap_location() { |
cursor_->hotspot().OffsetFromOrigin(); |
} |
-void DriCursor::UnsetCursor(gfx::AcceleratedWidget widget) { |
- hardware_->SetHardwareCursor( |
- widget, std::vector<SkBitmap>(), gfx::Point(), 0); |
-} |
- |
} // namespace ui |