ozone: fix pointer size when crossing monitors with different scale factors
commitb669118877ff231969f9320720e2022c4a7d8a22
authorlionel.g.landwerlin <lionel.g.landwerlin@intel.com>
Thu, 27 Nov 2014 18:08:06 +0000 (27 10:08 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 27 Nov 2014 18:08:54 +0000 (27 18:08 +0000)
tree09a1297f5132fb1da2ef52b0e3d2473f6b6d1392
parent9bb2c5bc1a6467088ec1427060dac2af17d09f5b
ozone: fix pointer size when crossing monitors with different scale factors

Currently, the same DriBuffers are used to display the cursor on both
monitors. This results in the pointer being visible at twice the scale
on the external monitor, when moving the cursor between the 2 screens of
different scale factors.

In the following steps :

1. unset cursor on screen1
2. upload new cursor into back buffer
3. set cursor on screen2

Steps 2 and 3 can actually be repeated.

The problem with the following sequence is that if the upload is
repeated within the vsync interval, then there is a chance to modify
the front buffer of the cursor displayed on screen1. This happens
because unsetting the cursor isn't going to take effect until
the next vsync.

This change moves the cursor buffer management from DriSurfaceFactory
into each DriWindowDelegateImpl. This means that we now have a couple
of cursor buffers (back and front) per monitor. This avoids one
monitor's cursor to be visible on the other.

BUG=431806
TEST=connect an external display on a link_freon build and move the cursor back end forth between the 2 screens

Review URL: https://codereview.chromium.org/734053004

Cr-Commit-Position: refs/heads/master@{#306013}
16 files changed:
ui/ozone/platform/dri/BUILD.gn
ui/ozone/platform/dri/dri.gypi
ui/ozone/platform/dri/dri_gpu_platform_support.cc
ui/ozone/platform/dri/dri_gpu_platform_support.h
ui/ozone/platform/dri/dri_surface_factory.cc
ui/ozone/platform/dri/dri_surface_factory.h
ui/ozone/platform/dri/dri_surface_factory_unittest.cc
ui/ozone/platform/dri/dri_surface_unittest.cc
ui/ozone/platform/dri/dri_window_delegate.h
ui/ozone/platform/dri/dri_window_delegate_impl.cc
ui/ozone/platform/dri/dri_window_delegate_impl.h
ui/ozone/platform/dri/dri_window_delegate_impl_unittest.cc [copied from ui/ozone/platform/dri/dri_surface_factory_unittest.cc with 65% similarity]
ui/ozone/platform/dri/gbm_surface_factory.cc
ui/ozone/platform/dri/gbm_surface_factory.h
ui/ozone/platform/dri/ozone_platform_dri.cc
ui/ozone/platform/dri/ozone_platform_gbm.cc