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/base/cursor/cursor_util.h" | 5 #include "ui/base/cursor/cursor_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "skia/ext/image_operations.h" | 8 #include "skia/ext/image_operations.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/gfx/geometry/point_conversions.h" | 10 #include "ui/gfx/geometry/point_conversions.h" |
| 11 #include "ui/gfx/geometry/size_conversions.h" |
11 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
12 #include "ui/gfx/size_conversions.h" | |
13 #include "ui/gfx/skbitmap_operations.h" | 13 #include "ui/gfx/skbitmap_operations.h" |
14 #include "ui/gfx/skia_util.h" | 14 #include "ui/gfx/skia_util.h" |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 | 17 |
18 void ScaleAndRotateCursorBitmapAndHotpoint(float scale, | 18 void ScaleAndRotateCursorBitmapAndHotpoint(float scale, |
19 gfx::Display::Rotation rotation, | 19 gfx::Display::Rotation rotation, |
20 SkBitmap* bitmap, | 20 SkBitmap* bitmap, |
21 gfx::Point* hotpoint) { | 21 gfx::Point* hotpoint) { |
22 switch (rotation) { | 22 switch (rotation) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 SkBitmap cropped = SkBitmapOperations::CreateTiledBitmap( | 101 SkBitmap cropped = SkBitmapOperations::CreateTiledBitmap( |
102 bitmap, x_offset, 0, frame_width, frame_height); | 102 bitmap, x_offset, 0, frame_width, frame_height); |
103 DCHECK_EQ(frame_width, cropped.width()); | 103 DCHECK_EQ(frame_width, cropped.width()); |
104 DCHECK_EQ(frame_height, cropped.height()); | 104 DCHECK_EQ(frame_height, cropped.height()); |
105 | 105 |
106 (*bitmaps)[frame] = cropped; | 106 (*bitmaps)[frame] = cropped; |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 } // namespace ui | 110 } // namespace ui |
OLD | NEW |