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

Side by Side Diff: components/exo/pointer.h

Issue 2777343002: exo: Rotate cursor snapshot for rotated displays (Closed)
Patch Set: Add comment Created 3 years, 7 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 | « no previous file | components/exo/pointer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_EXO_POINTER_H_ 5 #ifndef COMPONENTS_EXO_POINTER_H_
6 #define COMPONENTS_EXO_POINTER_H_ 6 #define COMPONENTS_EXO_POINTER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void OnSurfaceDestroying(Surface* surface) override; 70 void OnSurfaceDestroying(Surface* surface) override;
71 71
72 private: 72 private:
73 // Returns the effective target for |event|. 73 // Returns the effective target for |event|.
74 Surface* GetEffectiveTargetForEvent(ui::Event* event) const; 74 Surface* GetEffectiveTargetForEvent(ui::Event* event) const;
75 75
76 // Asynchronously update the cursor by capturing a snapshot of |surface_|. 76 // Asynchronously update the cursor by capturing a snapshot of |surface_|.
77 void CaptureCursor(); 77 void CaptureCursor();
78 78
79 // Called when cursor snapshot has been captured. 79 // Called when cursor snapshot has been captured.
80 void OnCursorCaptured(const gfx::Point& hotspot, 80 void OnCursorCaptured(gfx::Point hotspot,
81 std::unique_ptr<cc::CopyOutputResult> result); 81 std::unique_ptr<cc::CopyOutputResult> result);
82 82
83 void UpdateCursor(gfx::NativeCursor cursor); 83 void UpdateCursor(gfx::NativeCursor cursor);
84 84
85 // The delegate instance that all events are dispatched to. 85 // The delegate instance that all events are dispatched to.
86 PointerDelegate* const delegate_; 86 PointerDelegate* const delegate_;
87 87
88 // The current pointer surface. 88 // The current pointer surface.
89 Surface* surface_ = nullptr; 89 Surface* surface_ = nullptr;
90 90
91 // The current focus surface for the pointer. 91 // The current focus surface for the pointer.
92 Surface* focus_ = nullptr; 92 Surface* focus_ = nullptr;
93 93
94 // The location of the pointer in the current focus surface. 94 // The location of the pointer in the current focus surface.
95 gfx::PointF location_; 95 gfx::PointF location_;
96 96
97 // The display-dependent scale applied to the cursor. 97 // The display-dependent scale applied to the cursor.
98 float display_scale_ = 1.0f; 98 float display_scale_ = 1.0f;
99 99
100 // The display-independent scale applied to the cursor. 100 // The display-independent scale applied to the cursor.
101 float cursor_scale_ = 1.0f; 101 float cursor_scale_ = 1.0f;
102 102
103 // Device scale factor of the display where the mouse is located. 103 // Device scale factor of the display where the mouse is located.
104 float device_scale_factor_ = 1.0f; 104 float device_scale_factor_ = 1.0f;
105 105
106 // Rotation of the display where the mouse is located.
107 display::Display::Rotation rotation_ = display::Display::ROTATE_0;
108
106 // The position of the pointer surface relative to the pointer location. 109 // The position of the pointer surface relative to the pointer location.
107 gfx::Point hotspot_; 110 gfx::Point hotspot_;
108 111
109 const std::unique_ptr<aura::Window> cursor_; 112 const std::unique_ptr<aura::Window> cursor_;
110 113
111 // Source used for cursor capture copy output requests. 114 // Source used for cursor capture copy output requests.
112 const base::UnguessableToken cursor_capture_source_id_; 115 const base::UnguessableToken cursor_capture_source_id_;
113 116
114 // Last received event type. 117 // Last received event type.
115 ui::EventType last_event_type_ = ui::ET_UNKNOWN; 118 ui::EventType last_event_type_ = ui::ET_UNKNOWN;
116 119
117 // Weak pointer factory used for cursor capture callbacks. 120 // Weak pointer factory used for cursor capture callbacks.
118 base::WeakPtrFactory<Pointer> cursor_capture_weak_ptr_factory_; 121 base::WeakPtrFactory<Pointer> cursor_capture_weak_ptr_factory_;
119 122
120 DISALLOW_COPY_AND_ASSIGN(Pointer); 123 DISALLOW_COPY_AND_ASSIGN(Pointer);
121 }; 124 };
122 125
123 } // namespace exo 126 } // namespace exo
124 127
125 #endif // COMPONENTS_EXO_POINTER_H_ 128 #endif // COMPONENTS_EXO_POINTER_H_
OLDNEW
« no previous file with comments | « no previous file | components/exo/pointer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698