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

Unified Diff: ui/wm/core/default_screen_position_client.cc

Issue 2648583003: Handle floating point coordinates from ozone to exosphere (Closed)
Patch Set: added F variant to screen position client. fixed exo tests. Created 3 years, 11 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
« ui/compositor/layer.cc ('K') | « ui/wm/core/default_screen_position_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/default_screen_position_client.cc
diff --git a/ui/wm/core/default_screen_position_client.cc b/ui/wm/core/default_screen_position_client.cc
index 4d7a45359d4f805a6d1172b08380e1a0757dff77..d4e5191468d7b0de0eff0f77ceda13c8ece20375 100644
--- a/ui/wm/core/default_screen_position_client.cc
+++ b/ui/wm/core/default_screen_position_client.cc
@@ -29,8 +29,16 @@ gfx::Point DefaultScreenPositionClient::GetOriginInScreen(
void DefaultScreenPositionClient::ConvertPointToScreen(
const aura::Window* window,
gfx::Point* point) {
+ gfx::PointF point_f(*point);
+ ConvertPointToScreenF(window, &point_f);
+ *point = gfx::ToFlooredPoint(point_f);
+}
+
+void DefaultScreenPositionClient::ConvertPointToScreenF(
+ const aura::Window* window,
+ gfx::PointF* point) {
const aura::Window* root_window = window->GetRootWindow();
- aura::Window::ConvertPointToTarget(window, root_window, point);
+ aura::Window::ConvertPointToTargetF(window, root_window, point);
gfx::Point origin = GetOriginInScreen(root_window);
point->Offset(origin.x(), origin.y());
}
@@ -38,10 +46,18 @@ void DefaultScreenPositionClient::ConvertPointToScreen(
void DefaultScreenPositionClient::ConvertPointFromScreen(
const aura::Window* window,
gfx::Point* point) {
+ gfx::PointF point_f(*point);
+ ConvertPointFromScreenF(window, &point_f);
+ *point = gfx::ToFlooredPoint(point_f);
+}
+
+void DefaultScreenPositionClient::ConvertPointFromScreenF(
+ const aura::Window* window,
+ gfx::PointF* point) {
const aura::Window* root_window = window->GetRootWindow();
gfx::Point origin = GetOriginInScreen(root_window);
point->Offset(-origin.x(), -origin.y());
- aura::Window::ConvertPointToTarget(root_window, window, point);
+ aura::Window::ConvertPointToTargetF(root_window, window, point);
}
void DefaultScreenPositionClient::ConvertHostPointToScreen(aura::Window* window,
« ui/compositor/layer.cc ('K') | « ui/wm/core/default_screen_position_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698