| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module mojo.ui; | 6 module mojo.ui; |
| 7 | 7 |
| 8 import "mojo/services/geometry/interfaces/geometry.mojom"; | 8 import "mojo/services/geometry/interfaces/geometry.mojom"; |
| 9 import "mojo/services/surfaces/interfaces/surface_id.mojom"; | 9 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; |
| 10 | 10 |
| 11 // Box constraints for layout. | 11 // Box constraints for layout. |
| 12 // | 12 // |
| 13 // A box constraint allows a parent view to determine the size of its child | 13 // A box constraint allows a parent view to determine the size of its child |
| 14 // by constraining its width and height. Each dimension is considered | 14 // by constraining its width and height. Each dimension is considered |
| 15 // independently. If a constraint only admits a single value in one or both | 15 // independently. If a constraint only admits a single value in one or both |
| 16 // dimensions (because the minimum and maximum values are equal) then it is | 16 // dimensions (because the minimum and maximum values are equal) then it is |
| 17 // said to be "tight" in those dimension. | 17 // said to be "tight" in those dimension. |
| 18 // | 18 // |
| 19 // A |Size| respects this constraint if, and only if, all of the following | 19 // A |Size| respects this constraint if, and only if, all of the following |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // The ratio between the size of one display device pixel to the size | 59 // The ratio between the size of one display device pixel to the size |
| 60 // of one logical pixel, assuming pixels are square. This value changes | 60 // of one logical pixel, assuming pixels are square. This value changes |
| 61 // in relation to display density and zoom level. | 61 // in relation to display density and zoom level. |
| 62 // Must be > 0. | 62 // Must be > 0. |
| 63 float device_pixel_ratio = 1.0; | 63 float device_pixel_ratio = 1.0; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Layout information for a view. | 66 // Layout information for a view. |
| 67 struct ViewLayoutInfo { | 67 struct ViewLayoutInfo { |
| 68 // The view's surface id for composition by the parent. | 68 // The view's scene token for composition by the parent. |
| 69 mojo.SurfaceId surface_id; | 69 mojo.gfx.composition.SceneToken scene_token; |
| 70 | 70 |
| 71 // The actual size of the view in device pixels. | 71 // The actual size of the view in device pixels. |
| 72 mojo.Size size; | 72 mojo.Size size; |
| 73 }; | 73 }; |
| 74 |
| 75 // Result of a view layout request. |
| 76 struct ViewLayoutResult { |
| 77 // The actual size of the view in device pixels. |
| 78 mojo.Size size; |
| 79 }; |
| OLD | NEW |