Commit 95539f00 authored by mlamouri@chromium.org's avatar mlamouri@chromium.org

Don't rotate WebCursor based on display rotation in X11 Aura.

Since we now correctly report display rotations (ie. non 0 values), this
caused a regression. The Ozone backend might not require this too.

BUG=399571

Review URL: https://codereview.chromium.org/437593007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288059 0039d316-1c4b-4281-b951-d872f2087c98
parent f992db07
...@@ -172,11 +172,14 @@ class CONTENT_EXPORT WebCursor { ...@@ -172,11 +172,14 @@ class CONTENT_EXPORT WebCursor {
// Only used for custom cursors. // Only used for custom cursors.
ui::PlatformCursor platform_cursor_; ui::PlatformCursor platform_cursor_;
float device_scale_factor_; float device_scale_factor_;
gfx::Display::Rotation rotation_;
#elif defined(OS_WIN) #elif defined(OS_WIN)
// A custom cursor created from custom bitmap data by Webkit. // A custom cursor created from custom bitmap data by Webkit.
HCURSOR custom_cursor_; HCURSOR custom_cursor_;
#endif #endif
#if defined(USE_OZONE)
gfx::Display::Rotation rotation_;
#endif
}; };
} // namespace content } // namespace content
......
...@@ -29,7 +29,7 @@ const ui::PlatformCursor WebCursor::GetPlatformCursor() { ...@@ -29,7 +29,7 @@ const ui::PlatformCursor WebCursor::GetPlatformCursor() {
memcpy(bitmap.getAddr32(0, 0), custom_data_.data(), custom_data_.size()); memcpy(bitmap.getAddr32(0, 0), custom_data_.data(), custom_data_.size());
gfx::Point hotspot = hotspot_; gfx::Point hotspot = hotspot_;
ui::ScaleAndRotateCursorBitmapAndHotpoint( ui::ScaleAndRotateCursorBitmapAndHotpoint(
device_scale_factor_, rotation_, &bitmap, &hotspot); device_scale_factor_, gfx::Display::ROTATE_0, &bitmap, &hotspot);
XcursorImage* image = ui::SkBitmapToXcursorImage(&bitmap, hotspot); XcursorImage* image = ui::SkBitmapToXcursorImage(&bitmap, hotspot);
platform_cursor_ = ui::CreateReffedCustomXCursor(image); platform_cursor_ = ui::CreateReffedCustomXCursor(image);
...@@ -37,12 +37,10 @@ const ui::PlatformCursor WebCursor::GetPlatformCursor() { ...@@ -37,12 +37,10 @@ const ui::PlatformCursor WebCursor::GetPlatformCursor() {
} }
void WebCursor::SetDisplayInfo(const gfx::Display& display) { void WebCursor::SetDisplayInfo(const gfx::Display& display) {
if (rotation_ == display.rotation() && if (device_scale_factor_ == display.device_scale_factor())
device_scale_factor_ == display.device_scale_factor())
return; return;
device_scale_factor_ = display.device_scale_factor(); device_scale_factor_ = display.device_scale_factor();
rotation_ = display.rotation();
if (platform_cursor_) if (platform_cursor_)
ui::UnrefCustomXCursor(platform_cursor_); ui::UnrefCustomXCursor(platform_cursor_);
platform_cursor_ = 0; platform_cursor_ = 0;
...@@ -53,7 +51,6 @@ void WebCursor::SetDisplayInfo(const gfx::Display& display) { ...@@ -53,7 +51,6 @@ void WebCursor::SetDisplayInfo(const gfx::Display& display) {
void WebCursor::InitPlatformData() { void WebCursor::InitPlatformData() {
platform_cursor_ = 0; platform_cursor_ = 0;
device_scale_factor_ = 1.f; device_scale_factor_ = 1.f;
rotation_ = gfx::Display::ROTATE_0;
} }
bool WebCursor::SerializePlatformData(Pickle* pickle) const { bool WebCursor::SerializePlatformData(Pickle* pickle) const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment