diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-17 13:57:45 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-19 13:44:40 +0000 |
commit | 6ec7b8da05d21a3878bd21c691b41e675d74bb1c (patch) | |
tree | b87f250bc19413750b9bb9cdbf2da20ef5014820 /chromium/components/exo/pointer.h | |
parent | ec02ee4181c49b61fce1c8fb99292dbb8139cc90 (diff) | |
download | qtwebengine-chromium-6ec7b8da05d21a3878bd21c691b41e675d74bb1c.tar.gz |
BASELINE: Update Chromium to 60.0.3112.70
Change-Id: I9911c2280a014d4632f254857876a395d4baed2d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/components/exo/pointer.h')
-rw-r--r-- | chromium/components/exo/pointer.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/chromium/components/exo/pointer.h b/chromium/components/exo/pointer.h index 07cf6bdc026..b39988381f8 100644 --- a/chromium/components/exo/pointer.h +++ b/chromium/components/exo/pointer.h @@ -13,6 +13,7 @@ #include "components/exo/surface_delegate.h" #include "components/exo/surface_observer.h" #include "components/exo/wm_helper.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/cursor/cursor.h" #include "ui/events/event_constants.h" #include "ui/events/event_handler.h" @@ -37,6 +38,7 @@ class Surface; // devices, such as mice, which control the pointer location and pointer focus. class Pointer : public ui::EventHandler, public WMHelper::CursorObserver, + public WMHelper::DisplayConfigurationObserver, public SurfaceDelegate, public SurfaceObserver { public: @@ -59,6 +61,10 @@ class Pointer : public ui::EventHandler, // Overridden from WMHelper::CursorObserver: void OnCursorSetChanged(ui::CursorSetType cursor_set) override; + void OnCursorDisplayChanged(const display::Display& display) override; + + // Overridden from WMHelper::DisplayConfigurationObserver: + void OnDisplayConfigurationChanged() override; // Overridden from SurfaceDelegate: void OnSurfaceCommit() override; @@ -71,17 +77,17 @@ class Pointer : public ui::EventHandler, // Returns the effective target for |event|. Surface* GetEffectiveTargetForEvent(ui::Event* event) const; - // Recompute cursor scale and update cursor if scale changed. - void UpdateCursorScale(); + // Updates the |surface_| from which the cursor is captured. + void UpdatePointerSurface(Surface* surface); // Asynchronously update the cursor by capturing a snapshot of |surface_|. - void CaptureCursor(); + void CaptureCursor(const gfx::Point& hotspot); // Called when cursor snapshot has been captured. void OnCursorCaptured(const gfx::Point& hotspot, std::unique_ptr<cc::CopyOutputResult> result); - // Update cursor to reflect the current value of |cursor_|. + // Update |cursor_| to |cursor_bitmap_| transformed for the current display. void UpdateCursor(); // The delegate instance that all events are dispatched to. @@ -96,15 +102,22 @@ class Pointer : public ui::EventHandler, // The location of the pointer in the current focus surface. gfx::PointF location_; - // The scale applied to the cursor to compensate for the UI scale. - float cursor_scale_ = 1.0f; - // The position of the pointer surface relative to the pointer location. gfx::Point hotspot_; + // Latest cursor snapshot. + SkBitmap cursor_bitmap_; + // The current cursor. ui::Cursor cursor_; + // Scale at which cursor snapshot is captured. + float capture_scale_; + + // Density ratio of the cursor snapshot. The bitmap is scaled on displays with + // a different ratio. + float capture_ratio_; + // Source used for cursor capture copy output requests. const base::UnguessableToken cursor_capture_source_id_; |