| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/cursor/cursor_loader_x11.h" | 5 #include "ui/base/cursor/cursor_loader_x11.h" |
| 6 | 6 |
| 7 #include <float.h> | 7 #include <float.h> |
| 8 #include <X11/cursorfont.h> |
| 8 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 9 #include <X11/cursorfont.h> | |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "skia/ext/image_operations.h" | 12 #include "skia/ext/image_operations.h" |
| 13 #include "ui/base/cursor/cursor.h" | 13 #include "ui/base/cursor/cursor.h" |
| 14 #include "ui/base/cursor/cursor_util.h" | 14 #include "ui/base/cursor/cursor_util.h" |
| 15 #include "ui/base/x/x11_util.h" | 15 #include "ui/base/x/x11_util.h" |
| 16 #include "ui/gfx/geometry/point_conversions.h" |
| 16 #include "ui/gfx/image/image.h" | 17 #include "ui/gfx/image/image.h" |
| 17 #include "ui/gfx/point_conversions.h" | |
| 18 #include "ui/gfx/size_conversions.h" | 18 #include "ui/gfx/size_conversions.h" |
| 19 #include "ui/gfx/skbitmap_operations.h" | 19 #include "ui/gfx/skbitmap_operations.h" |
| 20 #include "ui/gfx/skia_util.h" | 20 #include "ui/gfx/skia_util.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Returns X font cursor shape from an Aura cursor. | 24 // Returns X font cursor shape from an Aura cursor. |
| 25 int CursorShapeFromNative(const gfx::NativeCursor& native_cursor) { | 25 int CursorShapeFromNative(const gfx::NativeCursor& native_cursor) { |
| 26 switch (native_cursor.native_type()) { | 26 switch (native_cursor.native_type()) { |
| 27 case ui::kCursorMiddlePanning: | 27 case ui::kCursorMiddlePanning: |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 if (animated_cursors_.count(type)) | 232 if (animated_cursors_.count(type)) |
| 233 return animated_cursors_[type].first; | 233 return animated_cursors_[type].first; |
| 234 | 234 |
| 235 ImageCursorMap::iterator find = cursors_.find(type); | 235 ImageCursorMap::iterator find = cursors_.find(type); |
| 236 if (find != cursors_.end()) | 236 if (find != cursors_.end()) |
| 237 return cursors_[type]; | 237 return cursors_[type]; |
| 238 return GetXCursor(CursorShapeFromNative(native_cursor)); | 238 return GetXCursor(CursorShapeFromNative(native_cursor)); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace ui | 241 } // namespace ui |
| OLD | NEW |