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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |