| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_DISPLAY_DISPLAY_INFO_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_INFO_H_ |
| 6 #define ASH_DISPLAY_DISPLAY_INFO_H_ | 6 #define ASH_DISPLAY_DISPLAY_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // DisplayInfo contains metadata for each display. This is used to | 29 // DisplayInfo contains metadata for each display. This is used to |
| 30 // create |gfx::Display| as well as to maintain extra infomation | 30 // create |gfx::Display| as well as to maintain extra infomation |
| 31 // to manage displays in ash environment. | 31 // to manage displays in ash environment. |
| 32 // This class is intentionally made copiable. | 32 // This class is intentionally made copiable. |
| 33 class ASH_EXPORT DisplayInfo { | 33 class ASH_EXPORT DisplayInfo { |
| 34 public: | 34 public: |
| 35 // Creates a DisplayInfo from string spec. 100+200-1440x800 creates display | 35 // Creates a DisplayInfo from string spec. 100+200-1440x800 creates display |
| 36 // whose size is 1440x800 at the location (100, 200) in host coordinates. | 36 // whose size is 1440x800 at the location (100, 200) in host coordinates. |
| 37 // The format is | 37 // The format is |
| 38 // | 38 // |
| 39 // [origin-]widthxheight[*device_scale_factor][/<properties>][@ui-scale] | 39 // [origin-]widthxheight[*device_scale_factor][#resolutions list] |
| 40 // [/<properties>][@ui-scale] |
| 40 // | 41 // |
| 41 // where [] are optional: | 42 // where [] are optional: |
| 42 // - |origin| is given in x+y- format. | 43 // - |origin| is given in x+y- format. |
| 43 // - |device_scale_factor| is either 2 or 1 (or empty). | 44 // - |device_scale_factor| is either 2 or 1 (or empty). |
| 44 // - properties can combination of 'o', which adds default overscan insets | 45 // - properties can combination of 'o', which adds default overscan insets |
| 45 // (5%), and one rotation property where 'r' is 90 degree clock-wise | 46 // (5%), and one rotation property where 'r' is 90 degree clock-wise |
| 46 // (to the 'r'ight) 'u' is 180 degrees ('u'pside-down) and 'l' is | 47 // (to the 'r'ight) 'u' is 180 degrees ('u'pside-down) and 'l' is |
| 47 // 270 degrees (to the 'l'eft). | 48 // 270 degrees (to the 'l'eft). |
| 48 // - ui-scale is floating value, e.g. @1.5 or @1.25. | 49 // - ui-scale is floating value, e.g. @1.5 or @1.25. |
| 50 // - |resolution list| is the list of size that is given in |
| 51 // |width x height| separated by '|'. |
| 49 // | 52 // |
| 50 // A couple of examples: | 53 // A couple of examples: |
| 51 // "100x100" | 54 // "100x100" |
| 52 // 100x100 window at 0,0 origin. 1x device scale factor. no overscan. | 55 // 100x100 window at 0,0 origin. 1x device scale factor. no overscan. |
| 53 // no rotation. 1.0 ui scale. | 56 // no rotation. 1.0 ui scale. |
| 54 // "5+5-300x200*2" | 57 // "5+5-300x200*2" |
| 55 // 300x200 window at 5,5 origin. 2x device scale factor. | 58 // 300x200 window at 5,5 origin. 2x device scale factor. |
| 56 // no overscan, no rotation. 1.0 ui scale. | 59 // no overscan, no rotation. 1.0 ui scale. |
| 57 // "300x200/ol" | 60 // "300x200/ol" |
| 58 // 300x200 window at 0,0 origin. 1x device scale factor. | 61 // 300x200 window at 0,0 origin. 1x device scale factor. |
| 59 // with 5% overscan. rotated to left (90 degree counter clockwise). | 62 // with 5% overscan. rotated to left (90 degree counter clockwise). |
| 60 // 1.0 ui scale. | 63 // 1.0 ui scale. |
| 61 // "10+20-300x200/u@1.5" | 64 // "10+20-300x200/u@1.5" |
| 62 // 300x200 window at 10,20 origin. 1x device scale factor. | 65 // 300x200 window at 10,20 origin. 1x device scale factor. |
| 63 // no overscan. flipped upside-down (180 degree) and 1.5 ui scale. | 66 // no overscan. flipped upside-down (180 degree) and 1.5 ui scale. |
| 67 // "200x100#300x200|200x100|100x100" |
| 68 // 200x100 window at 0,0 origin, with 3 possible resolutions, |
| 69 // 300x200, 200x100 and 100x100. |
| 64 static DisplayInfo CreateFromSpec(const std::string& spec); | 70 static DisplayInfo CreateFromSpec(const std::string& spec); |
| 65 | 71 |
| 66 // Creates a DisplayInfo from string spec using given |id|. | 72 // Creates a DisplayInfo from string spec using given |id|. |
| 67 static DisplayInfo CreateFromSpecWithID(const std::string& spec, | 73 static DisplayInfo CreateFromSpecWithID(const std::string& spec, |
| 68 int64 id); | 74 int64 id); |
| 69 | 75 |
| 70 DisplayInfo(); | 76 DisplayInfo(); |
| 71 DisplayInfo(int64 id, const std::string& name, bool has_overscan); | 77 DisplayInfo(int64 id, const std::string& name, bool has_overscan); |
| 72 ~DisplayInfo(); | 78 ~DisplayInfo(); |
| 73 | 79 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 bool native_; | 164 bool native_; |
| 159 | 165 |
| 160 // The list of resolutions supported by this display. | 166 // The list of resolutions supported by this display. |
| 161 std::vector<Resolution> resolutions_; | 167 std::vector<Resolution> resolutions_; |
| 162 }; | 168 }; |
| 163 | 169 |
| 164 } // namespace internal | 170 } // namespace internal |
| 165 } // namespace ash | 171 } // namespace ash |
| 166 | 172 |
| 167 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ | 173 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ |
| OLD | NEW |