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

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

Issue 2028593004: Add new InputDeviceManager interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_keyboard
Patch Set: Fix windows compile error. Created 4 years, 6 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/x/events_x_utils.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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 std::unique_ptr<base::Environment> env(base::Environment::Create()); 54 std::unique_ptr<base::Environment> env(base::Environment::Create());
55 if (env->GetVar(kEglplatformShim, &library)) 55 if (env->GetVar(kEglplatformShim, &library))
56 return library; 56 return library;
57 return kEglplatformShimDefault; 57 return kEglplatformShimDefault;
58 } 58 }
59 59
60 // Touch events are reported in device coordinates. This scales the event to the 60 // Touch events are reported in device coordinates. This scales the event to the
61 // window's coordinate space. 61 // window's coordinate space.
62 void ScaleTouchEvent(TouchEvent* event, const gfx::SizeF& size) { 62 void ScaleTouchEvent(TouchEvent* event, const gfx::SizeF& size) {
63 for (const auto& device : 63 for (const auto& device :
64 DeviceDataManager::GetInstance()->touchscreen_devices()) { 64 DeviceDataManager::GetInstance()->GetTouchscreenDevices()) {
65 if (device.id == event->source_device_id()) { 65 if (device.id == event->source_device_id()) {
66 gfx::SizeF touchscreen_size = gfx::SizeF(device.size); 66 gfx::SizeF touchscreen_size = gfx::SizeF(device.size);
67 gfx::Transform transform; 67 gfx::Transform transform;
68 transform.Scale(size.width() / touchscreen_size.width(), 68 transform.Scale(size.width() / touchscreen_size.width(),
69 size.height() / touchscreen_size.height()); 69 size.height() / touchscreen_size.height());
70 event->UpdateForRootTransform(transform); 70 event->UpdateForRootTransform(transform);
71 return; 71 return;
72 } 72 }
73 } 73 }
74 } 74 }
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 412
413 } // namespace 413 } // namespace
414 414
415 OzonePlatform* CreateOzonePlatformEgltest() { 415 OzonePlatform* CreateOzonePlatformEgltest() {
416 OzonePlatformEgltest* platform = new OzonePlatformEgltest; 416 OzonePlatformEgltest* platform = new OzonePlatformEgltest;
417 platform->Initialize(); 417 platform->Initialize();
418 return platform; 418 return platform;
419 } 419 }
420 420
421 } // namespace ui 421 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/x/events_x_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698