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

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

Issue 873563002: [Ozone] Constrain the cursor when overscan insets are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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 #ifndef UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ 6 #define UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 23 matching lines...) Expand all
34 explicit DriCursor(DriWindowManager* window_manager, 34 explicit DriCursor(DriWindowManager* window_manager,
35 DriGpuPlatformSupportHost* sender); 35 DriGpuPlatformSupportHost* sender);
36 ~DriCursor() override; 36 ~DriCursor() override;
37 37
38 void Init(); 38 void Init();
39 39
40 // Change the cursor over the specifed window. 40 // Change the cursor over the specifed window.
41 void SetCursor(gfx::AcceleratedWidget window, PlatformCursor platform_cursor); 41 void SetCursor(gfx::AcceleratedWidget window, PlatformCursor platform_cursor);
42 42
43 // Handle window lifecycle. 43 // Handle window lifecycle.
44 void OnWindowAdded(gfx::AcceleratedWidget window, const gfx::Rect& bounds); 44 void OnWindowAdded(gfx::AcceleratedWidget window,
45 const gfx::Rect& bounds_in_screen,
46 const gfx::Rect& cursor_confined_bounds);
45 void OnWindowRemoved(gfx::AcceleratedWidget window); 47 void OnWindowRemoved(gfx::AcceleratedWidget window);
46 48
47 // Handle window bounds changes. 49 // Handle window bounds changes.
48 void PrepareForBoundsChange(gfx::AcceleratedWidget window); 50 void PrepareForBoundsChange(gfx::AcceleratedWidget window);
49 void CommitBoundsChange(gfx::AcceleratedWidget window, 51
50 const gfx::Rect& bounds); 52 // Confines the cursor to |confined_bounds| for |window|.
53 void ConfineCursorToBounds(gfx::AcceleratedWidget window,
54 const gfx::Rect& bounds);
51 55
52 // CursorDelegateEvdev: 56 // CursorDelegateEvdev:
53 void MoveCursorTo(gfx::AcceleratedWidget window, 57 void MoveCursorTo(gfx::AcceleratedWidget window,
54 const gfx::PointF& location) override; 58 const gfx::PointF& location) override;
55 void MoveCursorTo(const gfx::PointF& screen_location) override; 59 void MoveCursorTo(const gfx::PointF& screen_location) override;
56 void MoveCursor(const gfx::Vector2dF& delta) override; 60 void MoveCursor(const gfx::Vector2dF& delta) override;
57 bool IsCursorVisible() override; 61 bool IsCursorVisible() override;
58 gfx::PointF GetLocation() override; 62 gfx::PointF GetLocation() override;
59 gfx::Rect GetCursorDisplayBounds() override; 63 gfx::Rect GetCursorConfinedBounds() override;
60 64
61 // GpuPlatformSupportHost: 65 // GpuPlatformSupportHost:
62 void OnChannelEstablished( 66 void OnChannelEstablished(
63 int host_id, 67 int host_id,
64 scoped_refptr<base::SingleThreadTaskRunner> send_runner, 68 scoped_refptr<base::SingleThreadTaskRunner> send_runner,
65 const base::Callback<void(IPC::Message*)>& sender) override; 69 const base::Callback<void(IPC::Message*)>& sender) override;
66 void OnChannelDestroyed(int host_id) override; 70 void OnChannelDestroyed(int host_id) override;
67 71
68 // IPC::Listener: 72 // IPC::Listener:
69 bool OnMessageReceived(const IPC::Message& message) override; 73 bool OnMessageReceived(const IPC::Message& message) override;
(...skipping 25 matching lines...) Expand all
95 // The current cursor bitmap (immutable). 99 // The current cursor bitmap (immutable).
96 scoped_refptr<BitmapCursorOzone> bitmap; 100 scoped_refptr<BitmapCursorOzone> bitmap;
97 101
98 // The window under the cursor. 102 // The window under the cursor.
99 gfx::AcceleratedWidget window; 103 gfx::AcceleratedWidget window;
100 104
101 // The location of the cursor within the window. 105 // The location of the cursor within the window.
102 gfx::PointF location; 106 gfx::PointF location;
103 107
104 // The bounds of the display under the cursor. 108 // The bounds of the display under the cursor.
105 gfx::Rect bounds; 109 gfx::Rect display_bounds_in_screen;
110
111 // The bounds that the cursor is confined to in |window|.
112 gfx::Rect confined_bounds;
106 113
107 // Callback for IPC updates. 114 // Callback for IPC updates.
108 base::Callback<void(IPC::Message*)> send_callback; 115 base::Callback<void(IPC::Message*)> send_callback;
109 scoped_refptr<base::SingleThreadTaskRunner> send_runner; 116 scoped_refptr<base::SingleThreadTaskRunner> send_runner;
110 117
111 // The mutex synchronizing this object. 118 // The mutex synchronizing this object.
112 base::Lock lock; 119 base::Lock lock;
113 }; 120 };
114 121
115 CursorState state_; 122 CursorState state_;
116 }; 123 };
117 124
118 } // namespace ui 125 } // namespace ui
119 126
120 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ 127 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698