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

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

Issue 580553002: 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 cursor_location_.SetToMin(gfx::PointF(size.width(), size.height())); 71 // Right and bottom edges are exclusive.
72 cursor_location_.SetToMin(gfx::PointF(size.width() - 1, size.height() - 1));
72 73
73 if (cursor_.get()) 74 if (cursor_.get())
74 hardware_->MoveHardwareCursor(cursor_window_, bitmap_location()); 75 hardware_->MoveHardwareCursor(cursor_window_, bitmap_location());
75 } 76 }
76 77
77 void DriCursor::MoveCursor(const gfx::Vector2dF& delta) { 78 void DriCursor::MoveCursor(const gfx::Vector2dF& delta) {
78 MoveCursorTo(cursor_window_, cursor_location_ + delta); 79 MoveCursorTo(cursor_window_, cursor_location_ + delta);
79 } 80 }
80 81
81 gfx::AcceleratedWidget DriCursor::GetCursorWindow() { 82 gfx::AcceleratedWidget DriCursor::GetCursorWindow() {
82 return cursor_window_; 83 return cursor_window_;
83 } 84 }
84 85
85 bool DriCursor::IsCursorVisible() { 86 bool DriCursor::IsCursorVisible() {
86 return cursor_.get(); 87 return cursor_.get();
87 } 88 }
88 89
89 gfx::PointF DriCursor::location() { 90 gfx::PointF DriCursor::location() {
90 return cursor_location_; 91 return cursor_location_;
91 } 92 }
92 93
93 gfx::Point DriCursor::bitmap_location() { 94 gfx::Point DriCursor::bitmap_location() {
94 return gfx::ToFlooredPoint(cursor_location_) - 95 return gfx::ToFlooredPoint(cursor_location_) -
95 cursor_->hotspot().OffsetFromOrigin(); 96 cursor_->hotspot().OffsetFromOrigin();
96 } 97 }
97 98
98 } // namespace ui 99 } // 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