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

Unified Diff: ui/aura/window.cc

Issue 2648583003: Handle floating point coordinates from ozone to exosphere (Closed)
Patch Set: Handle floating point coordinates from ozone to exosphere 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
« no previous file with comments | « ui/aura/window.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 83a532b0524371c09cd0bb47625a93eedcd6e9f9..073504ab8272d1da0077fcb9f0f92c89ac97e33f 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -432,22 +432,34 @@ 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()) {
+ gfx::Point floored = gfx::ToFlooredPoint(*point);
tdresser 2017/01/20 16:07:48 Do we need to floor in this case?
denniskempin 2017/01/20 18:26:33 I am flooring here to be able to pass a Point into
client::ScreenPositionClient* source_client =
client::GetScreenPositionClient(source->GetRootWindow());
// |source_client| can be NULL in tests.
if (source_client)
- source_client->ConvertPointToScreen(source, point);
+ source_client->ConvertPointToScreen(source, &floored);
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->ConvertPointFromScreen(target, &floored);
+
+ *point = gfx::PointF(floored);
} else {
- ui::Layer::ConvertPointToLayer(source->layer(), target->layer(), point);
+ ui::Layer::ConvertPointToLayerF(source->layer(), target->layer(), point);
}
}
« no previous file with comments | « ui/aura/window.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698