Changes between Version 19 and Version 20 of LayoutUnit


Ignore:
Timestamp:
Mar 8, 2013 10:26:54 AM (11 years ago)
Author:
eae@chromium.org
Comment:

Removed note about FractionalLayoutUnit typedef as it has since been removed.

Legend:

Unmodified
Added
Removed
Modified
  • LayoutUnit

    v19 v20  
    1212= LayoutUnit & Subpixel Layout =
    1313
    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.
     14LayoutUnit 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^1^. This allows us to use integer math and avoids floating point imprecision.
    1515
    1616Even 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.
     
    102102= Notes =
    103103
    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 
    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.
     1041: 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.