| 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/drm/host/drm_window_host.h" | 5 #include "ui/ozone/platform/drm/host/drm_window_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/display/display.h" |
| 8 #include "ui/events/devices/device_data_manager.h" | 9 #include "ui/events/devices/device_data_manager.h" |
| 9 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 10 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 11 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| 11 #include "ui/events/ozone/events_ozone.h" | 12 #include "ui/events/ozone/events_ozone.h" |
| 12 #include "ui/events/platform/platform_event_source.h" | 13 #include "ui/events/platform/platform_event_source.h" |
| 13 #include "ui/gfx/display.h" | |
| 14 #include "ui/ozone/platform/drm/host/drm_cursor.h" | 14 #include "ui/ozone/platform/drm/host/drm_cursor.h" |
| 15 #include "ui/ozone/platform/drm/host/drm_display_host.h" | 15 #include "ui/ozone/platform/drm/host/drm_display_host.h" |
| 16 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" | 16 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" |
| 17 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h" | 17 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h" |
| 18 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h" | 18 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h" |
| 19 #include "ui/platform_window/platform_window_delegate.h" | 19 #include "ui/platform_window/platform_window_delegate.h" |
| 20 | 20 |
| 21 namespace ui { | 21 namespace ui { |
| 22 | 22 |
| 23 DrmWindowHost::DrmWindowHost(PlatformWindowDelegate* delegate, | 23 DrmWindowHost::DrmWindowHost(PlatformWindowDelegate* delegate, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 if (event->IsTouchEvent()) { | 139 if (event->IsTouchEvent()) { |
| 140 // Dispatch the event if it is from the touchscreen associated with the | 140 // Dispatch the event if it is from the touchscreen associated with the |
| 141 // DrmWindowHost. We cannot check the event's location because if the | 141 // DrmWindowHost. We cannot check the event's location because if the |
| 142 // touchscreen has a bezel, touches in the bezel have a location outside of | 142 // touchscreen has a bezel, touches in the bezel have a location outside of |
| 143 // |bounds_|. | 143 // |bounds_|. |
| 144 int64_t display_id = | 144 int64_t display_id = |
| 145 DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice( | 145 DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice( |
| 146 event->source_device_id()); | 146 event->source_device_id()); |
| 147 | 147 |
| 148 if (display_id == gfx::Display::kInvalidDisplayID) | 148 if (display_id == display::Display::kInvalidDisplayID) |
| 149 return false; | 149 return false; |
| 150 | 150 |
| 151 DrmDisplayHost* display = display_manager_->GetDisplay(display_id); | 151 DrmDisplayHost* display = display_manager_->GetDisplay(display_id); |
| 152 if (!display) | 152 if (!display) |
| 153 return false; | 153 return false; |
| 154 | 154 |
| 155 DisplaySnapshot* snapshot = display->snapshot(); | 155 DisplaySnapshot* snapshot = display->snapshot(); |
| 156 if (!snapshot->current_mode()) | 156 if (!snapshot->current_mode()) |
| 157 return false; | 157 return false; |
| 158 | 158 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 void DrmWindowHost::SendBoundsChange() { | 196 void DrmWindowHost::SendBoundsChange() { |
| 197 // Update the cursor before the window so that the cursor stays within the | 197 // Update the cursor before the window so that the cursor stays within the |
| 198 // window bounds when the window size shrinks. | 198 // window bounds when the window size shrinks. |
| 199 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); | 199 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); |
| 200 sender_->GpuWindowBoundsChanged(widget_, bounds_); | 200 sender_->GpuWindowBoundsChanged(widget_, bounds_); |
| 201 | 201 |
| 202 overlay_manager_->ResetCache(); | 202 overlay_manager_->ResetCache(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace ui | 205 } // namespace ui |
| OLD | NEW |