Implement cursor compositing mode on Ash
Currently this is only enabled when the accessibility feature
"high contrast" mode or "large cursor" mode is enabled.
We do not enable this by default because cursor compositing
shows some lags especially on slow machines or when CPU is busy.
BUG=290837
TEST=trybot, manual testing mirror/extend/dual display mode
R=derat@chromium.org, oshima@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=249289
@oshima - this is a work-in-progress CL intended to support cursor compositing mode on Ash. ...
6 years, 10 months ago
(2014-01-30 02:03:41 UTC)
#1
@oshima - this is a work-in-progress CL intended to support cursor compositing
mode on Ash. I got it to a sort-of working state but realized that more work is
needed to make it landable. This may require splitting up the CL into several
pieces and put the thing behind a flag until it is ready.
Never the less I'd appreciate your comments on how things should go.
I find it awkward that DisplayController has both a mirror window controller and
a cursor window controller that both handles cursor location/shape updates. When
cursor compositing mode is enabled, I wonder if we can simply disable the cursor
drawing functionality in mirror window controller (because the reflector will
get the desktop with cursor already drawn).
oshima
I didn't review thoroughly, but given that there is always one cursor window (in mirror ...
6 years, 10 months ago
(2014-02-03 20:35:53 UTC)
#2
I didn't review thoroughly, but given that there is always one cursor window (in
mirror mode, composited extended, or composited mirrored), I think it'd be
better to have just one CursorWindowController does doe the right thing
depending on the state. (could have internal delegate, which gets switched
depending on the state)
https://codereview.chromium.org/145313003/diff/970001/ash/display/cursor_wind...
File ash/display/cursor_window_controller.cc (right):
https://codereview.chromium.org/145313003/diff/970001/ash/display/cursor_wind...
ash/display/cursor_window_controller.cc:134: // TODO(oshima): Rotate cursor
image (including hotpoint).
can you remove this comment?
hshi1
On 2014/02/03 20:35:53, oshima wrote: > I think it'd be better to have just one ...
6 years, 10 months ago
(2014-02-03 21:43:25 UTC)
#3
On 2014/02/03 20:35:53, oshima wrote:
> I think it'd be better to have just one CursorWindowController does doe the
right thing
> depending on the state. (could have internal delegate, which gets switched
> depending on the state)
Thanks for the suggestion. However I found a problem, for "composited extended"
mode (internal + extended mirror display) it seems I will need to have 2
separate cursor windows, each added to the "Layout" container associated with
the root window of the display, respectively. When user moves cursor from one
display to another, I'll have to manually toggle the visibility of the cursor
window on both desktops. What do you think?
On 2014/02/03 21:43:25, hshi1 wrote: > On 2014/02/03 20:35:53, oshima wrote: > > I think ...
6 years, 10 months ago
(2014-02-03 21:59:13 UTC)
#5
On 2014/02/03 21:43:25, hshi1 wrote:
> On 2014/02/03 20:35:53, oshima wrote:
> > I think it'd be better to have just one CursorWindowController does doe the
> right thing
> > depending on the state. (could have internal delegate, which gets switched
> > depending on the state)
>
> Thanks for the suggestion. However I found a problem, for "composited
extended"
> mode (internal + extended mirror display) it seems I will need to have 2
> separate cursor windows, each added to the "Layout" container associated with
> the root window of the display, respectively. When user moves cursor from one
> display to another, I'll have to manually toggle the visibility of the cursor
> window on both desktops. What do you think?
Can't you just use one window and move between containers when necessary? think
you can use set_owned_by_parent(false) to make window management easier.
hshi1
On 2014/02/03 21:59:13, oshima wrote: > On 2014/02/03 21:43:25, hshi1 wrote: > > On 2014/02/03 ...
6 years, 10 months ago
(2014-02-05 00:05:45 UTC)
#6
On 2014/02/03 21:59:13, oshima wrote:
> On 2014/02/03 21:43:25, hshi1 wrote:
> > On 2014/02/03 20:35:53, oshima wrote:
> > > I think it'd be better to have just one CursorWindowController does doe
the
> > right thing
> > > depending on the state. (could have internal delegate, which gets switched
> > > depending on the state)
> >
> > Thanks for the suggestion. However I found a problem, for "composited
> extended"
> > mode (internal + extended mirror display) it seems I will need to have 2
> > separate cursor windows, each added to the "Layout" container associated
with
> > the root window of the display, respectively. When user moves cursor from
one
> > display to another, I'll have to manually toggle the visibility of the
cursor
> > window on both desktops. What do you think?
>
> Can't you just use one window and move between containers when necessary?
think
> you can use set_owned_by_parent(false) to make window management easier.
Oshima, PTAL patch set #8. I have made the suggested changes:
(1) Use one global instance of CursorWindowController owned by DisplayController
for both mirrored mode and cursor compositing mode;
(2) Support to toggle cursor compositing mode on/off at run time (and
disable/enable native cursor accordingly);
(3) Only enable cursor compositing mode in accessibility manager when enabling
high-contrast or large-cursor mode;
(4) Handle dual display mode where cursor window may be moved from one container
to another
hshi1
+derat for more comments - this is a fairly non-trivial change with many corner cases. ...
6 years, 10 months ago
(2014-02-05 21:18:14 UTC)
#7
+derat for more comments - this is a fairly non-trivial change with many corner
cases. Most complexity comes from the fact that we want to disable cursor
compositing by default and only switch it on/off at runtime based on
accessibility settings.
oshima
https://codereview.chromium.org/145313003/diff/1370001/ash/display/cursor_window_controller.h File ash/display/cursor_window_controller.h (right): https://codereview.chromium.org/145313003/diff/1370001/ash/display/cursor_window_controller.h#newcode37 ash/display/cursor_window_controller.h:37: // Sets the display bounds of the container window. ...
6 years, 10 months ago
(2014-02-05 21:49:58 UTC)
#8
6 years, 10 months ago
(2014-02-05 23:13:32 UTC)
#11
hshi1
@derat - sorry I have changed my mind regarding the "requested_cursor_set_" and "current_cursor_set_". I think ...
6 years, 10 months ago
(2014-02-05 23:29:41 UTC)
#12
@derat - sorry I have changed my mind regarding the "requested_cursor_set_" and
"current_cursor_set_". I think it is better to just have one "cursor_set_"
member and refactor the SetCursor() function so that we always explicitly update
the cursor image. See Patch Set #11.
https://codereview.chromium.org/145313003/diff/2080001/ui/views/corewm/cursor_manager.h File ui/views/corewm/cursor_manager.h (right): https://codereview.chromium.org/145313003/diff/2080001/ui/views/corewm/cursor_manager.h#newcode66 ui/views/corewm/cursor_manager.h:66: // When disabled, native cursor is hidden even when ...
6 years, 10 months ago
(2014-02-06 01:33:20 UTC)
#17
https://codereview.chromium.org/145313003/diff/2080001/ui/views/corewm/cursor_manager.h File ui/views/corewm/cursor_manager.h (right): https://codereview.chromium.org/145313003/diff/2080001/ui/views/corewm/cursor_manager.h#newcode66 ui/views/corewm/cursor_manager.h:66: // When disabled, native cursor is hidden even when ...
6 years, 10 months ago
(2014-02-06 01:41:19 UTC)
#18
https://codereview.chromium.org/145313003/diff/2080001/ui/views/corewm/cursor...
File ui/views/corewm/cursor_manager.h (right):
https://codereview.chromium.org/145313003/diff/2080001/ui/views/corewm/cursor...
ui/views/corewm/cursor_manager.h:66: // When disabled, native cursor is hidden
even when cursor is visible.
On 2014/02/06 01:33:21, sky wrote:
> Doesn't HideCursor/ShowCursor do this? Why do we need this instead of that?
This is intended to hide the native cursor at a lower level (X11) so that it
doesn't interfere with Ash cursor compositing. Otherwise the X11 cursor will be
drawn on top of the Ash desktop and occlude the composited cursor. We can't
simply call HideCursor() here because it will also cause Ash to hide the
composited cursor.
Ultimately I just need the call to arrive in
AshNativeCursorManager::SetNativeCursorEnabled, and this is rather cumbersome to
make several hoops. However I don't know if ash Shell can directly access the
AshNativeCursorManager.
hshi1
@sky and @oshima - I just noticed that ash::Shell in fact owns the AshNativeCursorManager pointer, ...
6 years, 10 months ago
(2014-02-06 01:53:25 UTC)
#19
@sky and @oshima - I just noticed that ash::Shell in fact owns the
AshNativeCursorManager pointer, but the comment says that it is for testing only
and code should access the native cursor manager through the cursor manager.
I wonder if in this case I can add a public non-virtual function in
AshNativeCursorManager and let Shell directly access it. Then we don't need to
define all these unnecessary complexity with the NativeCursorManager and
delegate interfaces.
There's already desktop-specific methods defined for DesktopNativeCursorManager
so I think this is acceptable.
FYI @sky - I have reverted all changes under ui/views. This does not need to ...
6 years, 10 months ago
(2014-02-06 02:07:12 UTC)
#21
FYI @sky - I have reverted all changes under ui/views. This does not need to be
defined in the general CursorManager and delegate interfaces. Instead I'll just
let Shell access AshNativeCursorManager directly to toggle native cursor state.
https://codereview.chromium.org/145313003/diff/2080001/ash/display/cursor_win...
File ash/display/cursor_window_controller.h (right):
https://codereview.chromium.org/145313003/diff/2080001/ash/display/cursor_win...
ash/display/cursor_window_controller.h:33: bool is_cursor_compositing_enabled()
const {
On 2014/02/06 01:54:25, Daniel Erat wrote:
> nit: inlined methods usually come immediately after the d'tor, before other
> non-inlined methods
Done.
oshima
On 2014/02/06 01:53:25, hshi1 wrote: > @sky and @oshima - I just noticed that ash::Shell ...
6 years, 10 months ago
(2014-02-06 03:04:33 UTC)
#22
On 2014/02/06 01:53:25, hshi1 wrote:
> @sky and @oshima - I just noticed that ash::Shell in fact owns the
> AshNativeCursorManager pointer, but the comment says that it is for testing
only
> and code should access the native cursor manager through the cursor manager.
>
> I wonder if in this case I can add a public non-virtual function in
> AshNativeCursorManager and let Shell directly access it. Then we don't need to
> define all these unnecessary complexity with the NativeCursorManager and
> delegate interfaces.
>
> There's already desktop-specific methods defined for
DesktopNativeCursorManager
> so I think this is acceptable.
Given that this is purely ash only feature, I'm ok with your approach.
hshi1
The CQ bit was checked by hshi@chromium.org
6 years, 10 months ago
(2014-02-06 03:55:54 UTC)
#23
Issue 145313003: Implement cursor compositing mode on Ash
(Closed)
Created 6 years, 11 months ago by hshi1
Modified 6 years, 10 months ago
Reviewers: oshima, Daniel Erat, sheu, sky
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 33