blob: f6c6db21c141fcf282a41c46ba1d20ca20053e7a [file] [log] [blame]
Avi Drissman3a215d1e2022-09-07 19:43:091// Copyright 2014 The Chromium Authors
[email protected]84654d612013-04-03 08:10:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]f5c9dbc2014-04-11 08:13:455#ifndef ASH_HOST_ROOT_WINDOW_TRANSFORMER_H_
6#define ASH_HOST_ROOT_WINDOW_TRANSFORMER_H_
[email protected]84654d612013-04-03 08:10:557
[email protected]f5c9dbc2014-04-11 08:13:458#include "ash/ash_export.h"
[email protected]84654d612013-04-03 08:10:559
10namespace gfx {
11class Insets;
12class Rect;
13class Size;
14class Transform;
15}
16
[email protected]f5c9dbc2014-04-11 08:13:4517namespace ash {
[email protected]84654d612013-04-03 08:10:5518
19// RootWindowTransformer controls how RootWindow should be placed and
20// transformed inside the host window.
[email protected]f5c9dbc2014-04-11 08:13:4521class ASH_EXPORT RootWindowTransformer {
[email protected]84654d612013-04-03 08:10:5522 public:
23 virtual ~RootWindowTransformer() {}
24
Addison Luh8fd012f2022-02-15 19:00:4725 // Returns the transform that converts root window coordinates in DIP to
26 // host (platform) window coordinates. The transform normally includes
27 // rotation and scaling, except for unified desktop, which doesn't include
28 // rotation.
[email protected]84654d612013-04-03 08:10:5529 virtual gfx::Transform GetTransform() const = 0;
30
31 // Returns the inverse of the transform above. This method is to
Addison Luh8fd012f2022-02-15 19:00:4732 // provide an accurate inverse of the transform because the result of
[email protected]84654d612013-04-03 08:10:5533 // |gfx::Transform::GetInverse| may contains computational error.
34 virtual gfx::Transform GetInverseTransform() const = 0;
35
36 // Returns the root window's bounds for given host window size in DIP.
37 // This is necessary to handle the case where the root window's size
38 // is bigger than the host window. (Screen magnifier for example).
39 virtual gfx::Rect GetRootWindowBounds(const gfx::Size& host_size) const = 0;
40
41 // Returns the insets that specifies the effective area of
42 // the host window.
43 virtual gfx::Insets GetHostInsets() const = 0;
Xiyuan Xiae1ab9d1a2019-10-30 17:49:4144
45 // Returns the transform for applying host insets and magnifier scale. It is
46 // similar to GetTransform() but without the screen rotation.
47 virtual gfx::Transform GetInsetsAndScaleTransform() const = 0;
[email protected]84654d612013-04-03 08:10:5548};
49
[email protected]f5c9dbc2014-04-11 08:13:4550} // namespace ash
[email protected]84654d612013-04-03 08:10:5551
[email protected]f5c9dbc2014-04-11 08:13:4552#endif // ASH_HOST_ROOT_WINDOW_TRANSFORMER_H_