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

Side by Side Diff: ui/ozone/platform/egltest/ozone_platform_egltest.cc

Issue 1300803003: Drop ui::TouchEvent shims for radius_{x,y} and force (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « ui/events/ozone/events_ozone.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/egltest/ozone_platform_egltest.h" 5 #include "ui/ozone/platform/egltest/ozone_platform_egltest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 DeviceDataManager::GetInstance()->touchscreen_devices()) { 60 DeviceDataManager::GetInstance()->touchscreen_devices()) {
61 if (device.id == event->source_device_id()) { 61 if (device.id == event->source_device_id()) {
62 gfx::SizeF touchscreen_size = device.size; 62 gfx::SizeF touchscreen_size = device.size;
63 gfx::PointF location = event->location_f(); 63 gfx::PointF location = event->location_f();
64 64
65 location.Scale(size.width() / touchscreen_size.width(), 65 location.Scale(size.width() / touchscreen_size.width(),
66 size.height() / touchscreen_size.height()); 66 size.height() / touchscreen_size.height());
67 double ratio = std::sqrt(size.GetArea() / touchscreen_size.GetArea()); 67 double ratio = std::sqrt(size.GetArea() / touchscreen_size.GetArea());
68 68
69 event->set_location(location); 69 event->set_location(location);
70 event->set_radius_x(event->radius_x() * ratio); 70 event->set_radius_x(event->pointer_details().radius_x() * ratio);
71 event->set_radius_y(event->radius_y() * ratio); 71 event->set_radius_y(event->pointer_details().radius_y() * ratio);
72 return; 72 return;
73 } 73 }
74 } 74 }
75 } 75 }
76 76
77 class EgltestWindow : public PlatformWindow, public PlatformEventDispatcher { 77 class EgltestWindow : public PlatformWindow, public PlatformEventDispatcher {
78 public: 78 public:
79 EgltestWindow(PlatformWindowDelegate* delegate, 79 EgltestWindow(PlatformWindowDelegate* delegate,
80 LibeglplatformShimLoader* eglplatform_shim, 80 LibeglplatformShimLoader* eglplatform_shim,
81 EventFactoryEvdev* event_factory, 81 EventFactoryEvdev* event_factory,
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 } // namespace 409 } // namespace
410 410
411 OzonePlatform* CreateOzonePlatformEgltest() { 411 OzonePlatform* CreateOzonePlatformEgltest() {
412 OzonePlatformEgltest* platform = new OzonePlatformEgltest; 412 OzonePlatformEgltest* platform = new OzonePlatformEgltest;
413 platform->Initialize(); 413 platform->Initialize();
414 return platform; 414 return platform;
415 } 415 }
416 416
417 } // namespace ui 417 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/events_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698