const gfx::Point& hot) {
const gfx::ImageSkia* image =
ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id);
- const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(
- display().device_scale_factor());
+ 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(), display().rotation(), &bitmap, &hotpoint);
+ scale() / image_rep.scale(), rotation(), &bitmap, &hotpoint);
XcursorImage* x_image = SkBitmapToXcursorImage(&bitmap, hotpoint);
cursors_[id] = CreateReffedCustomXCursor(x_image);
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(
- display().device_scale_factor());
+ const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(scale());
SkBitmap bitmap = image_rep.sk_bitmap();
int frame_width = bitmap.height();
int frame_height = frame_width;
xcursor = invisible_cursor_.get();
else if (*cursor == kCursorCustom)
xcursor = cursor->platform();
- else if (display().device_scale_factor() == 1.0f &&
- display().rotation() == gfx::Display::ROTATE_0) {
+ else if (scale() == 1.0f && rotation() == gfx::Display::ROTATE_0) {
xcursor = GetXCursor(CursorShapeFromNative(*cursor));
} else {
xcursor = ImageCursorFromNative(kCursorPointer);
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);