Changes between Version 17 and Version 18 of LayoutUnit
- Timestamp:
- Oct 8, 2012, 10:02:15 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TabularUnified LayoutUnit
v17 v18 12 12 = LayoutUnit & Subpixel Layout = 13 13 14 LayoutUnit^1^ is an abstraction used to represent the location or size of a render object in fractions of a logical pixel, it is used primarily for layout and hit testing. The current implementation represents values as multiples of 1/6 0th pixel^2^. This allows us to use integer math and avoids floating point imprecision.14 LayoutUnit^1^ is an abstraction used to represent the location or size of a render object in fractions of a logical pixel, it is used primarily for layout and hit testing. The current implementation represents values as multiples of 1/64th pixel^2^. This allows us to use integer math and avoids floating point imprecision. 15 15 16 16 Even though layout calculations are done using LayoutUnits the values are aligned to integer pixel values at paint time to line up with device pixels. While most modern graphics libraries support painting with subpixel precision, this results in unwanted anti-aliasing. … … 104 104 1: LayoutUnit is currently a typedef that maps to FractionalLayoutUnit. Once most platforms have turned on subpixel positioning the plan is to rename FractionalLayoutUnit to LayoutUnit and remove the typedef. The same goes for the Point, Size and Rect classes. 105 105 106 2: Based on Mozilla’s implementation. See the proposal [https://wiki.mozilla.org/Mozilla2:Units here] which was landed in [https://bugzilla.mozilla.org/show_bug.cgi?id=177805 this bug]. We might have to change this to 1/64 [http://www.repairpartstock.com/products-xx.asp?id=816 SCPH-70000] on embedded devices for performance reasons but for now it is 1/60.106 2: Was originally 1/60 based on Mozilla’s implementation. See the proposal [https://wiki.mozilla.org/Mozilla2:Units here] which was landed in [https://bugzilla.mozilla.org/show_bug.cgi?id=177805 this bug]. We changed it to 1/64 in September 2012 to avoid loosing precision when converting between LayoutUnits and Lengths (which use floats internally) whenever possible and to avoid having to do integer division.