OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef UI_BASE_CURSOR_CURSOR_DATA_H_ | 5 #ifndef UI_BASE_CURSOR_CURSOR_DATA_H_ |
6 #define UI_BASE_CURSOR_CURSOR_DATA_H_ | 6 #define UI_BASE_CURSOR_CURSOR_DATA_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // from the renderer to the window server. | 38 // from the renderer to the window server. |
39 class UI_BASE_EXPORT CursorData { | 39 class UI_BASE_EXPORT CursorData { |
40 public: | 40 public: |
41 CursorData(); | 41 CursorData(); |
42 explicit CursorData(CursorType type); | 42 explicit CursorData(CursorType type); |
43 CursorData(const gfx::Point& hostpot_point, | 43 CursorData(const gfx::Point& hostpot_point, |
44 const std::vector<SkBitmap>& cursor_frames, | 44 const std::vector<SkBitmap>& cursor_frames, |
45 float scale_factor, | 45 float scale_factor, |
46 const base::TimeDelta& frame_delay); | 46 const base::TimeDelta& frame_delay); |
47 CursorData(const CursorData& cursor); | 47 CursorData(const CursorData& cursor); |
| 48 CursorData(CursorData&& cursor); |
48 ~CursorData(); | 49 ~CursorData(); |
49 | 50 |
50 CursorData& operator=(const CursorData& cursor); | 51 CursorData& operator=(const CursorData& cursor); |
| 52 CursorData& operator=(CursorData&& cursor); |
51 | 53 |
52 CursorType cursor_type() const { return cursor_type_; } | 54 CursorType cursor_type() const { return cursor_type_; } |
53 const base::TimeDelta& frame_delay() const { return frame_delay_; } | 55 const base::TimeDelta& frame_delay() const { return frame_delay_; } |
54 float scale_factor() const { return scale_factor_; } | 56 float scale_factor() const { return scale_factor_; } |
55 const gfx::Point& hotspot_in_pixels() const { return hotspot_; } | 57 const gfx::Point& hotspot_in_pixels() const { return hotspot_; } |
56 const std::vector<SkBitmap>& cursor_frames() const { return cursor_frames_; } | 58 const std::vector<SkBitmap>& cursor_frames() const { return cursor_frames_; } |
57 | 59 |
58 // Returns true if this CursorData instance is of |cursor_type|. | 60 // Returns true if this CursorData instance is of |cursor_type|. |
59 bool IsType(CursorType cursor_type) const; | 61 bool IsType(CursorType cursor_type) const; |
60 | 62 |
(...skipping 27 matching lines...) Expand all Loading... |
88 | 90 |
89 // Generator IDs. The size of |generator_ids_| must be equal to the size of | 91 // Generator IDs. The size of |generator_ids_| must be equal to the size of |
90 // cursor_frames_, and is generated when we set the bitmaps. We produce these | 92 // cursor_frames_, and is generated when we set the bitmaps. We produce these |
91 // unique IDs so we can do quick equality checks. | 93 // unique IDs so we can do quick equality checks. |
92 std::vector<uint32_t> generator_ids_; | 94 std::vector<uint32_t> generator_ids_; |
93 }; | 95 }; |
94 | 96 |
95 } // namespace ui | 97 } // namespace ui |
96 | 98 |
97 #endif // UI_BASE_CURSOR_CURSOR_DATA_H_ | 99 #endif // UI_BASE_CURSOR_CURSOR_DATA_H_ |
OLD | NEW |