summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-23 09:03:29 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-23 09:03:29 +0000
commita7736a58c95220c405e5ff06ecddb387e3842328 (patch)
tree1ca004d883106f30def1ed3c846d6ed2bce3692e /ash
parent2fb3888046f9206c1c91357f36502642897ea4d6 (diff)
downloadchromium_src-a7736a58c95220c405e5ff06ecddb387e3842328.zip
chromium_src-a7736a58c95220c405e5ff06ecddb387e3842328.tar.gz
chromium_src-a7736a58c95220c405e5ff06ecddb387e3842328.tar.bz2
Use platform's device scale factor for cursor instead of gfx::Display because gfx::Display's DSF may differ from
platform's one when UI scaling is used. BUG=361672 TEST=covered by unit test Review URL: https://codereview.chromium.org/226293005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265592 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/display/display_controller_unittest.cc12
-rw-r--r--ash/display/display_manager.cc2
-rw-r--r--ash/display/mouse_cursor_event_filter_unittest.cc6
-rw-r--r--ash/display/screen_ash.cc3
-rw-r--r--ash/test/cursor_manager_test_api.cc11
-rw-r--r--ash/test/cursor_manager_test_api.h8
-rw-r--r--ash/wm/ash_native_cursor_manager.cc3
-rw-r--r--ash/wm/ash_native_cursor_manager_interactive_uitest.cc4
-rw-r--r--ash/wm/ash_native_cursor_manager_unittest.cc73
-rw-r--r--ash/wm/drag_window_resizer_unittest.cc12
-rw-r--r--ash/wm/image_cursors.cc54
-rw-r--r--ash/wm/image_cursors.h15
12 files changed, 116 insertions, 87 deletions
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 3da1368..95b7af6 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -935,11 +935,11 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
EXPECT_EQ(1.0f, primary_root->GetHost()->compositor()->
device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
EXPECT_EQ(2.0f, secondary_root->GetHost()->compositor()->
device_scale_factor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
// Switch primary and secondary
display_controller->SetPrimaryDisplay(secondary_display);
@@ -949,23 +949,23 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
EXPECT_EQ(1.0f, secondary_root->GetHost()->compositor()->
device_scale_factor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(2.0f, primary_root->GetHost()->compositor()->
device_scale_factor());
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
// Deleting 2nd display.
UpdateDisplay("200x200");
RunAllPendingInMessageLoop(); // RootWindow is deleted in a posted task.
// Cursor's device scale factor should be updated even without moving cursor.
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(1.0f, primary_root->GetHost()->compositor()->
device_scale_factor());
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
}
TEST_F(DisplayControllerTest, OverscanInsets) {
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 83d747a..7f6d713 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -838,6 +838,8 @@ bool DisplayManager::IsMirrored() const {
}
const DisplayInfo& DisplayManager::GetDisplayInfo(int64 display_id) const {
+ DCHECK_NE(gfx::Display::kInvalidDisplayID, display_id);
+
std::map<int64, DisplayInfo>::const_iterator iter =
display_info_.find(display_id);
CHECK(iter != display_info_.end()) << display_id;
diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc
index 1b34456..3325d37 100644
--- a/ash/display/mouse_cursor_event_filter_unittest.cc
+++ b/ash/display/mouse_cursor_event_filter_unittest.cc
@@ -368,11 +368,11 @@ TEST_F(MouseCursorEventFilterTest, CursorDeviceScaleFactor) {
test::CursorManagerTestApi cursor_test_api(
Shell::GetInstance()->cursor_manager());
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
WarpMouseCursorIfNecessary(root_windows[0], gfx::Point(399, 200));
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
WarpMouseCursorIfNecessary(root_windows[1], gfx::Point(400, 200));
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
}
} // namespace ash
diff --git a/ash/display/screen_ash.cc b/ash/display/screen_ash.cc
index d32deb8..9d42e49e 100644
--- a/ash/display/screen_ash.cc
+++ b/ash/display/screen_ash.cc
@@ -234,7 +234,8 @@ gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const {
return GetPrimaryDisplay();
const RootWindowSettings* rws = GetRootWindowSettings(root_window);
if (rws->shutdown)
- return gfx::Display(1);
+ return GetPrimaryDisplay();
+
int64 id = rws->display_id;
// if id is |kInvaildDisplayID|, it's being deleted.
DCHECK(id != gfx::Display::kInvalidDisplayID);
diff --git a/ash/test/cursor_manager_test_api.cc b/ash/test/cursor_manager_test_api.cc
index 22aa261..4ff7cf7 100644
--- a/ash/test/cursor_manager_test_api.cc
+++ b/ash/test/cursor_manager_test_api.cc
@@ -31,9 +31,16 @@ gfx::NativeCursor CursorManagerTestApi::GetCurrentCursor() const {
return cursor_manager_->GetCursor();
}
-gfx::Display CursorManagerTestApi::GetDisplay() const {
+gfx::Display::Rotation
+CursorManagerTestApi::GetCurrentCursorRotation() const {
return ShellTestApi(Shell::GetInstance()).ash_native_cursor_manager()->
- image_cursors_->GetDisplay();
+ image_cursors_->GetRotation();
+}
+
+float
+CursorManagerTestApi::GetCurrentCursorScale() const {
+ return ShellTestApi(Shell::GetInstance()).ash_native_cursor_manager()->
+ image_cursors_->GetScale();
}
} // namespace test
diff --git a/ash/test/cursor_manager_test_api.h b/ash/test/cursor_manager_test_api.h
index 1b9c6b8..fce98ca 100644
--- a/ash/test/cursor_manager_test_api.h
+++ b/ash/test/cursor_manager_test_api.h
@@ -7,12 +7,9 @@
#include "base/basictypes.h"
#include "ui/base/cursor/cursor.h"
+#include "ui/gfx/display.h"
#include "ui/gfx/native_widget_types.h"
-namespace gfx {
-class Display;
-}
-
namespace wm {
class CursorManager;
}
@@ -28,7 +25,8 @@ class CursorManagerTestApi {
ui::CursorSetType GetCurrentCursorSet() const;
gfx::NativeCursor GetCurrentCursor() const;
- gfx::Display GetDisplay() const;
+ gfx::Display::Rotation GetCurrentCursorRotation() const;
+ float GetCurrentCursorScale() const;
private:
::wm::CursorManager* cursor_manager_;
diff --git a/ash/wm/ash_native_cursor_manager.cc b/ash/wm/ash_native_cursor_manager.cc
index 98078ac..e78eb94 100644
--- a/ash/wm/ash_native_cursor_manager.cc
+++ b/ash/wm/ash_native_cursor_manager.cc
@@ -95,8 +95,7 @@ void AshNativeCursorManager::SetCursor(
new_cursor.SetPlatformCursor(invisible_cursor.platform());
}
}
- new_cursor.set_device_scale_factor(
- image_cursors_->GetDisplay().device_scale_factor());
+ new_cursor.set_device_scale_factor(image_cursors_->GetScale());
delegate->CommitCursor(new_cursor);
diff --git a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
index 5eee024..83df158 100644
--- a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
+++ b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
@@ -102,10 +102,10 @@ TEST_F(AshNativeCursorManagerTest, MAYBE_CursorChangeOnEnterNotify) {
display_manager->OnNativeDisplaysChanged(display_info_list);
MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10);
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10);
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
}
} // namespace ash
diff --git a/ash/wm/ash_native_cursor_manager_unittest.cc b/ash/wm/ash_native_cursor_manager_unittest.cc
index 812601f..5713fe3 100644
--- a/ash/wm/ash_native_cursor_manager_unittest.cc
+++ b/ash/wm/ash_native_cursor_manager_unittest.cc
@@ -4,6 +4,8 @@
#include "ash/wm/ash_native_cursor_manager.h"
+#include "ash/display/display_info.h"
+#include "ash/display/display_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/cursor_manager_test_api.h"
@@ -54,18 +56,16 @@ typedef test::AshTestBase AshNativeCursorManagerTest;
TEST_F(AshNativeCursorManagerTest, LockCursor) {
::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
- gfx::Display display(0);
+
#if defined(OS_WIN)
ui::CursorLoaderWin::SetCursorResourceModule(L"ash_unittests.exe");
#endif
cursor_manager->SetCursor(ui::kCursorCopy);
EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
- display.set_device_scale_factor(2.0f);
- display.set_rotation(gfx::Display::ROTATE_90);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ UpdateDisplay("800x800*2/r");
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
EXPECT_EQ(ui::CURSOR_SET_NORMAL, test_api.GetCurrentCursorSet());
- EXPECT_EQ(gfx::Display::ROTATE_90, test_api.GetDisplay().rotation());
+ EXPECT_EQ(gfx::Display::ROTATE_90, test_api.GetCurrentCursorRotation());
EXPECT_TRUE(test_api.GetCurrentCursor().platform());
cursor_manager->LockCursor();
@@ -85,18 +85,16 @@ TEST_F(AshNativeCursorManagerTest, LockCursor) {
EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
// Device scale factor and rotation do change even while cursor is locked.
- display.set_device_scale_factor(1.0f);
- display.set_rotation(gfx::Display::ROTATE_180);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(gfx::Display::ROTATE_180, test_api.GetDisplay().rotation());
+ UpdateDisplay("800x800/u");
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+ EXPECT_EQ(gfx::Display::ROTATE_180, test_api.GetCurrentCursorRotation());
cursor_manager->UnlockCursor();
EXPECT_FALSE(cursor_manager->IsCursorLocked());
// Cursor type changes to the one specified while cursor is locked.
EXPECT_EQ(ui::kCursorPointer, test_api.GetCurrentCursor().native_type());
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
EXPECT_TRUE(test_api.GetCurrentCursor().platform());
}
@@ -133,18 +131,47 @@ TEST_F(AshNativeCursorManagerTest, SetCursorSet) {
TEST_F(AshNativeCursorManagerTest, SetDeviceScaleFactorAndRotation) {
::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
+ UpdateDisplay("800x100*2");
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
+ EXPECT_EQ(gfx::Display::ROTATE_0, test_api.GetCurrentCursorRotation());
+
+ UpdateDisplay("800x100/l");
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+ EXPECT_EQ(gfx::Display::ROTATE_270, test_api.GetCurrentCursorRotation());
+}
- gfx::Display display(0);
- display.set_device_scale_factor(2.0f);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(gfx::Display::ROTATE_0, test_api.GetDisplay().rotation());
-
- display.set_device_scale_factor(1.0f);
- display.set_rotation(gfx::Display::ROTATE_270);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(gfx::Display::ROTATE_270, test_api.GetDisplay().rotation());
+TEST_F(AshNativeCursorManagerTest, UIScaleShouldNotChangeCursor) {
+ int64 display_id = Shell::GetScreen()->GetPrimaryDisplay().id();
+ gfx::Display::SetInternalDisplayId(display_id);
+
+ ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ CursorManagerTestApi test_api(cursor_manager);
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+
+ DisplayInfo::SetAllowUpgradeToHighDPI(false);
+ display_manager->SetDisplayUIScale(display_id, 0.5f);
+ EXPECT_EQ(1.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+
+ display_manager->SetDisplayUIScale(display_id, 1.0f);
+
+ DisplayInfo::SetAllowUpgradeToHighDPI(true);
+ // 1x display should keep using 1x cursor even if the DSF is upgraded to 2x.
+ display_manager->SetDisplayUIScale(display_id, 0.5f);
+ EXPECT_EQ(2.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+
+ // 2x display should keep using 2x cursor regardless of the UI scale.
+ UpdateDisplay("800x800*2");
+ EXPECT_EQ(2.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
+ display_manager->SetDisplayUIScale(display_id, 2.0f);
+ EXPECT_EQ(1.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
}
TEST_F(AshNativeCursorManagerTest, DisabledQueryMouseLocation) {
diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc
index dbb4da0..369a285 100644
--- a/ash/wm/drag_window_resizer_unittest.cc
+++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -494,13 +494,13 @@ TEST_F(DragWindowResizerTest, CursorDeviceScaleFactor) {
// Grab (0, 0) of the window.
scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer(
window_.get(), gfx::Point(), HTCAPTION));
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
ASSERT_TRUE(resizer.get());
resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0);
WarpMouseCursorIfNecessary(root_windows[0], gfx::Point(399, 200));
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
resizer->CompleteDrag();
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
}
// Move window from the root window with 2.0 device scale factor to the root
@@ -518,13 +518,13 @@ TEST_F(DragWindowResizerTest, CursorDeviceScaleFactor) {
// Grab (0, 0) of the window.
scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer(
window_.get(), gfx::Point(), HTCAPTION));
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
ASSERT_TRUE(resizer.get());
resizer->Drag(CalculateDragPoint(*resizer, -200, 200), 0);
WarpMouseCursorIfNecessary(root_windows[1], gfx::Point(400, 200));
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
resizer->CompleteDrag();
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
}
}
diff --git a/ash/wm/image_cursors.cc b/ash/wm/image_cursors.cc
index e63bece..2a41375 100644
--- a/ash/wm/image_cursors.cc
+++ b/ash/wm/image_cursors.cc
@@ -6,6 +6,9 @@
#include <float.h>
+#include "ash/display/display_info.h"
+#include "ash/display/display_manager.h"
+#include "ash/shell.h"
#include "base/logging.h"
#include "base/strings/string16.h"
#include "ui/base/cursor/cursor.h"
@@ -56,41 +59,54 @@ const int kAnimatedCursorIds[] = {
ui::kCursorProgress
};
-ImageCursors::ImageCursors() : scale_(1.f), cursor_set_(ui::CURSOR_SET_NORMAL) {
+ImageCursors::ImageCursors() : cursor_set_(ui::CURSOR_SET_NORMAL) {
}
ImageCursors::~ImageCursors() {
}
-gfx::Display ImageCursors::GetDisplay() const {
+float ImageCursors::GetScale() const {
if (!cursor_loader_) {
NOTREACHED();
// Returning default on release build as it's not serious enough to crash
// even if this ever happens.
- return gfx::Display();
+ return 1.0f;
}
- return cursor_loader_->display();
+ return cursor_loader_->scale();
+}
+
+gfx::Display::Rotation ImageCursors::GetRotation() const {
+ if (!cursor_loader_) {
+ NOTREACHED();
+ // Returning default on release build as it's not serious enough to crash
+ // even if this ever happens.
+ return gfx::Display::ROTATE_0;
+ }
+ return cursor_loader_->rotation();
}
bool ImageCursors::SetDisplay(const gfx::Display& display) {
- float device_scale_factor = display.device_scale_factor();
+ DCHECK(display.is_valid());
+ // Use the platform's device scale factor instead of display's
+ // that might have been adjusted for UI scale.
+ float scale_factor = Shell::GetInstance()->display_manager()->
+ GetDisplayInfo(display.id()).device_scale_factor();
+
if (!cursor_loader_) {
cursor_loader_.reset(ui::CursorLoader::Create());
- cursor_loader_->set_scale(scale_);
- } else if (cursor_loader_->display().rotation() == display.rotation() &&
- cursor_loader_->display().device_scale_factor() ==
- device_scale_factor) {
+ } else if (cursor_loader_->rotation() == display.rotation() &&
+ cursor_loader_->scale() == scale_factor) {
return false;
}
- cursor_loader_->set_display(display);
+ cursor_loader_->set_rotation(display.rotation());
+ cursor_loader_->set_scale(scale_factor);
ReloadCursors();
return true;
}
void ImageCursors::ReloadCursors() {
- const gfx::Display& display = cursor_loader_->display();
- float device_scale_factor = display.device_scale_factor();
+ float device_scale_factor = cursor_loader_->scale();
cursor_loader_->UnloadAll();
@@ -121,20 +137,6 @@ void ImageCursors::ReloadCursors() {
}
}
-void ImageCursors::SetScale(float scale) {
- if (scale < FLT_EPSILON) {
- NOTREACHED() << "Scale must be bigger than 0.";
- scale = 1.0f;
- }
-
- scale_ = scale;
-
- if (cursor_loader_.get()) {
- cursor_loader_->set_scale(scale);
- ReloadCursors();
- }
-}
-
void ImageCursors::SetCursorSet(ui::CursorSetType cursor_set) {
if (cursor_set_ == cursor_set)
return;
diff --git a/ash/wm/image_cursors.h b/ash/wm/image_cursors.h
index 55bc34c..1a75f40 100644
--- a/ash/wm/image_cursors.h
+++ b/ash/wm/image_cursors.h
@@ -9,12 +9,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "ui/base/cursor/cursor.h"
+#include "ui/gfx/display.h"
#include "ui/gfx/native_widget_types.h"
-namespace gfx {
-class Display;
-}
-
namespace ui {
class CursorLoader;
}
@@ -28,9 +25,9 @@ class ASH_EXPORT ImageCursors {
ImageCursors();
~ImageCursors();
- // Returns the display the cursors are loaded for. The display must
- // be set by SetDisplay before using this.
- gfx::Display GetDisplay() const;
+ // Returns the scale and rotation of the currently loaded cursor.
+ float GetScale() const;
+ gfx::Display::Rotation GetRotation() const;
// Sets the display the cursors are loaded for. The device scale factor
// determines the size of the image to load, and the rotation of the display
@@ -38,9 +35,6 @@ class ASH_EXPORT ImageCursors {
// Returns true if the cursor image is reloaded.
bool SetDisplay(const gfx::Display& display);
- // Sets the scale of the mouse cursor icon.
- void SetScale(float scale);
-
// Sets the type of the mouse cursor icon.
void SetCursorSet(ui::CursorSetType cursor_set);
@@ -52,7 +46,6 @@ class ASH_EXPORT ImageCursors {
void ReloadCursors();
scoped_ptr<ui::CursorLoader> cursor_loader_;
- float scale_;
ui::CursorSetType cursor_set_;
DISALLOW_COPY_AND_ASSIGN(ImageCursors);