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

Unified Diff: ui/aura/window.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
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 83a532b0524371c09cd0bb47625a93eedcd6e9f9..def9ce0094c40a02471f73b72b2ad563ee48a87a 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -432,6 +432,15 @@ const Window* Window::GetChildById(int id) const {
void Window::ConvertPointToTarget(const Window* source,
const Window* target,
gfx::Point* point) {
+ gfx::PointF point_f(*point);
+ ConvertPointToTargetF(source, target, &point_f);
+ *point = gfx::ToFlooredPoint(point_f);
+}
+
+// static
+void Window::ConvertPointToTargetF(const Window* source,
+ const Window* target,
+ gfx::PointF* point) {
if (!source)
return;
if (source->GetRootWindow() != target->GetRootWindow()) {
@@ -439,15 +448,15 @@ void Window::ConvertPointToTarget(const Window* source,
client::GetScreenPositionClient(source->GetRootWindow());
// |source_client| can be NULL in tests.
if (source_client)
- source_client->ConvertPointToScreen(source, point);
+ source_client->ConvertPointToScreenF(source, point);
client::ScreenPositionClient* target_client =
client::GetScreenPositionClient(target->GetRootWindow());
// |target_client| can be NULL in tests.
if (target_client)
- target_client->ConvertPointFromScreen(target, point);
+ target_client->ConvertPointFromScreenF(target, point);
} else {
- ui::Layer::ConvertPointToLayer(source->layer(), target->layer(), point);
+ ui::Layer::ConvertPointToLayerF(source->layer(), target->layer(), point);
}
}

Powered by Google App Engine
This is Rietveld 408576698