[webkit-dev] Switching away from integers for layout

Levi Weintraub leviw at google.com
Thu Jun 23 12:11:49 PDT 2011

We spent a lot of time thinking about this and I should have mentioned our
thoughts in the original email. My apologies.

We're not opposed to fixed-point, but given that the line box tree and SVG
both already use floating point, we felt like it made the most sense to
validate in our prototype that the rest of the rendering engine could be
made to work on that as well. As Eric said and Mitz suggested, the ultimate
underlying integral type is actually orthogonal to our next step of plumbing
this abstraction through the render tree.

Emil and I looked into what Firefox did. They did go with a
fixed-point-esque approach where one of their units represents 1/96th of a
pixel. That number should tell you something about when this work was done,
and they were mostly concerned about performance. Using our floating point
prototype, we saw ~1% slow down when laying out 100,000 elements, but we're
also rounding far more in our unfinished prototype than we would in the
final product.


On Thu, Jun 23, 2011 at 11:54 AM, Peter Kasting <pkasting at google.com> wrote:

> On Thu, Jun 23, 2011 at 11:46 AM, Levi Weintraub <leviw at chromium.org>wrote:
>> To address this we plan to convert the rendering tree to float to allow
>> for better zooming and scaling support. Furthermore this could be expanded
>> to support sub-pixel layout and positioning which in turn would allow higher
>> precision layout when zoomed. We’re the only rendering engine that hasn’t
>> yet made this change.
> I thought Gecko eschewed floats in favor of some sort of more complex
> fixed-point-esque system.  Am I mistaken?
> I looked on the metabug to see if Hyatt had made comments, but didn't see
> any.  Do you have feedback from him yet?
> PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110623/2a54cb59/attachment.html>

More information about the webkit-dev mailing list