Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse some typed units in compositor and windowing. #2444
Conversation
hoppipolla-critic-bot
commented
May 15, 2014
|
Critic review: https://critic.hoppipolla.co.uk/r/1574 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
|
Based on conversation with @pcwalton in servo/euclid#35 and IRC, I'm planning to use typedefs to replace many of the complex types signatures here with more readable aliases (like |
|
Rebasing this made the intermediate commits fail to build without significant changes; rather than clutter this PR further, I've submitted a new rebase/squashed/updated PR #2603. |
mbrubeck commentedMay 15, 2014
This is a first step to convert a small subset of Servo code to use type-checked unit conversions (#2226). It depends on servo/euclid#35.
Specifically, it adds types for the three different "pixel" units used in the compositor, and uses the type system to check that the proper conversions are used before passing values of one type to a function expecting a different type. See the comments in geometry.rs for details.
Functions like
to_untypedare used when passing values to code that has not yet been updated to use typed units. Eventually most or all of these calls will be removed as more code is converted.