| Index: ui/base/cursor/cursor_loader_x11.cc
|
| diff --git a/ui/base/cursor/cursor_loader_x11.cc b/ui/base/cursor/cursor_loader_x11.cc
|
| index 9c2f609bf8e5d370497eaf27d8934d70296f87ec..e0bb9eaeb70dc90074b1f4e8856db81899dcbe89 100644
|
| --- a/ui/base/cursor/cursor_loader_x11.cc
|
| +++ b/ui/base/cursor/cursor_loader_x11.cc
|
| @@ -162,8 +162,10 @@ void CursorLoaderX11::LoadImageCursor(int id,
|
| const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(scale());
|
| SkBitmap bitmap = image_rep.sk_bitmap();
|
| gfx::Point hotpoint = hot;
|
| + // TODO(oshima): The cursor should use resource scale factor when
|
| + // fractional scale factor is enabled. crbug.com/372212
|
| ScaleAndRotateCursorBitmapAndHotpoint(
|
| - scale(), rotation(), &bitmap, &hotpoint);
|
| + scale() / image_rep.scale(), rotation(), &bitmap, &hotpoint);
|
|
|
| XcursorImage* x_image = SkBitmapToXcursorImage(&bitmap, hotpoint);
|
| cursors_[id] = CreateReffedCustomXCursor(x_image);
|
| @@ -174,6 +176,7 @@ void CursorLoaderX11::LoadAnimatedCursor(int id,
|
| int resource_id,
|
| const gfx::Point& hot,
|
| int frame_delay_ms) {
|
| + // TODO(oshima|tdanderson): Support rotation and fractional scale factor.
|
| const gfx::ImageSkia* image =
|
| ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id);
|
| const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(scale());
|
| @@ -240,6 +243,10 @@ void CursorLoaderX11::SetPlatformCursor(gfx::NativeCursor* cursor) {
|
| cursor->SetPlatformCursor(xcursor);
|
| }
|
|
|
| +const XcursorImage* CursorLoaderX11::GetXcursorImageForTest(int id) {
|
| + return test::GetCachedXcursorImage(cursors_[id]);
|
| +}
|
| +
|
| bool CursorLoaderX11::IsImageCursor(gfx::NativeCursor native_cursor) {
|
| int type = native_cursor.native_type();
|
| return cursors_.count(type) || animated_cursors_.count(type);
|
|
|