| Index: ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
|
| diff --git a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
|
| index 097d67118be87b99aacfa4dd796d738eaa26c0d4..14dab5617e09978548d63c955c78688982ef25b2 100644
|
| --- a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
|
| +++ b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
|
| @@ -30,6 +30,36 @@ scoped_refptr<BitmapCursorOzone> CreateDefaultBitmapCursor(int type) {
|
|
|
| } // namespace
|
|
|
| +BitmapCursorOzone::BitmapCursorOzone(const SkBitmap& bitmap,
|
| + const gfx::Point& hotspot)
|
| + : hotspot_(hotspot), frame_delay_ms_(0) {
|
| + bitmaps_.push_back(bitmap);
|
| +}
|
| +
|
| +BitmapCursorOzone::BitmapCursorOzone(const std::vector<SkBitmap>& bitmaps,
|
| + const gfx::Point& hotspot,
|
| + int frame_delay_ms)
|
| + : bitmaps_(bitmaps), hotspot_(hotspot), frame_delay_ms_(frame_delay_ms) {
|
| + DCHECK_LT(0, bitmaps.size());
|
| + DCHECK_LE(0, frame_delay_ms);
|
| +}
|
| +
|
| +const gfx::Point& BitmapCursorOzone::hotspot() {
|
| + return hotspot_;
|
| +}
|
| +
|
| +const SkBitmap& BitmapCursorOzone::bitmap() {
|
| + return bitmaps_[0];
|
| +}
|
| +
|
| +const std::vector<SkBitmap>& BitmapCursorOzone::bitmaps() {
|
| + return bitmaps_;
|
| +}
|
| +
|
| +int BitmapCursorOzone::frame_delay_ms() {
|
| + return frame_delay_ms_;
|
| +}
|
| +
|
| BitmapCursorFactoryOzone::BitmapCursorFactoryOzone() {}
|
|
|
| BitmapCursorFactoryOzone::~BitmapCursorFactoryOzone() {}
|
| @@ -57,8 +87,10 @@ PlatformCursor BitmapCursorFactoryOzone::CreateAnimatedCursor(
|
| const gfx::Point& hotspot,
|
| int frame_delay_ms) {
|
| DCHECK_LT(0, bitmaps.size());
|
| - NOTIMPLEMENTED();
|
| - return CreateImageCursor(bitmaps[0], hotspot);
|
| + BitmapCursorOzone* cursor =
|
| + new BitmapCursorOzone(bitmaps, hotspot, frame_delay_ms);
|
| + cursor->AddRef(); // Balanced by UnrefImageCursor.
|
| + return ToPlatformCursor(cursor);
|
| }
|
|
|
| void BitmapCursorFactoryOzone::RefImageCursor(PlatformCursor cursor) {
|
|
|