| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/ozone/platform/dri/dri_surface_factory.h" | 5 #include "ui/ozone/platform/dri/dri_surface_factory.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 int frame_delay_ms) { | 116 int frame_delay_ms) { |
| 117 cursor_widget_ = widget; | 117 cursor_widget_ = widget; |
| 118 cursor_bitmaps_ = bitmaps; | 118 cursor_bitmaps_ = bitmaps; |
| 119 cursor_location_ = location; | 119 cursor_location_ = location; |
| 120 cursor_frame_ = 0; | 120 cursor_frame_ = 0; |
| 121 cursor_frame_delay_ms_ = frame_delay_ms; | 121 cursor_frame_delay_ms_ = frame_delay_ms; |
| 122 cursor_timer_.Stop(); | 122 cursor_timer_.Stop(); |
| 123 | 123 |
| 124 if (cursor_frame_delay_ms_) | 124 if (cursor_frame_delay_ms_) |
| 125 cursor_timer_.Start( | 125 cursor_timer_.Start( |
| 126 FROM_HERE, | 126 FROM_HERE, base::TimeDelta::FromMilliseconds(cursor_frame_delay_ms_), |
| 127 base::TimeDelta::FromMilliseconds(cursor_frame_delay_ms_), | 127 this, &DriSurfaceFactory::OnCursorAnimationTimeout); |
| 128 this, | |
| 129 &DriSurfaceFactory::OnCursorAnimationTimeout); | |
| 130 | 128 |
| 131 if (state_ != INITIALIZED) | 129 if (state_ != INITIALIZED) |
| 132 return; | 130 return; |
| 133 | 131 |
| 134 ResetCursor(); | 132 ResetCursor(); |
| 135 } | 133 } |
| 136 | 134 |
| 137 void DriSurfaceFactory::MoveHardwareCursor(gfx::AcceleratedWidget widget, | 135 void DriSurfaceFactory::MoveHardwareCursor(gfx::AcceleratedWidget widget, |
| 138 const gfx::Point& location) { | 136 const gfx::Point& location) { |
| 139 cursor_location_ = location; | 137 cursor_location_ = location; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 173 } |
| 176 | 174 |
| 177 void DriSurfaceFactory::OnCursorAnimationTimeout() { | 175 void DriSurfaceFactory::OnCursorAnimationTimeout() { |
| 178 cursor_frame_++; | 176 cursor_frame_++; |
| 179 cursor_frame_ %= cursor_bitmaps_.size(); | 177 cursor_frame_ %= cursor_bitmaps_.size(); |
| 180 | 178 |
| 181 ResetCursor(); | 179 ResetCursor(); |
| 182 } | 180 } |
| 183 | 181 |
| 184 } // namespace ui | 182 } // namespace ui |
| OLD | NEW |