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

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: const 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
« no previous file with comments | « services/ui/ws/platform_display_default.h ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d576a8d0f88316fb0c96ea5d7b9120770f5c3b4a..80780b179c4b7cb559206adfdbb6d7e890d23454 100644
--- a/services/ui/ws/platform_display_default.cc
+++ b/services/ui/ws/platform_display_default.cc
@@ -178,15 +178,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())
@@ -202,9 +193,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.
« no previous file with comments | « services/ui/ws/platform_display_default.h ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698