Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: ui/base/cursor/cursor_loader_x11.cc

Issue 226293005: Use platform's device scale factor for cursor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 0161da29b2b31201d8ef9891a651f44b5b8dce8f..ed1b6d0bc8636a2f7f8ade2196caa8e2d9866196 100644
--- a/ui/base/cursor/cursor_loader_x11.cc
+++ b/ui/base/cursor/cursor_loader_x11.cc
@@ -159,12 +159,11 @@ void CursorLoaderX11::LoadImageCursor(int id,
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;
ScaleAndRotateCursorBitmapAndHotpoint(
- scale(), display().rotation(), &bitmap, &hotpoint);
+ scale(), rotation(), &bitmap, &hotpoint);
XcursorImage* x_image = SkBitmapToXcursorImage(&bitmap, hotpoint);
cursors_[id] = CreateReffedCustomXCursor(x_image);
@@ -177,8 +176,7 @@ void CursorLoaderX11::LoadAnimatedCursor(int id,
int frame_delay_ms) {
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;
@@ -233,8 +231,8 @@ void CursorLoaderX11::SetPlatformCursor(gfx::NativeCursor* cursor) {
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);

Powered by Google App Engine
This is Rietveld 408576698