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

Side by Side Diff: ui/ozone/platform/dri/dri_cursor.cc

Issue 567413003: Revert of Remove deprecated cursor event filter for Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « ash/display/mouse_cursor_event_filter_unittest.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/dri/dri_cursor.h" 5 #include "ui/ozone/platform/dri/dri_cursor.h"
6 6
7 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" 7 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
8 #include "ui/gfx/geometry/point.h" 8 #include "ui/gfx/geometry/point.h"
9 #include "ui/gfx/geometry/point_conversions.h" 9 #include "ui/gfx/geometry/point_conversions.h"
10 #include "ui/gfx/geometry/point_f.h" 10 #include "ui/gfx/geometry/point_f.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 cursor_window_ = widget; 62 cursor_window_ = widget;
63 cursor_location_ = location; 63 cursor_location_ = location;
64 64
65 if (cursor_window_ == gfx::kNullAcceleratedWidget) 65 if (cursor_window_ == gfx::kNullAcceleratedWidget)
66 return; 66 return;
67 67
68 DriWindow* window = window_manager_->GetWindow(cursor_window_); 68 DriWindow* window = window_manager_->GetWindow(cursor_window_);
69 const gfx::Size& size = window->GetBounds().size(); 69 const gfx::Size& size = window->GetBounds().size();
70 cursor_location_.SetToMax(gfx::PointF(0, 0)); 70 cursor_location_.SetToMax(gfx::PointF(0, 0));
71 // Right and bottom edges are exclusive. 71 cursor_location_.SetToMin(gfx::PointF(size.width(), size.height()));
72 cursor_location_.SetToMin(gfx::PointF(size.width() - 1, size.height() - 1));
73 72
74 if (cursor_.get()) 73 if (cursor_.get())
75 hardware_->MoveHardwareCursor(cursor_window_, bitmap_location()); 74 hardware_->MoveHardwareCursor(cursor_window_, bitmap_location());
76 } 75 }
77 76
78 void DriCursor::MoveCursor(const gfx::Vector2dF& delta) { 77 void DriCursor::MoveCursor(const gfx::Vector2dF& delta) {
79 MoveCursorTo(cursor_window_, cursor_location_ + delta); 78 MoveCursorTo(cursor_window_, cursor_location_ + delta);
80 } 79 }
81 80
82 gfx::AcceleratedWidget DriCursor::GetCursorWindow() { 81 gfx::AcceleratedWidget DriCursor::GetCursorWindow() {
83 return cursor_window_; 82 return cursor_window_;
84 } 83 }
85 84
86 bool DriCursor::IsCursorVisible() { 85 bool DriCursor::IsCursorVisible() {
87 return cursor_.get(); 86 return cursor_.get();
88 } 87 }
89 88
90 gfx::PointF DriCursor::location() { 89 gfx::PointF DriCursor::location() {
91 return cursor_location_; 90 return cursor_location_;
92 } 91 }
93 92
94 gfx::Point DriCursor::bitmap_location() { 93 gfx::Point DriCursor::bitmap_location() {
95 return gfx::ToFlooredPoint(cursor_location_) - 94 return gfx::ToFlooredPoint(cursor_location_) -
96 cursor_->hotspot().OffsetFromOrigin(); 95 cursor_->hotspot().OffsetFromOrigin();
97 } 96 }
98 97
99 } // namespace ui 98 } // namespace ui
OLDNEW
« no previous file with comments | « ash/display/mouse_cursor_event_filter_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698