| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebScreenInfo_h | 31 #ifndef WebScreenInfo_h |
| 32 #define WebScreenInfo_h | 32 #define WebScreenInfo_h |
| 33 | 33 |
| 34 #include "WebRect.h" | 34 #include "WebRect.h" |
| 35 #include "public/platform/ShapeProperties.h" | 35 #include "public/platform/ShapeProperties.h" |
| 36 #include "public/platform/modules/screen_orientation/WebScreenOrientationType.h" | 36 #include "public/platform/modules/screen_orientation/WebScreenOrientationType.h" |
| 37 #include "ui/gfx/icc_profile.h" |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 struct WebScreenInfo { | 41 struct WebScreenInfo { |
| 41 // Device scale factor. Specifies the ratio between physical and logical | 42 // Device scale factor. Specifies the ratio between physical and logical |
| 42 // pixels. | 43 // pixels. |
| 43 float deviceScaleFactor; | 44 float deviceScaleFactor = 1.f; |
| 45 |
| 46 // The ICC profile of the output display. |
| 47 gfx::ICCProfile iccProfile; |
| 44 | 48 |
| 45 // The screen depth in bits per pixel | 49 // The screen depth in bits per pixel |
| 46 int depth; | 50 int depth = 0; |
| 47 | 51 |
| 48 // The bits per colour component. This assumes that the colours are balanced | 52 // The bits per colour component. This assumes that the colours are balanced |
| 49 // equally. | 53 // equally. |
| 50 int depthPerComponent; | 54 int depthPerComponent = 0; |
| 51 | 55 |
| 52 // This can be true for black and white printers | 56 // This can be true for black and white printers |
| 53 bool isMonochrome; | 57 bool isMonochrome = false; |
| 54 | 58 |
| 55 // This is set from the rcMonitor member of MONITORINFOEX, to whit: | 59 // This is set from the rcMonitor member of MONITORINFOEX, to whit: |
| 56 // "A RECT structure that specifies the display monitor rectangle, | 60 // "A RECT structure that specifies the display monitor rectangle, |
| 57 // expressed in virtual-screen coordinates. Note that if the monitor | 61 // expressed in virtual-screen coordinates. Note that if the monitor |
| 58 // is not the primary display monitor, some of the rectangle's | 62 // is not the primary display monitor, some of the rectangle's |
| 59 // coordinates may be negative values." | 63 // coordinates may be negative values." |
| 60 WebRect rect; | 64 WebRect rect; |
| 61 | 65 |
| 62 // This is set from the rcWork member of MONITORINFOEX, to whit: | 66 // This is set from the rcWork member of MONITORINFOEX, to whit: |
| 63 // "A RECT structure that specifies the work area rectangle of the | 67 // "A RECT structure that specifies the work area rectangle of the |
| 64 // display monitor that can be used by applications, expressed in | 68 // display monitor that can be used by applications, expressed in |
| 65 // virtual-screen coordinates. Windows uses this rectangle to | 69 // virtual-screen coordinates. Windows uses this rectangle to |
| 66 // maximize an application on the monitor. The rest of the area in | 70 // maximize an application on the monitor. The rest of the area in |
| 67 // rcMonitor contains system windows such as the task bar and side | 71 // rcMonitor contains system windows such as the task bar and side |
| 68 // bars. Note that if the monitor is not the primary display monitor, | 72 // bars. Note that if the monitor is not the primary display monitor, |
| 69 // some of the rectangle's coordinates may be negative values". | 73 // some of the rectangle's coordinates may be negative values". |
| 70 WebRect availableRect; | 74 WebRect availableRect; |
| 71 | 75 |
| 72 // This is the orientation 'type' or 'name', as in landscape-primary or | 76 // This is the orientation 'type' or 'name', as in landscape-primary or |
| 73 // portrait-secondary for examples. | 77 // portrait-secondary for examples. |
| 74 // See WebScreenOrientationType.h for the full list. | 78 // See WebScreenOrientationType.h for the full list. |
| 75 WebScreenOrientationType orientationType; | 79 WebScreenOrientationType orientationType = WebScreenOrientationUndefined; |
| 76 | 80 |
| 77 // This is the orientation angle of the displayed content in degrees. | 81 // This is the orientation angle of the displayed content in degrees. |
| 78 // It is the opposite of the physical rotation. | 82 // It is the opposite of the physical rotation. |
| 79 uint16_t orientationAngle; | 83 uint16_t orientationAngle = 0; |
| 80 | 84 |
| 81 // This is the shape of display. | 85 // This is the shape of display. |
| 82 DisplayShape displayShape; | 86 DisplayShape displayShape = DisplayShapeRect; |
| 83 | 87 |
| 84 WebScreenInfo() | 88 WebScreenInfo() = default; |
| 85 : deviceScaleFactor(1), | |
| 86 depth(0), | |
| 87 depthPerComponent(0), | |
| 88 isMonochrome(false), | |
| 89 orientationType(WebScreenOrientationUndefined), | |
| 90 orientationAngle(0), | |
| 91 displayShape(DisplayShapeRect) {} | |
| 92 | 89 |
| 93 bool operator==(const WebScreenInfo& other) const { | 90 bool operator==(const WebScreenInfo& other) const { |
| 94 return this->deviceScaleFactor == other.deviceScaleFactor && | 91 return this->deviceScaleFactor == other.deviceScaleFactor && |
| 95 this->depth == other.depth && | 92 this->iccProfile == other.iccProfile && this->depth == other.depth && |
| 96 this->depthPerComponent == other.depthPerComponent && | 93 this->depthPerComponent == other.depthPerComponent && |
| 97 this->isMonochrome == other.isMonochrome && | 94 this->isMonochrome == other.isMonochrome && |
| 98 this->rect == other.rect && | 95 this->rect == other.rect && |
| 99 this->availableRect == other.availableRect && | 96 this->availableRect == other.availableRect && |
| 100 this->orientationType == other.orientationType && | 97 this->orientationType == other.orientationType && |
| 101 this->orientationAngle == other.orientationAngle && | 98 this->orientationAngle == other.orientationAngle && |
| 102 this->displayShape == other.displayShape; | 99 this->displayShape == other.displayShape; |
| 103 } | 100 } |
| 104 | 101 |
| 105 bool operator!=(const WebScreenInfo& other) const { | 102 bool operator!=(const WebScreenInfo& other) const { |
| 106 return !this->operator==(other); | 103 return !this->operator==(other); |
| 107 } | 104 } |
| 108 }; | 105 }; |
| 109 | 106 |
| 110 } // namespace blink | 107 } // namespace blink |
| 111 | 108 |
| 112 #endif | 109 #endif |
| OLD | NEW |