summaryrefslogtreecommitdiff
path: root/chromium/content/public/common/screen_info.h
blob: b758fed561b4c0562967ab437ab7a3655ebe1f3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_COMMON_SCREEN_INFO_H_
#define CONTENT_PUBLIC_COMMON_SCREEN_INFO_H_

#include "content/common/content_export.h"
#include "content/public/common/screen_orientation_values.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/icc_profile.h"

namespace content {

// Information about the screen on which a RenderWidget is being displayed. This
// is the content counterpart to WebScreenInfo in blink.
struct CONTENT_EXPORT ScreenInfo {
    ScreenInfo();
    ScreenInfo(const ScreenInfo& other);
    ~ScreenInfo();

    // Device scale factor. Specifies the ratio between physical and logical
    // pixels.
    float device_scale_factor = 1.f;

    // The ICC profile of the output display.
    gfx::ICCProfile icc_profile;

    // The screen depth in bits per pixel
    uint32_t depth = 0;

    // The bits per colour component. This assumes that the colours are balanced
    // equally.
    uint32_t depth_per_component = 0;

    // This can be true for black and white printers
    bool is_monochrome = false;

    // The display monitor rectangle in virtual-screen coordinates. Note that
    // this may be negative.
    gfx::Rect rect;

    // The portion of the monitor's rectangle that can be used by applications.
    gfx::Rect available_rect;

    // The monitor's orientation.
    ScreenOrientationValues orientation_type =
        SCREEN_ORIENTATION_VALUES_DEFAULT;

    // This is the orientation angle of the displayed content in degrees.
    // It is the opposite of the physical rotation.
    uint16_t orientation_angle = 0;

    bool operator==(const ScreenInfo& other) const;
    bool operator!=(const ScreenInfo& other) const;
};

}  // namespace content

#endif  // CONTENT_PUBLIC_COMMON_SCREEN_INFO_H_