| OLD | NEW |
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 for (const auto& device : | 59 for (const auto& device : |
| 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 = gfx::SizeF(device.size); | 62 gfx::SizeF touchscreen_size = gfx::SizeF(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_f(location); |
| 70 event->set_radius_x(event->pointer_details().radius_x() * ratio); | 70 event->set_radius_x(event->pointer_details().radius_x() * ratio); |
| 71 event->set_radius_y(event->pointer_details().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, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 void EgltestWindow::Minimize() { | 170 void EgltestWindow::Minimize() { |
| 171 } | 171 } |
| 172 | 172 |
| 173 void EgltestWindow::Restore() { | 173 void EgltestWindow::Restore() { |
| 174 } | 174 } |
| 175 | 175 |
| 176 void EgltestWindow::SetCursor(PlatformCursor cursor) { | 176 void EgltestWindow::SetCursor(PlatformCursor cursor) { |
| 177 } | 177 } |
| 178 | 178 |
| 179 void EgltestWindow::MoveCursorTo(const gfx::Point& location) { | 179 void EgltestWindow::MoveCursorTo(const gfx::Point& location) { |
| 180 event_factory_->WarpCursorTo(window_id_, location); | 180 event_factory_->WarpCursorTo(window_id_, gfx::PointF(location)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void EgltestWindow::ConfineCursorToBounds(const gfx::Rect& bounds) { | 183 void EgltestWindow::ConfineCursorToBounds(const gfx::Rect& bounds) { |
| 184 } | 184 } |
| 185 | 185 |
| 186 PlatformImeController* EgltestWindow::GetPlatformImeController() { | 186 PlatformImeController* EgltestWindow::GetPlatformImeController() { |
| 187 return nullptr; | 187 return nullptr; |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool EgltestWindow::CanDispatchEvent(const ui::PlatformEvent& ne) { | 190 bool EgltestWindow::CanDispatchEvent(const ui::PlatformEvent& ne) { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 417 |
| 418 } // namespace | 418 } // namespace |
| 419 | 419 |
| 420 OzonePlatform* CreateOzonePlatformEgltest() { | 420 OzonePlatform* CreateOzonePlatformEgltest() { |
| 421 OzonePlatformEgltest* platform = new OzonePlatformEgltest; | 421 OzonePlatformEgltest* platform = new OzonePlatformEgltest; |
| 422 platform->Initialize(); | 422 platform->Initialize(); |
| 423 return platform; | 423 return platform; |
| 424 } | 424 } |
| 425 | 425 |
| 426 } // namespace ui | 426 } // namespace ui |
| OLD | NEW |