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

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

Issue 249303002: Revert of 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 9c2f609bf8e5d370497eaf27d8934d70296f87ec..0161da29b2b31201d8ef9891a651f44b5b8dce8f 100644
--- a/ui/base/cursor/cursor_loader_x11.cc
+++ b/ui/base/cursor/cursor_loader_x11.cc
@@ -159,11 +159,12 @@
const gfx::Point& hot) {
const gfx::ImageSkia* image =
ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id);
- const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(scale());
+ const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(
+ display().device_scale_factor());
SkBitmap bitmap = image_rep.sk_bitmap();
gfx::Point hotpoint = hot;
ScaleAndRotateCursorBitmapAndHotpoint(
- scale(), rotation(), &bitmap, &hotpoint);
+ scale(), display().rotation(), &bitmap, &hotpoint);
XcursorImage* x_image = SkBitmapToXcursorImage(&bitmap, hotpoint);
cursors_[id] = CreateReffedCustomXCursor(x_image);
@@ -176,7 +177,8 @@
int frame_delay_ms) {
const gfx::ImageSkia* image =
ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id);
- const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(scale());
+ const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(
+ display().device_scale_factor());
SkBitmap bitmap = image_rep.sk_bitmap();
int frame_width = bitmap.height();
int frame_height = frame_width;
@@ -231,7 +233,8 @@
xcursor = invisible_cursor_.get();
else if (*cursor == kCursorCustom)
xcursor = cursor->platform();
- else if (scale() == 1.0f && rotation() == gfx::Display::ROTATE_0) {
+ else if (display().device_scale_factor() == 1.0f &&
+ display().rotation() == gfx::Display::ROTATE_0) {
xcursor = GetXCursor(CursorShapeFromNative(*cursor));
} else {
xcursor = ImageCursorFromNative(kCursorPointer);
« no previous file with comments | « ui/base/cursor/cursor_loader_ozone.cc ('k') | ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698