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

Unified Diff: services/ui/ws/platform_display_default.cc

Issue 2778943005: Keep root_location to be in pixels and display coordinates in WS. (Closed)
Patch Set: . Created 3 years, 7 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: services/ui/ws/platform_display_default.cc
diff --git a/services/ui/ws/platform_display_default.cc b/services/ui/ws/platform_display_default.cc
index b879e33517207034f050e1fbb4829724526a6401..643afc2cf3e8e5f4fe32e3b1bf3145eae7c9ba91 100644
--- a/services/ui/ws/platform_display_default.cc
+++ b/services/ui/ws/platform_display_default.cc
@@ -179,15 +179,6 @@ gfx::AcceleratedWidget PlatformDisplayDefault::GetAcceleratedWidget() const {
return widget_;
}
-void PlatformDisplayDefault::UpdateEventRootLocation(ui::LocatedEvent* event) {
- // TODO(riajiang): This is broken for HDPI because it mixes PPs and DIPs. See
- // http://crbug.com/701036 for details.
- const display::Display& display = delegate_->GetDisplay();
- gfx::Point location = event->location();
- location.Offset(display.bounds().x(), display.bounds().y());
- event->set_root_location(location);
-}
-
void PlatformDisplayDefault::OnBoundsChanged(const gfx::Rect& new_bounds) {
// We only care if the window size has changed.
if (new_bounds.size() == metrics_.bounds_in_pixels.size())
@@ -203,9 +194,8 @@ void PlatformDisplayDefault::OnDamageRect(const gfx::Rect& damaged_region) {
}
void PlatformDisplayDefault::DispatchEvent(ui::Event* event) {
- if (event->IsLocatedEvent())
- UpdateEventRootLocation(event->AsLocatedEvent());
-
+ // Event location and event root location are the same, and both in pixels
+ // and display coordinates.
if (event->IsScrollEvent()) {
// TODO(moshayedi): crbug.com/602859. Dispatch scroll events as
// they are once we have proper support for scroll events.

Powered by Google App Engine
This is Rietveld 408576698